- 将“图片上传”和“API 与 AI 集成”卡片调整为双列同行显示 - 移除“系统与安全环境”面板中无需展示的“主题风格”项 - 服务端增加对 R2 环境变量的读取,并在面板中展示 R2 存储绑定状态
This commit is contained in:
1 parent
fe8ea56d9b
commit
d5ae0d392b
2 files changed
+27
-8
No files matched your search
@@ -6,6 +6,7 @@ import { fetchAnalytics } from '$lib/server/cloudflare';
|
|||||||
|
|
||||||
export const load: PageServerLoad = async ({ locals, platform }) => {
|
export const load: PageServerLoad = async ({ locals, platform }) => {
|
||||||
const db = platform?.env?.DB;
|
const db = platform?.env?.DB;
|
||||||
|
const r2 = platform?.env?.R2;
|
||||||
const settings: Record<string, string> = {};
|
const settings: Record<string, string> = {};
|
||||||
|
|
||||||
if (db) {
|
if (db) {
|
||||||
@@ -22,6 +23,7 @@ export const load: PageServerLoad = async ({ locals, platform }) => {
|
|||||||
return {
|
return {
|
||||||
user: locals.user,
|
user: locals.user,
|
||||||
platformEnv: db ? 'Cloudflare D1 (Connected)' : 'Local Mock',
|
platformEnv: db ? 'Cloudflare D1 (Connected)' : 'Local Mock',
|
||||||
|
r2Env: r2 ? 'Cloudflare R2 (Connected)' : 'Local Mock',
|
||||||
settings,
|
settings,
|
||||||
analytics: fetchAnalytics(platform) // Streaming promise
|
analytics: fetchAnalytics(platform) // Streaming promise
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -121,10 +121,6 @@
|
|||||||
|
|
||||||
<div class="settings-card">
|
<div class="settings-card">
|
||||||
<h3>系统与安全环境</h3>
|
<h3>系统与安全环境</h3>
|
||||||
<div class="info-row">
|
|
||||||
<span class="label">主题风格</span>
|
|
||||||
<span class="value">Typecho Theme VOID</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="label">驱动框架</span>
|
<span class="label">驱动框架</span>
|
||||||
<span class="value">SvelteKit 5 + Cloudflare</span>
|
<span class="value">SvelteKit 5 + Cloudflare</span>
|
||||||
@@ -137,6 +133,10 @@
|
|||||||
<span class="label">数据库绑定</span>
|
<span class="label">数据库绑定</span>
|
||||||
<span class="value"><span class="badge">{data.platformEnv}</span></span>
|
<span class="value"><span class="badge">{data.platformEnv}</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="label">R2存储绑定</span>
|
||||||
|
<span class="value"><span class="badge">{data.r2Env}</span></span>
|
||||||
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="label">鉴权模式</span>
|
<span class="label">鉴权模式</span>
|
||||||
<span class="value">Cloudflare Access (Zero Trust)</span>
|
<span class="value">Cloudflare Access (Zero Trust)</span>
|
||||||
@@ -144,7 +144,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-card full-width">
|
<div class="two-columns-row">
|
||||||
|
<div class="settings-card">
|
||||||
<h3>图片上传</h3>
|
<h3>图片上传</h3>
|
||||||
<form
|
<form
|
||||||
method="POST"
|
method="POST"
|
||||||
@@ -165,13 +166,13 @@
|
|||||||
WebP,保持原尺寸及透明背景。GIF、动态 PNG 和已有 WebP 保持原格式。
|
WebP,保持原尺寸及透明背景。GIF、动态 PNG 和已有 WebP 保持原格式。
|
||||||
仅影响新上传图片;直接调用上传 API 的客户端需自行转换。
|
仅影响新上传图片;直接调用上传 API 的客户端需自行转换。
|
||||||
</p>
|
</p>
|
||||||
<div class="form-actions">
|
<div class="form-actions" style="margin-top: auto;">
|
||||||
<Button type="submit" variant="primary">保存上传设置</Button>
|
<Button type="submit" variant="primary">保存上传设置</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-card full-width">
|
<div class="settings-card">
|
||||||
<h3>API 与 AI 集成</h3>
|
<h3>API 与 AI 集成</h3>
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
配置允许 AI 或第三方工具直接管理文章的 API 访问令牌 (Token)。请求 API 时请在 HTTP Header
|
配置允许 AI 或第三方工具直接管理文章的 API 访问令牌 (Token)。请求 API 时请在 HTTP Header
|
||||||
@@ -187,6 +188,7 @@
|
|||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
class="alias-form"
|
class="alias-form"
|
||||||
|
style="height: 100%; display: flex; flex-direction: column;"
|
||||||
>
|
>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="agent_api_token">API Token</label>
|
<label for="agent_api_token">API Token</label>
|
||||||
@@ -214,11 +216,12 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions" style="margin-top: auto;">
|
||||||
<Button type="submit" variant="primary">保存 Token</Button>
|
<Button type="submit" variant="primary">保存 Token</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if activeTab === 'appearance'}
|
{#if activeTab === 'appearance'}
|
||||||
@@ -387,6 +390,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.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 {
|
.full-width {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user