mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-12 18:44:25 +08:00
fix: 将电源管理选项自动隐藏修改为手动控制,避免 WOL 功能无法显示 #289
This commit is contained in:
@@ -59,12 +59,11 @@ const isCh9329Backend = computed(() => hidBackend.value.includes('ch9329'))
|
|||||||
const showMsd = computed(() => {
|
const showMsd = computed(() => {
|
||||||
return !!systemStore.msd?.available && !isCh9329Backend.value
|
return !!systemStore.msd?.available && !isCh9329Backend.value
|
||||||
})
|
})
|
||||||
const showAtx = computed(() => systemStore.atx?.available === true)
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
mouseMode?: 'absolute' | 'relative'
|
mouseMode?: 'absolute' | 'relative'
|
||||||
videoMode?: VideoMode
|
videoMode?: VideoMode
|
||||||
ttydRunning?: boolean
|
ttydRunning?: boolean
|
||||||
|
showPower?: boolean
|
||||||
showTerminal?: boolean
|
showTerminal?: boolean
|
||||||
showComputerUse?: boolean
|
showComputerUse?: boolean
|
||||||
showPasteText?: boolean
|
showPasteText?: boolean
|
||||||
@@ -72,6 +71,7 @@ const props = defineProps<{
|
|||||||
scaleMode?: VideoScaleMode
|
scaleMode?: VideoScaleMode
|
||||||
sourceSizeAvailable?: boolean
|
sourceSizeAvailable?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
const showAtx = computed(() => props.showPower !== false)
|
||||||
const showStats = computed(() => (props.videoMode ?? 'mjpeg') !== 'mjpeg')
|
const showStats = computed(() => (props.videoMode ?? 'mjpeg') !== 'mjpeg')
|
||||||
const showPasteText = computed(() => props.showPasteText !== false)
|
const showPasteText = computed(() => props.showPasteText !== false)
|
||||||
const showMic = computed(() => props.showMic === true)
|
const showMic = computed(() => props.showMic === true)
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { useLocalStorage } from '@vueuse/core'
|
import { useLocalStorage } from '@vueuse/core'
|
||||||
import type { RemovableRef } 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>
|
export type FeatureVisibility = Record<FeatureVisibilityKey, boolean>
|
||||||
|
|
||||||
const DEFAULT_FEATURE_VISIBILITY: FeatureVisibility = {
|
const DEFAULT_FEATURE_VISIBILITY: FeatureVisibility = {
|
||||||
|
power: true,
|
||||||
webTerminal: true,
|
webTerminal: true,
|
||||||
computerUse: true,
|
computerUse: true,
|
||||||
pasteText: true,
|
pasteText: true,
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ const showTerminalDialog = ref(false)
|
|||||||
const featureVisibility = useFeatureVisibility()
|
const featureVisibility = useFeatureVisibility()
|
||||||
const { isDark, toggleTheme } = useTheme()
|
const { isDark, toggleTheme } = useTheme()
|
||||||
const terminalAvailable = computed(() => ttydStatus.value?.available !== false)
|
const terminalAvailable = computed(() => ttydStatus.value?.available !== false)
|
||||||
|
const showPower = computed(() => featureVisibility.value.power)
|
||||||
const showTerminal = computed(() => terminalAvailable.value && featureVisibility.value.webTerminal)
|
const showTerminal = computed(() => terminalAvailable.value && featureVisibility.value.webTerminal)
|
||||||
const showComputerUse = computed(() => featureVisibility.value.computerUse)
|
const showComputerUse = computed(() => featureVisibility.value.computerUse)
|
||||||
const showPasteText = computed(() => featureVisibility.value.pasteText)
|
const showPasteText = computed(() => featureVisibility.value.pasteText)
|
||||||
@@ -3273,6 +3274,7 @@ onUnmounted(() => {
|
|||||||
:mouse-mode="mouseMode"
|
:mouse-mode="mouseMode"
|
||||||
:video-mode="videoMode"
|
:video-mode="videoMode"
|
||||||
:ttyd-running="ttydStatus?.running"
|
:ttyd-running="ttydStatus?.running"
|
||||||
|
:show-power="showPower"
|
||||||
:show-terminal="showTerminal"
|
:show-terminal="showTerminal"
|
||||||
:show-computer-use="showComputerUse"
|
:show-computer-use="showComputerUse"
|
||||||
:show-paste-text="showPasteText"
|
:show-paste-text="showPasteText"
|
||||||
|
|||||||
@@ -2798,6 +2798,20 @@ watch(isWindows, () => {
|
|||||||
<CardDescription>{{ t('settings.featureVisibilityDesc') }}</CardDescription>
|
<CardDescription>{{ t('settings.featureVisibilityDesc') }}</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent class="space-y-1">
|
<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">
|
<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">
|
<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" />
|
<Terminal class="size-4 shrink-0 text-muted-foreground" />
|
||||||
@@ -2812,13 +2826,6 @@ watch(isWindows, () => {
|
|||||||
</Label>
|
</Label>
|
||||||
<Switch id="feature-computer-use" v-model="featureVisibility.computerUse" />
|
<Switch id="feature-computer-use" v-model="featureVisibility.computerUse" />
|
||||||
</div>
|
</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>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user