Commit 5dbda737 authored by xuchentao's avatar xuchentao

refactor: simplify site update messages

parent acf37b53
Pipeline #421 failed with stages
in 0 seconds
......@@ -583,7 +583,7 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body
const state = await api("/build");
if (state.status === "building") continue;
$("#build-title").textContent = state.ok ? `${action}成功` : `${action}失败`;
$("#build-log").textContent = state.ok ? "静态页面已经生成,官网内容已更新。" : (state.log || `${action}失败,请联系技术人员。`);
$("#build-log").textContent = state.ok ? "官网内容已更新。" : (state.log || `${action}失败,请联系技术人员。`);
show("#close-modal");
if (!state.ok) throw new Error(`${action}失败,原资讯已恢复,请检查操作日志。`);
return;
......
......@@ -17,7 +17,7 @@ const MAX_LOG_LENGTH = 2 * 1024 * 1024;
export class SiteBuildLockBusyError extends Error {
constructor() {
super("网站正在部署或生成静态页面,请稍后重试");
super("官网正在更新,请稍后重试");
this.name = "SiteBuildLockBusyError";
}
}
......
......@@ -130,7 +130,7 @@ async function startContentBuild(change: () => Promise<void>): Promise<boolean>
async function startOrConflict(change: () => Promise<void>): Promise<Response> {
if (!await startContentBuild(change)) {
return json({ error: "网站正在部署或生成静态页面,本次操作未受理,请稍后重试" }, 409, { "Retry-After": "5" });
return json({ error: "官网正在更新,本次操作未受理,请稍后重试" }, 409, { "Retry-After": "5" });
}
return json({ ok: true, status: "building" });
}
......
......@@ -96,7 +96,7 @@
</div>
<div id="build-modal" class="modal hidden">
<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>
</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