|
|
|
|
@@ -2,10 +2,10 @@
|
|
|
|
|
import { ref, onMounted, nextTick } from 'vue'
|
|
|
|
|
import { marked } from 'marked'
|
|
|
|
|
import mermaid from 'mermaid'
|
|
|
|
|
import { api } from '../api'
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
workflowId: string
|
|
|
|
|
projectId: string
|
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
const html = ref('')
|
|
|
|
|
@@ -38,15 +38,10 @@ async function renderMermaid() {
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch(`/tori/api/projects/${props.projectId}/files/report.md?raw`)
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
const md = await res.text()
|
|
|
|
|
html.value = await marked.parse(md)
|
|
|
|
|
} else {
|
|
|
|
|
const res = await api.getReport(props.workflowId)
|
|
|
|
|
html.value = await marked.parse(res.report)
|
|
|
|
|
} catch {
|
|
|
|
|
error.value = '暂无报告。Agent 完成后会生成 report.md。'
|
|
|
|
|
}
|
|
|
|
|
} catch (e: any) {
|
|
|
|
|
error.value = e.message
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
@@ -67,171 +62,34 @@ onMounted(async () => {
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.report-page {
|
|
|
|
|
max-width: 860px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 24px 32px;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-toolbar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
padding-bottom: 12px;
|
|
|
|
|
border-bottom: 1px solid var(--border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.back-link {
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.back-link:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-title {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-loading,
|
|
|
|
|
.report-error {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 48px;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-error {
|
|
|
|
|
color: var(--error);
|
|
|
|
|
}
|
|
|
|
|
.report-page { max-width: 860px; margin: 0 auto; padding: 24px 32px; min-height: 100vh; }
|
|
|
|
|
.report-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
|
|
|
|
|
.back-link { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 500; }
|
|
|
|
|
.back-link:hover { text-decoration: underline; }
|
|
|
|
|
.report-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
|
|
|
|
|
.report-loading, .report-error { text-align: center; padding: 48px; color: var(--text-secondary); font-size: 14px; }
|
|
|
|
|
.report-error { color: var(--error); }
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
/* Unscoped styles for rendered markdown */
|
|
|
|
|
.report-body {
|
|
|
|
|
line-height: 1.7;
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body h1 {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
margin: 0 0 16px;
|
|
|
|
|
padding-bottom: 8px;
|
|
|
|
|
border-bottom: 2px solid var(--border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body h2 {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin: 24px 0 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body h3 {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin: 20px 0 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body p {
|
|
|
|
|
margin: 0 0 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body ul,
|
|
|
|
|
.report-body ol {
|
|
|
|
|
margin: 0 0 12px;
|
|
|
|
|
padding-left: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body li {
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body pre {
|
|
|
|
|
background: var(--bg-secondary);
|
|
|
|
|
border: 1px solid var(--border);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
margin: 0 0 12px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body code {
|
|
|
|
|
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body :not(pre) > code {
|
|
|
|
|
background: var(--bg-secondary);
|
|
|
|
|
padding: 2px 6px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
margin: 0 0 12px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body th,
|
|
|
|
|
.report-body td {
|
|
|
|
|
border: 1px solid var(--border);
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body th {
|
|
|
|
|
background: var(--bg-secondary);
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body blockquote {
|
|
|
|
|
border-left: 3px solid var(--accent);
|
|
|
|
|
padding-left: 16px;
|
|
|
|
|
margin: 0 0 12px;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body a {
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body a:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body .mermaid-chart {
|
|
|
|
|
margin: 16px 0;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body .mermaid-chart svg {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body img {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.report-body hr {
|
|
|
|
|
border: none;
|
|
|
|
|
border-top: 1px solid var(--border);
|
|
|
|
|
margin: 20px 0;
|
|
|
|
|
}
|
|
|
|
|
.report-body { line-height: 1.7; color: var(--text-primary); font-size: 15px; }
|
|
|
|
|
.report-body h1 { font-size: 24px; font-weight: 700; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
|
|
|
|
|
.report-body h2 { font-size: 20px; font-weight: 600; margin: 24px 0 12px; }
|
|
|
|
|
.report-body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
|
|
|
|
|
.report-body p { margin: 0 0 12px; }
|
|
|
|
|
.report-body ul, .report-body ol { margin: 0 0 12px; padding-left: 24px; }
|
|
|
|
|
.report-body li { margin-bottom: 4px; }
|
|
|
|
|
.report-body pre { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; overflow-x: auto; margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
|
|
|
|
|
.report-body code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px; }
|
|
|
|
|
.report-body :not(pre) > code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 4px; }
|
|
|
|
|
.report-body table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
|
|
|
|
|
.report-body th, .report-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
|
|
|
|
|
.report-body th { background: var(--bg-secondary); font-weight: 600; }
|
|
|
|
|
.report-body blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 0 0 12px; color: var(--text-secondary); }
|
|
|
|
|
.report-body a { color: var(--accent); text-decoration: none; }
|
|
|
|
|
.report-body a:hover { text-decoration: underline; }
|
|
|
|
|
.report-body .mermaid-chart { margin: 16px 0; text-align: center; }
|
|
|
|
|
.report-body .mermaid-chart svg { max-width: 100%; }
|
|
|
|
|
.report-body img { max-width: 100%; border-radius: 6px; }
|
|
|
|
|
.report-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
|
|
|
|
|
</style>
|
|
|
|
|
|