fix: 将电源管理选项自动隐藏修改为手动控制,避免 WOL 功能无法显示 #289

This commit is contained in:
mofeng-git
2026-08-07 15:49:58 +08:00
parent 16400df182
commit 4530d8663d
4 changed files with 20 additions and 10 deletions

View File

@@ -59,12 +59,11 @@ const isCh9329Backend = computed(() => hidBackend.value.includes('ch9329'))
const showMsd = computed(() => {
return !!systemStore.msd?.available && !isCh9329Backend.value
})
const showAtx = computed(() => systemStore.atx?.available === true)
const props = defineProps<{
mouseMode?: 'absolute' | 'relative'
videoMode?: VideoMode
ttydRunning?: boolean
showPower?: boolean
showTerminal?: boolean
showComputerUse?: boolean
showPasteText?: boolean
@@ -72,6 +71,7 @@ const props = defineProps<{
scaleMode?: VideoScaleMode
sourceSizeAvailable?: boolean
}>()
const showAtx = computed(() => props.showPower !== false)
const showStats = computed(() => (props.videoMode ?? 'mjpeg') !== 'mjpeg')
const showPasteText = computed(() => props.showPasteText !== false)
const showMic = computed(() => props.showMic === true)

View File

@@ -1,10 +1,11 @@
import { useLocalStorage } from '@vueuse/core'
import type { RemovableRef } from '@vueuse/core'
export type FeatureVisibilityKey = 'webTerminal' | 'computerUse' | 'pasteText'
export type FeatureVisibilityKey = 'power' | 'webTerminal' | 'computerUse' | 'pasteText'
export type FeatureVisibility = Record<FeatureVisibilityKey, boolean>
const DEFAULT_FEATURE_VISIBILITY: FeatureVisibility = {
power: true,
webTerminal: true,
computerUse: true,
pasteText: true,

View File

@@ -237,6 +237,7 @@ const showTerminalDialog = ref(false)
const featureVisibility = useFeatureVisibility()
const { isDark, toggleTheme } = useTheme()
const terminalAvailable = computed(() => ttydStatus.value?.available !== false)
const showPower = computed(() => featureVisibility.value.power)
const showTerminal = computed(() => terminalAvailable.value && featureVisibility.value.webTerminal)
const showComputerUse = computed(() => featureVisibility.value.computerUse)
const showPasteText = computed(() => featureVisibility.value.pasteText)
@@ -3273,6 +3274,7 @@ onUnmounted(() => {
:mouse-mode="mouseMode"
:video-mode="videoMode"
:ttyd-running="ttydStatus?.running"
:show-power="showPower"
:show-terminal="showTerminal"
:show-computer-use="showComputerUse"
:show-paste-text="showPasteText"

View File

@@ -2798,6 +2798,20 @@ watch(isWindows, () => {
<CardDescription>{{ t('settings.featureVisibilityDesc') }}</CardDescription>
</CardHeader>
<CardContent class="space-y-1">
<div class="flex items-center justify-between gap-4 px-3 py-3">
<Label for="feature-power" class="flex min-w-0 items-center gap-2 font-normal">
<Power class="size-4 shrink-0 text-muted-foreground" />
<span class="truncate">{{ t('actionbar.power') }}</span>
</Label>
<Switch id="feature-power" v-model="featureVisibility.power" />
</div>
<div class="flex items-center justify-between gap-4 px-3 py-3">
<Label for="feature-paste-text" class="flex min-w-0 items-center gap-2 font-normal">
<ClipboardPaste class="size-4 shrink-0 text-muted-foreground" />
<span class="truncate">{{ t('settings.pasteText') }}</span>
</Label>
<Switch id="feature-paste-text" v-model="featureVisibility.pasteText" />
</div>
<div class="flex items-center justify-between gap-4 px-3 py-3">
<Label for="feature-web-terminal" class="flex min-w-0 items-center gap-2 font-normal">
<Terminal class="size-4 shrink-0 text-muted-foreground" />
@@ -2812,13 +2826,6 @@ watch(isWindows, () => {
</Label>
<Switch id="feature-computer-use" v-model="featureVisibility.computerUse" />
</div>
<div class="flex items-center justify-between gap-4 px-3 py-3">
<Label for="feature-paste-text" class="flex min-w-0 items-center gap-2 font-normal">
<ClipboardPaste class="size-4 shrink-0 text-muted-foreground" />
<span class="truncate">{{ t('settings.pasteText') }}</span>
</Label>
<Switch id="feature-paste-text" v-model="featureVisibility.pasteText" />
</div>
</CardContent>
</Card>
</div>