设置页重做:配置文件下载上传、内核参数、资源、免责声明

配置每次落盘都打顶层 patchbay: 标记(盐加版本的哈希)。内核忽略未知
顶层键(yaml.Unmarshal 没开严格模式,config/config.go:612)。刻意不对
内容做哈希:本项目只接管部分段落,手改其余段落是正常用法,内容哈希
会把合法手改判成无效。上传配置时靠标记分流:有标记的确认后替换,
没有的用更重的措辞确认导入;两者都走 config-store 完整保护链路
(新端点 POST /api/config/import)。自动备份列表从界面撤下,改成
下载当前配置 + 拖放上传。

内核参数一组编辑五个老式顶层端口和 keep-alive-interval(config.go:444,
整数秒),走带基准指纹的保存链路。资源一组接 POST /configs/geo
(同步接口,透传给了 300 秒超时)。测速地址成为本地偏好,延迟测试
读它;prefs 模块顶层的浏览器全局加了存在性守卫——api.ts 开始引用
prefs,而 bun test 环境没有 localStorage。

退出登录挪到侧栏底部;密度设置从设置页撤下(侧栏按钮还在);
免责声明和关于做成子页(左上角返回),登录页输入框下加同一份
免责声明的弹层入口。
This commit is contained in:
2026-08-12 01:01:33 +08:00
parent 013f537eaa
commit 8eb98e2e9a
12 changed files with 792 additions and 147 deletions
+22 -1
View File
@@ -17,6 +17,7 @@ import SettingsPage from './views/SettingsPage.vue'
import TokenGate from './views/TokenGate.vue'
import IconFold from '~icons/ri/sidebar-fold-line'
import IconUnfold from '~icons/ri/sidebar-unfold-line'
import IconLogout from '~icons/ri/logout-box-r-line'
const snapshot = ref<ConfigSnapshot | null>(null)
const needsToken = ref(!getToken())
@@ -70,6 +71,11 @@ function submitToken(value: string) {
void load()
}
function logout() {
clearToken()
location.reload()
}
onMounted(() => {
if (!needsToken.value) void load()
// 流量、每路吞吐和日志的历史跨页面留存,所以收集挂在外壳上而不是各页里。
@@ -126,6 +132,11 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
</li>
</ul>
<button type="button" class="nav-item off" title="退出登录" @click="logout">
<IconLogout class="nav-icon" />
<span class="nav-label">退出登录</span>
</button>
<div class="side-foot">
<div class="kernel" :title="kernel.online ? kernel.version : '内核未连接'">
<span :class="['dot', kernel.online ? 'dot-ok' : 'dot-off']" aria-hidden="true"></span>
@@ -195,7 +206,12 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
<ConnectionsPage v-else-if="active === 'connections'" />
<SettingsPage v-else-if="active === 'settings'" @saved="load" />
<SettingsPage
v-else-if="active === 'settings'"
:data="snapshot.data"
:revision="snapshot.revision"
@saved="load"
/>
<div v-else class="note">
<component :is="current?.icon" class="note-icon" />
@@ -358,6 +374,11 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
height: 18px;
}
/* 退出登录:形态同导航项,但不参与「当前页」的高亮,收拢时同样缩成方块 */
.off {
color: var(--c-text-faint);
}
.side-foot {
display: flex;
align-items: center;