Commit 8941015f authored by xuchentao's avatar xuchentao

后台配色统一为品牌暖色调,移除绿色残留与静态页面生成提示,验证码改为红棕配色

parent 86facc5e
...@@ -604,11 +604,11 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body ...@@ -604,11 +604,11 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body
await new Promise((resolve) => setTimeout(resolve, 1000)); await new Promise((resolve) => setTimeout(resolve, 1000));
const state = await api("/build"); const state = await api("/build");
if (state.status === "building") continue; if (state.status === "building") continue;
$("#build-title").textContent = state.ok ? `${action}成功` : `${action}失败`; if (state.ok) { hide("#build-modal"); return; }
$("#build-log").textContent = state.ok ? "静态页面已经生成,官网内容已更新。" : (state.log || `${action}失败,请联系技术人员。`); $("#build-title").textContent = `${action}失败`;
$("#build-log").textContent = state.log || `${action}失败,请联系技术人员。`;
show("#close-modal"); show("#close-modal");
if (!state.ok) throw new Error(`${action}失败,原文章已恢复,请检查操作日志。`); throw new Error(`${action}失败,原文章已恢复,请检查操作日志。`);
return;
} }
} }
......
...@@ -50,9 +50,9 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1 ...@@ -50,9 +50,9 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1
.article-summary { min-width: 0; flex: 1; } .article-summary { min-width: 0; flex: 1; }
.article-row h2 { margin: 0 0 8px; font-size: 17px; } .article-row h2 { margin: 0 0 8px; font-size: 17px; }
.article-row p { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; color: var(--muted); font-size: 12px; } .article-row p { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; color: var(--muted); font-size: 12px; }
.article-row code { color: #8d9995; } .article-row code { color: #9a8d7e; }
.status { padding: 2px 8px; border-radius: 999px; } .status { padding: 2px 8px; border-radius: 999px; }
.status.live { color: #188367; background: #e2f6ef; } .status.live { color: #8E1C17; background: #FBE7E3; }
.status.new-draft { color: #916300; background: #fff2c7; } .status.new-draft { color: #916300; background: #fff2c7; }
.status.edited-draft { color: #9c4c22; background: #ffeadc; } .status.edited-draft { color: #9c4c22; background: #ffeadc; }
.row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; } .row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
...@@ -89,7 +89,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1 ...@@ -89,7 +89,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1
.editor-titlebar > .status { margin-bottom: 4px; padding: 6px 12px; font-size: 13px; } .editor-titlebar > .status { margin-bottom: 4px; padding: 6px 12px; font-size: 13px; }
.back-button { min-height: auto; width: max-content; padding: 0; color: var(--muted); background: transparent; border-radius: 0; } .back-button { min-height: auto; width: max-content; padding: 0; color: var(--muted); background: transparent; border-radius: 0; }
.back-button:hover { color: var(--primary-dark); } .back-button:hover { color: var(--primary-dark); }
.version-note { margin: -12px 0 18px; padding: 13px 16px; color: #52625e; background: #F8EEE6; border: 1px solid var(--border); border-radius: 11px; font-size: 13px; } .version-note { margin: -12px 0 18px; padding: 13px 16px; color: #6b5a4f; background: #F8EEE6; border: 1px solid var(--border); border-radius: 11px; font-size: 13px; }
.auto-meta { margin: 0; padding: 11px 13px; color: var(--muted); background: #FAF7F1; border-radius: 9px; font-size: 12px; } .auto-meta { margin: 0; padding: 11px 13px; color: var(--muted); background: #FAF7F1; border-radius: 9px; font-size: 12px; }
.editor-head { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; } .editor-head { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.editor-head > div { display: flex; align-items: center; gap: 9px; } .editor-head > div { display: flex; align-items: center; gap: 9px; }
...@@ -97,7 +97,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1 ...@@ -97,7 +97,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1
#upload-status { color: var(--muted); font-size: 12px; } #upload-status { color: var(--muted); font-size: 12px; }
.editor-grid { min-height: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .editor-grid { min-height: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#body { min-height: 480px; resize: vertical; font-family: inherit; font-size: 15px; line-height: 1.8; } #body { min-height: 480px; resize: vertical; font-family: inherit; font-size: 15px; line-height: 1.8; }
.preview { padding: 22px; overflow: auto; background: #fbfcfb; border: 1px solid var(--border); border-radius: 9px; line-height: 1.8; } .preview { padding: 22px; overflow: auto; background: #fbfaf7; border: 1px solid var(--border); border-radius: 9px; line-height: 1.8; }
.preview:empty::before { content: "文章预览会显示在这里"; color: var(--muted); } .preview:empty::before { content: "文章预览会显示在这里"; color: var(--muted); }
.preview h1, .preview h2, .preview h3 { color: var(--primary-dark); } .preview h1, .preview h2, .preview h3 { color: var(--primary-dark); }
.preview img { max-width: 100%; } .preview img { max-width: 100%; }
...@@ -146,7 +146,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1 ...@@ -146,7 +146,7 @@ input:focus, textarea:focus, select:focus { outline: 2px solid rgba(209,37,26,.1
.replacement-options button { color: var(--primary-dark); background: white; border: 1px solid var(--border); } .replacement-options button { color: var(--primary-dark); background: white; border: 1px solid var(--border); }
.replacement-options button:hover { border-color: var(--primary); background: #FBEAE6; } .replacement-options button:hover { border-color: var(--primary); background: #FBEAE6; }
.build-card { width: min(780px, 100%); } .build-card { width: min(780px, 100%); }
#build-log { max-height: 62vh; margin: 0; padding: 18px; overflow: auto; color: var(--muted); background: #f7f9f8; white-space: pre-wrap; font-size: 12px; } #build-log { max-height: 62vh; margin: 0; padding: 18px; overflow: auto; color: var(--muted); background: #faf7f1; white-space: pre-wrap; font-size: 12px; }
@media (max-width: 760px) { @media (max-width: 760px) {
.topbar, .view-head, .article-row { align-items: flex-start; flex-direction: column; } .topbar, .view-head, .article-row { align-items: flex-start; flex-direction: column; }
.top-actions { width: 100%; flex-wrap: wrap; } .top-actions { width: 100%; flex-wrap: wrap; }
......
...@@ -121,10 +121,10 @@ function captchaValid(request: Request, answer: unknown): boolean { ...@@ -121,10 +121,10 @@ function captchaValid(request: Request, answer: unknown): boolean {
function captchaSvg(code: string): string { function captchaSvg(code: string): string {
const width = 132; const width = 132;
const height = 46; const height = 46;
const colors = ["#11897b", "#0e727c", "#16ae9c", "#243532"]; const colors = ["#8E1C17", "#6F1511", "#D1251A", "#5c3a2e"];
const randomBetween = (min: number, max: number) => crypto.randomInt(min, max + 1); const randomBetween = (min: number, max: number) => crypto.randomInt(min, max + 1);
const pick = <T>(items: T[]): T => items[crypto.randomInt(items.length)]; const pick = <T>(items: T[]): T => items[crypto.randomInt(items.length)];
let content = `<rect width="${width}" height="${height}" fill="#e4efea"/>`; let content = `<rect width="${width}" height="${height}" fill="#F4E6D6"/>`;
for (let index = 0; index < 4; index += 1) { for (let index = 0; index < 4; index += 1) {
content += `<line x1="${randomBetween(0, width)}" y1="${randomBetween(0, height)}" x2="${randomBetween(0, width)}" y2="${randomBetween(0, height)}" stroke="${pick(colors)}" stroke-width="1" opacity="0.45"/>`; content += `<line x1="${randomBetween(0, width)}" y1="${randomBetween(0, height)}" x2="${randomBetween(0, width)}" y2="${randomBetween(0, height)}" stroke="${pick(colors)}" stroke-width="1" opacity="0.45"/>`;
} }
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</div> </div>
<div id="build-modal" class="modal hidden"> <div id="build-modal" class="modal hidden">
<div class="modal-card build-card"> <div class="modal-card build-card">
<div><strong id="build-title">正在生成静态页面</strong><button id="close-modal" class="ghost small hidden" type="button">关闭</button></div> <div><strong id="build-title">正在处理</strong><button id="close-modal" class="ghost small hidden" type="button">关闭</button></div>
<pre id="build-log">系统正在更新官网,请稍候。</pre> <pre id="build-log">系统正在更新官网,请稍候。</pre>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment