Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yinzhuang
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
yinzhuang
Commits
8941015f
Commit
8941015f
authored
Jul 29, 2026
by
xuchentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台配色统一为品牌暖色调,移除绿色残留与静态页面生成提示,验证码改为红棕配色
parent
86facc5e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
app.js
public/admin/app.js
+4
-4
style.css
public/admin/style.css
+5
-5
cms-api.ts
src/lib/cms-api.ts
+2
-2
index.astro
src/pages/admin/index.astro
+1
-1
No files found.
public/admin/app.js
View file @
8941015f
...
...
@@ -604,11 +604,11 @@ async function triggerBuild(endpoint, { action = "发布", method = "POST", body
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
1000
));
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
}
失败,请联系技术人员。`
);
if
(
state
.
ok
)
{
hide
(
"#build-modal"
);
return
;
}
$
(
"#build-title"
).
textContent
=
`
${
action
}
失败`
;
$
(
"#build-log"
).
textContent
=
state
.
log
||
`
${
action
}
失败,请联系技术人员。`
;
show
(
"#close-modal"
);
if
(
!
state
.
ok
)
throw
new
Error
(
`
${
action
}
失败,原文章已恢复,请检查操作日志。`
);
return
;
throw
new
Error
(
`
${
action
}
失败,原文章已恢复,请检查操作日志。`
);
}
}
...
...
public/admin/style.css
View file @
8941015f
...
...
@@ -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-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
code
{
color
:
#
8d9995
;
}
.article-row
code
{
color
:
#
9a8d7e
;
}
.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.edited-draft
{
color
:
#9c4c22
;
background
:
#ffeadc
;
}
.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
.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
: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
;
}
.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
;
}
...
...
@@ -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
;
}
.editor-grid
{
min-height
:
480px
;
display
:
grid
;
grid-template-columns
:
1
fr
1
fr
;
gap
:
14px
;
}
#body
{
min-height
:
480px
;
resize
:
vertical
;
font-family
:
inherit
;
font-size
:
15px
;
line-height
:
1.8
;
}
.preview
{
padding
:
22px
;
overflow
:
auto
;
background
:
#fbf
cfb
;
border
:
1px
solid
var
(
--border
);
border-radius
:
9px
;
line-height
:
1.8
;
}
.preview
{
padding
:
22px
;
overflow
:
auto
;
background
:
#fbf
af7
;
border
:
1px
solid
var
(
--border
);
border-radius
:
9px
;
line-height
:
1.8
;
}
.preview
:empty::before
{
content
:
"文章预览会显示在这里"
;
color
:
var
(
--muted
);
}
.preview
h1
,
.preview
h2
,
.preview
h3
{
color
:
var
(
--primary-dark
);
}
.preview
img
{
max-width
:
100%
;
}
...
...
@@ -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
:hover
{
border-color
:
var
(
--primary
);
background
:
#FBEAE6
;
}
.build-card
{
width
:
min
(
780px
,
100%
);
}
#build-log
{
max-height
:
62vh
;
margin
:
0
;
padding
:
18px
;
overflow
:
auto
;
color
:
var
(
--muted
);
background
:
#f
7f9f8
;
white-space
:
pre-wrap
;
font-size
:
12px
;
}
#build-log
{
max-height
:
62vh
;
margin
:
0
;
padding
:
18px
;
overflow
:
auto
;
color
:
var
(
--muted
);
background
:
#f
af7f1
;
white-space
:
pre-wrap
;
font-size
:
12px
;
}
@media
(
max-width
:
760px
)
{
.topbar
,
.view-head
,
.article-row
{
align-items
:
flex-start
;
flex-direction
:
column
;
}
.top-actions
{
width
:
100%
;
flex-wrap
:
wrap
;
}
...
...
src/lib/cms-api.ts
View file @
8941015f
...
...
@@ -121,10 +121,10 @@ function captchaValid(request: Request, answer: unknown): boolean {
function
captchaSvg
(
code
:
string
):
string
{
const
width
=
132
;
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
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
)
{
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"/>`
;
}
...
...
src/pages/admin/index.astro
View file @
8941015f
...
...
@@ -101,7 +101,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>
...
...
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