fix
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-03-30 22:30:41 -06:00
parent 1df211c760
commit a97a40475a
6 changed files with 53 additions and 15 deletions

View File

@@ -233,7 +233,6 @@ export const Submission = {
const res = await http.get(`/submission/stats/${taskId}`, { params })
return res.data as TaskStatsOut
},
}
export const Prompt = {

View File

@@ -16,14 +16,27 @@
placeholder="粘贴外部 AI 返回的完整 HTML 代码..."
/>
<div v-if="splitResult" class="split-result">
<n-tag size="small" type="success">HTML · {{ splitResult.html.length }} 字符</n-tag>
<n-tag size="small" type="info">CSS · {{ splitResult.css.length }} 字符</n-tag>
<n-tag size="small" type="warning">JS · {{ splitResult.js.length }} 字符</n-tag>
<n-tag size="small" type="success"
>HTML · {{ splitResult.html.length }} 字符</n-tag
>
<n-tag size="small" type="info"
>CSS · {{ splitResult.css.length }} 字符</n-tag
>
<n-tag size="small" type="warning"
>JS · {{ splitResult.js.length }} 字符</n-tag
>
</div>
</div>
<div class="action-bar">
<n-button :disabled="!rawCode.trim()" @click="applyPreview">应用预览</n-button>
<n-button type="primary" :disabled="!splitResult" :loading="submitting" @click="submit">
<n-button :disabled="!rawCode.trim()" @click="applyPreview"
>应用预览</n-button
>
<n-button
type="primary"
:disabled="!splitResult"
:loading="submitting"
@click="submit"
>
提交
</n-button>
</div>

View File

@@ -2,7 +2,9 @@
<n-flex align="center" justify="space-between" class="title">
<div>
<n-text class="titleText">预览</n-text>
<n-text v-if="!!submission.id" depth="3">({{ submission.view_count || 0 }})</n-text>
<n-text v-if="!!submission.id" depth="3"
>({{ submission.view_count || 0 }})</n-text
>
</div>
<n-flex>
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>

View File

@@ -75,7 +75,14 @@
transition: 'all 0.2s',
}"
>
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 8px">
<div
style="
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 8px;
"
>
<span>{{ round.question }}</span>
<span
v-if="round.prompt_level"
@@ -86,7 +93,8 @@
color: levelColors[round.prompt_level],
marginTop: '2px',
}"
>L{{ round.prompt_level }}</span>
>L{{ round.prompt_level }}</span
>
</div>
</div>
</div>
@@ -152,7 +160,13 @@ const rounds = computed(() => {
break
}
}
result.push({ question: msg.content, prompt_level: msg.prompt_level ?? null, html, css, js })
result.push({
question: msg.content,
prompt_level: msg.prompt_level ?? null,
html,
css,
js,
})
}
return result
})

View File

@@ -12,7 +12,9 @@
<n-button
v-if="authed"
text
@click="$router.push({ name: 'submissions', params: { page: 1 } })"
@click="
$router.push({ name: 'submissions', params: { page: 1 } })
"
>
<Icon :width="16" icon="lucide:list" />
</n-button>
@@ -24,7 +26,12 @@
<n-tab-pane name="desc" tab="挑战描述" display-directive="show">
<div
class="markdown-body"
style="padding: 12px; overflow-y: auto; height: 100%"
style="
padding: 12px;
overflow-y: auto;
height: calc(100% - 45px);
box-sizing: border-box;
"
v-html="challengeContent"
/>
</n-tab-pane>

View File

@@ -225,7 +225,10 @@ const columns: DataTableColumn<SubmissionOut>[] = [
key: "zone",
width: 42,
render: (row) => {
const map: Record<string, { label: string; type: "success" | "default" | "warning" }> = {
const map: Record<
string,
{ label: string; type: "success" | "default" | "warning" }
> = {
featured: { label: "", type: "success" },
pending: { label: "N", type: "default" },
low: { label: "", type: "warning" },