弹窗加快速淡出退场;重启确认的文案按配置说话

退场用 opacity 过渡加 display/overlay 的 allow-discrete——过渡结束前
元素留在 top layer,不支持的浏览器退化为立即消失。所有 dialog 一并
生效。

重启确认原来把 profile.store-selected 的配置项名直接甩给用户。现在读
配置判断(内核默认记住选中,config.go:576,显式 false 才会丢),按
实际情况说「选中的线路重启后不变」或「会回到默认成员」。
This commit is contained in:
2026-08-12 03:32:53 +08:00
parent 6ac0a63f28
commit 8d4579f987
2 changed files with 32 additions and 2 deletions
+16 -1
View File
@@ -100,6 +100,17 @@ const busyAct = ref(false)
const historyOpen = ref(false)
const askRestart = ref(false)
/**
* 重启后各组选中的线路能不能找回来:内核把选中记在缓存文件里,由
* profile.store-selected 控制,默认开(config.go:576),显式写 false 才会丢。
* 按用户的配置说话,不把配置项名字甩给他。
*/
const keepsSelection = computed(() => {
const profile = snapshot.value?.data.profile
if (typeof profile !== 'object' || profile === null || Array.isArray(profile)) return true
return (profile as Record<string, unknown>)['store-selected'] !== false
})
async function undo() {
if (busyAct.value) return
busyAct.value = true
@@ -379,7 +390,11 @@ const current = computed(() => NAV.find((n) => n.key === active.value))
<ConfirmDialog
:open="askRestart"
message="重启内核进程?所有连接会断开,几秒后自动恢复;策略组的选中依赖 profile.store-selected 找回。"
:message="
keepsSelection
? '重启内核进程?所有连接会断开,几秒后自动恢复;各组选中的线路由内核记住,重启后不变。'
: '重启内核进程?所有连接会断开,几秒后自动恢复;这份配置关闭了记住选中(store-selected: false),各组会回到默认成员。'
"
action="重启"
@close="askRestart = false"
@confirm="restartConfirmed"