fix:修复设置ui

This commit is contained in:
lsy committed 2026-03-17 00:01:59 +08:00
1 parent 2b04b21eeb
commit 51239bef21
3 files changed
+20 -10

No files matched your search

+2
View File
@@ -32,6 +32,8 @@
### 微调
- **[admin-ui/settings]**: 运行时配置卡片展示并内联环境变量名 — by lsy
- 方案: [202603162329_settings-runtime-config-cards](archive/2026-03/202603162329_settings-runtime-config-cards/)
- **[proxy/settings]**: 流式 usage 解析上限支持 `0` 表示无限制 — by lsy
- 方案: [202603161849_stream-usage-unlimited](archive/2026-03/202603161849_stream-usage-unlimited/)
- **[worker/models]**: 引入通道模型能力表并基于“模型广场测试结果+可配置TTL(默认2小时)”进行模型发布与路由匹配
+1 -1
View File
@@ -33,7 +33,7 @@
- 站点管理内置一键签到入口,展示今日签到结果(基于后台写回的 `last_checkin_*`)
- 系统设置增加定时签到开关与时间(中国时间)
- 系统设置提供模型失败冷却分钟数配置
- 系统设置展示运行时配置(只读),提示在部署环境中修改环境变量
- 系统设置展示运行时配置(只读),以卡片显示名称 + 环境变量名 + 当前值,并提示在部署环境中修改环境变量
- 列表分页页脚统一使用页码导航 + 每页条数选择,并显示总页数,顶部不显示条数与每页选择
- Token 仅本地保存,不回显
- 移动端使用顶部栏 + 抽屉导航,侧边栏在桌面端保持固定
+17 -9
View File
@@ -30,26 +30,32 @@ export const SettingsView = ({
{
label: "流式 usage 解析模式",
value: runtimeConfig?.stream_usage_mode ?? "lite",
env: "PROXY_STREAM_USAGE_MODE",
},
{
label: "流式解析最大字节",
value: runtimeConfig?.stream_usage_max_bytes ?? 262144,
env: "PROXY_STREAM_USAGE_MAX_BYTES",
},
{
label: "流式解析并发上限",
value: runtimeConfig?.stream_usage_max_parsers ?? 2,
env: "PROXY_STREAM_USAGE_MAX_PARSERS",
},
{
label: "队列开关",
value: runtimeConfig?.usage_queue_enabled ? "启用" : "关闭",
env: "PROXY_USAGE_QUEUE_ENABLED",
},
{
label: "队列绑定",
value: runtimeConfig?.usage_queue_bound ? "已绑定" : "未绑定",
env: "USAGE_QUEUE 绑定",
},
{
label: "队列实际生效",
value: runtimeConfig?.usage_queue_active ? "是" : "否",
env: "USAGE_QUEUE 运行时",
},
];
@@ -192,21 +198,23 @@ export const SettingsView = ({
<h4 class="app-title text-base">运行时配置(只读)</h4>
<p class="mt-2 text-xs text-[color:var(--app-ink-muted)]">
需要调整请在 Cloudflare Dashboard 或部署环境中修改以下环境变量,
此处仅展示当前生效值。
此处仅展示当前生效值(环境变量名已在每项卡片内标注)。
</p>
<div class="mt-3 grid gap-2 sm:grid-cols-2">
{runtimeItems.map((item) => (
<div class="flex items-center justify-between rounded-xl bg-white/70 px-3 py-2 text-sm">
<span class="text-[color:var(--app-ink-muted)]">{item.label}</span>
<span class="font-semibold">{item.value}</span>
<div class="rounded-xl bg-white/70 px-3 py-3 text-sm">
<div class="text-sm font-semibold text-[color:var(--app-ink)]">
{item.label}
</div>
<div class="mt-1 text-[11px] font-mono text-[color:var(--app-ink-muted)]">
{item.env}
</div>
<div class="mt-2 text-base font-semibold text-[color:var(--app-ink)]">
{item.value}
</div>
</div>
))}
</div>
<div class="mt-3 text-xs text-[color:var(--app-ink-muted)]">
<span class="font-semibold">环境变量:</span> PROXY_STREAM_USAGE_MODE,
PROXY_STREAM_USAGE_MAX_BYTES, PROXY_STREAM_USAGE_MAX_PARSERS,
PROXY_USAGE_QUEUE_ENABLED
</div>
</div>
</div>
);