弹窗加快速淡出退场;重启确认的文案按配置说话
退场用 opacity 过渡加 display/overlay 的 allow-discrete——过渡结束前 元素留在 top layer,不支持的浏览器退化为立即消失。所有 dialog 一并 生效。 重启确认原来把 profile.store-selected 的配置项名直接甩给用户。现在读 配置判断(内核默认记住选中,config.go:576,显式 false 才会丢),按 实际情况说「选中的线路重启后不变」或「会回到默认成员」。
This commit is contained in:
+16
-1
@@ -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"
|
||||
|
||||
+16
-1
@@ -238,7 +238,7 @@ select {
|
||||
border-color 0.15s ease;
|
||||
}
|
||||
|
||||
/* 对话框入场:快速淡入加一点上移。关闭不做动画,动效只留给打开的那一下 */
|
||||
/* 对话框入场:快速淡入加一点上移 */
|
||||
dialog[open] {
|
||||
animation: dialog-in 0.15s ease;
|
||||
}
|
||||
@@ -247,6 +247,21 @@ dialog[open]::backdrop {
|
||||
animation: backdrop-in 0.15s ease;
|
||||
}
|
||||
|
||||
/* 对话框退场:单纯的快速淡出。display/overlay 的 allow-discrete 让元素在
|
||||
过渡结束前留在 top layer;不支持的浏览器退化为立即消失,无害 */
|
||||
dialog,
|
||||
dialog::backdrop {
|
||||
transition:
|
||||
opacity 0.12s ease,
|
||||
display 0.12s allow-discrete,
|
||||
overlay 0.12s allow-discrete;
|
||||
}
|
||||
|
||||
dialog:not([open]),
|
||||
dialog:not([open])::backdrop {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@keyframes dialog-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
|
||||
Reference in New Issue
Block a user