From bf304cee0f0092b97c022b56257977c29defa529 Mon Sep 17 00:00:00 2001 From: seaHi Date: Sun, 27 Sep 2026 15:11:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=B8=8E=E6=A0=B7=E5=BC=8F=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/admin/settings/+page.svelte | 472 +++++++++++++------------ 1 file changed, 237 insertions(+), 235 deletions(-) diff --git a/src/routes/admin/settings/+page.svelte b/src/routes/admin/settings/+page.svelte index d2c6295..94ecfc0 100644 --- a/src/routes/admin/settings/+page.svelte +++ b/src/routes/admin/settings/+page.svelte @@ -63,8 +63,8 @@
{#if activeTab === 'basic'} -
-
+
+

站点基础信息

-
+
-
+
+ +

系统与安全环境

-
- 驱动框架 - SvelteKit 5 + Cloudflare -
-
- 当前管理员 - {data.user?.email || '未知用户'} -
-
- 数据库绑定 - {data.platformEnv} -
-
- R2存储绑定 - {data.r2Env} -
-
- 鉴权模式 - Cloudflare Access (Zero Trust) +
+
+ 驱动框架 + SvelteKit 5 + Cloudflare +
+
+ 当前管理员 + {data.user?.email || '未知用户'} +
+
+ 数据库绑定 + {data.platformEnv} +
+
+ R2存储绑定 + {data.r2Env} +
+
+ 鉴权模式 + Cloudflare Access (Zero Trust) +
-
-
-
+
+ +

图片上传

-
+
-
+
+ +

API 与 AI 集成

配置允许 AI 或第三方工具直接管理文章的 API 访问令牌 (Token)。请求 API 时请在 HTTP Header @@ -197,9 +203,8 @@ }; }} class="alias-form" - style="height: 100%; display: flex; flex-direction: column;" > -

+
-
+
-
-
-

Cloudflare Web Analytics

-

- 填写 Cloudflare Web Analytics 统计脚本中的 token,用于采集页面浏览量和访问次数。 请勿填写 - Site Tag;它是查询标识,不能用于浏览器采集。后台查询还需配置 CF_ACCOUNT_ID, 并确保 - CF_API_TOKEN 具有该账户的 Account Settings Read 和 Account Analytics Read 权限。 -

-
{ - return async ({ update }) => { - update({ reset: false }); - }; - }} - class="alias-form" - > -
- - -
-
- -
-
+
+ +
+

Cloudflare Web Analytics

+

+ 填写 Cloudflare Web Analytics 统计脚本中的 token,用于采集页面浏览量和访问次数。 请勿填写 + Site Tag;它是查询标识,不能用于浏览器采集。后台查询还需配置 CF_ACCOUNT_ID, 并确保 + CF_API_TOKEN 具有该账户的 Account Settings Read 和 Account Analytics Read 权限。 +

+
{ + return async ({ update }) => { + update({ reset: false }); + }; + }} + class="alias-form" + > +
+ + +
+
+ +
+
+
{/if} {#if activeTab === 'appearance'}
-

首页顶部主图与外观偏好

+
+

首页顶部主图与外观偏好

-
{ - return async ({ update }) => { - update({ reset: false }); - }; - }} - class="alias-form" - > -
- -
- - {#if avatarEnabled} + { + return async ({ update }) => { + update({ reset: false }); + }; + }} + class="alias-form" + >
- -
- + + -
+ 在网站首页顶部标题栏显示主图 / 站点头像 +
- {:else} - - {/if} -
- -
-
+ {#if avatarEnabled} +
+ +
+ +
+
+ {:else} + + {/if} + +
+ +
+ +
{/if} {#if activeTab === 'terms'}
-

个性化术语设定

-

- 您可以根据部署场景(如教学系统、文档库)自定义后台各模块的显示名称,例如将“文章”改为“实验手册”。 -

+
+

个性化术语设定

+

+ 您可以根据部署场景(如教学系统、文档库)自定义后台各模块的显示名称,例如将“文章”改为“实验手册”。 +

-
{ - return async ({ update }) => { - update({ reset: false }); - }; - }} - class="alias-form" - > -
-
- - + { + return async ({ update }) => { + update({ reset: false }); + }; + }} + class="alias-form" + > +
+
+ + +
+
+ + +
-
- - -
-
-
-
- - +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - -
-
-
- -
- +
+ +
+ +
{:else if activeTab === 'analytics'} @@ -418,34 +429,6 @@ width: 100%; } - .basic-top-row { - display: grid; - grid-template-columns: 2fr 1fr; - gap: 25px; - align-items: stretch; - width: 100%; - } - - @media (max-width: 1024px) { - .basic-top-row { - grid-template-columns: 1fr; - } - } - - .two-columns-row { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 25px; - align-items: stretch; - width: 100%; - } - - @media (max-width: 1024px) { - .two-columns-row { - grid-template-columns: 1fr; - } - } - .full-width { grid-column: 1 / -1; } @@ -458,49 +441,68 @@ flex-direction: column; } - .settings-card h3 { - margin: 0 0 12px 0; - font-size: 1.2rem; - border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1)); - padding-bottom: 10px; - color: var(--text-color); + .settings-section { + display: flex; + flex-direction: column; + padding: 10px 0; } - .settings-card .desc { + .settings-section h3 { + margin: 0 0 16px 0; + font-size: 1.2rem; + color: var(--text-color); + font-weight: 600; + } + + .section-divider { + border: 0; + border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.1)); + margin: 25px 0; + } + + .info-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 24px 20px; + background: rgba(0, 0, 0, 0.02); + padding: 24px; + border-radius: 8px; + border: 1px solid var(--border-color, rgba(0, 0, 0, 0.05)); + } + + .info-item { + display: flex; + flex-direction: column; + gap: 8px; + } + + .info-item .label { + color: var(--text-muted, rgba(0, 0, 0, 0.6)); + font-size: 0.85rem; + font-weight: 500; + } + + .info-item .value { + color: var(--text-color); + font-weight: 600; + font-size: 0.95rem; + word-break: break-word; + } + + .settings-card h3 { + margin: 0 0 16px 0; + font-size: 1.2rem; + color: var(--text-color); + font-weight: 600; + } + + .settings-section .desc { font-size: 0.9rem; color: var(--text-muted, rgba(0, 0, 0, 0.6)); margin-bottom: 24px; line-height: 1.5; } - .info-row { - display: flex; - justify-content: space-between; - align-items: center; - padding: 14px 0; - border-bottom: 1px dashed var(--border-color, rgba(0, 0, 0, 0.08)); - font-size: 0.95rem; - gap: 15px; - } - - .info-row:last-child { - border-bottom: none; - } - - .info-row .label { - color: var(--text-muted, rgba(0, 0, 0, 0.6)); - font-weight: 500; - white-space: nowrap; - flex-shrink: 0; - } - - .info-row .value { - color: var(--text-color); - font-weight: 600; - text-align: right; - word-break: break-word; - } - .alias-form { display: flex; flex-direction: column;