Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
J
jiayun
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xuchentao
jiayun
Commits
5dbda737
Commit
5dbda737
authored
Jul 29, 2026
by
xuchentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: simplify site update messages
parent
acf37b53
Pipeline
#421
failed with stages
in 0 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
app.js
public/admin/app.js
+1
-1
site-build.mjs
scripts/site-build.mjs
+1
-1
cms-api.ts
src/lib/cms-api.ts
+1
-1
index.astro
src/pages/admin/index.astro
+1
-1
No files found.
public/admin/app.js
View file @
5dbda737
...
@@ -583,7 +583,7 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body
...
@@ -583,7 +583,7 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body
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
}
失败`
;
$
(
"#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"
);
show
(
"#close-modal"
);
if
(
!
state
.
ok
)
throw
new
Error
(
`
${
action
}
失败,原资讯已恢复,请检查操作日志。`
);
if
(
!
state
.
ok
)
throw
new
Error
(
`
${
action
}
失败,原资讯已恢复,请检查操作日志。`
);
return
;
return
;
...
...
scripts/site-build.mjs
View file @
5dbda737
...
@@ -17,7 +17,7 @@ const MAX_LOG_LENGTH = 2 * 1024 * 1024;
...
@@ -17,7 +17,7 @@ const MAX_LOG_LENGTH = 2 * 1024 * 1024;
export
class
SiteBuildLockBusyError
extends
Error
{
export
class
SiteBuildLockBusyError
extends
Error
{
constructor
()
{
constructor
()
{
super
(
"
网站正在部署或生成静态页面
,请稍后重试"
);
super
(
"
官网正在更新
,请稍后重试"
);
this
.
name
=
"SiteBuildLockBusyError"
;
this
.
name
=
"SiteBuildLockBusyError"
;
}
}
}
}
...
...
src/lib/cms-api.ts
View file @
5dbda737
...
@@ -130,7 +130,7 @@ async function startContentBuild(change: () => Promise<void>): Promise<boolean>
...
@@ -130,7 +130,7 @@ async function startContentBuild(change: () => Promise<void>): Promise<boolean>
async
function
startOrConflict
(
change
:
()
=>
Promise
<
void
>
):
Promise
<
Response
>
{
async
function
startOrConflict
(
change
:
()
=>
Promise
<
void
>
):
Promise
<
Response
>
{
if
(
!
await
startContentBuild
(
change
))
{
if
(
!
await
startContentBuild
(
change
))
{
return
json
({
error
:
"
网站正在部署或生成静态页面
,本次操作未受理,请稍后重试"
},
409
,
{
"Retry-After"
:
"5"
});
return
json
({
error
:
"
官网正在更新
,本次操作未受理,请稍后重试"
},
409
,
{
"Retry-After"
:
"5"
});
}
}
return
json
({
ok
:
true
,
status
:
"building"
});
return
json
({
ok
:
true
,
status
:
"building"
});
}
}
...
...
src/pages/admin/index.astro
View file @
5dbda737
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment