滚动截图,细节调整

This commit is contained in:
zhongluofeng committed 2026-09-04 19:56:23 +08:00
1 parent 6b9f71da08
commit 27ad5d89a5
34 files changed
+3766 -559

No files matched your search

+39 -5
View File
@@ -14,6 +14,7 @@ import { toast } from 'vue-sonner'
import { VueDraggable } from 'vue-draggable-plus'
import { appDataDir } from '@tauri-apps/api/path'
import { revealItemInDir } from '@tauri-apps/plugin-opener'
import { invoke } from '@tauri-apps/api/core'
import {
useMonitorStore,
type SensorEntry,
@@ -436,6 +437,31 @@ async function handleRefresh() {
}
}
/** 检测并修复 PawnIO 驱动:安装缺失驱动并重启监控内核 */
const repairingPawnio = ref(false)
async function handleRepairPawnio() {
repairingPawnio.value = true
try {
const r = await invoke<{ installed: boolean; needReboot: boolean }>('monitor_repair_pawnio')
if (r.needReboot) {
toast.info('PawnIO 驱动已安装,需重启电脑后生效')
} else if (r.installed) {
toast.success('PawnIO 驱动已修复,监控内核已重启')
} else {
toast.error('PawnIO 驱动安装未完成', {
description: '请以管理员/提权方式运行 Thing 后重试',
})
}
store.pawnIoMissing = false
await store.refreshStatus()
await store.fetchSnapshot()
} catch (e) {
toast.error('修复 PawnIO 失败', { description: String(e) })
} finally {
repairingPawnio.value = false
}
}
/** 提权:以管理员权限重启 Thing 自身,并持久化标志使后续启动自动提权。
* Thing 以管理员权限运行时,ThingHK 子进程继承权限,ProcessManager 可直接管控,
* ThingHK 崩溃会自动重启,避免数据停止后 Thing 不感知。
@@ -535,8 +561,6 @@ async function handleSaveConfig() {
description: '主板/存储等硬件需提权才能读取完整数据,建议提权',
duration: 6000,
})
} else {
toast.success('配置已保存', { description: '正在重启 Kernel...' })
}
// 自动重启 Kernel 以应用硬件开关变更
@@ -554,7 +578,6 @@ async function handleSaveConfig() {
}
}
} else {
toast.success('配置已保存', { description: '传感器类型过滤已热生效' })
configDialogOpen.value = false
// 热更新后立即拉取新快照以反映传感器类型过滤变化
await store.fetchSnapshot()
@@ -1091,7 +1114,6 @@ function confirmOsdPick() {
osdConfig.value.overlayItems = newItems
saveOsdConfig(osdConfig.value)
osdPickDialogOpen.value = false
toast.success('悬浮窗显示项已更新')
}
/** 拖动排序结束回调 */
@@ -1230,7 +1252,6 @@ function saveColorTheme() {
osdConfig.value.colorTheme = editingColorTheme.value
saveOsdConfig(osdConfig.value)
colorThemeDialogOpen.value = false
toast.success('颜色主题已保存')
}
function resetColorTheme() {
@@ -1432,6 +1453,19 @@ watch(() => store.status?.ready, (ready, prev) => {
</CardContent>
</Card>
<!-- PawnIO 驱动缺失提示(提权但驱动未装 → CPU 温度/功耗无法读取) -->
<Card v-if="store.pawnIoMissing" class="py-0 gap-0 mb-2.5 !border-amber-500/40 bg-amber-500/10">
<CardContent class="px-3.5 py-2 flex flex-wrap items-center gap-2 text-xs text-amber-600 dark:text-amber-400">
<AlertTriangle class="size-4 shrink-0" />
<span class="flex-1 min-w-[200px]">检测到 PawnIO 驱动未安装,CPU 温度/功耗可能无法读取(误卸载过 PawnIO 等情况会触发)。点击下方按钮自动安装并重启监控内核。</span>
<Button size="xs" variant="outline" class="shrink-0 text-amber-600 dark:text-amber-400 border-amber-500/40 hover:bg-amber-500/10" :disabled="store.starting || store.stopping || repairingPawnio" @click="handleRepairPawnio">
<Loader2 v-if="repairingPawnio" class="size-3 mr-1 animate-spin" />
<RefreshCw v-else class="size-3 mr-1" />
{{ repairingPawnio ? '修复中...' : '检测并修复' }}
</Button>
</CardContent>
</Card>
<!-- ===== 硬件信息卡片网格(模板化,可编辑:拖拽排序 / 删除 / 添加) ===== -->
<VueDraggable
v-model="overviewCards"