mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-07-31 01:51:45 +08:00
refactor: 前端界面微调
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { buildWsUrl } from '@/types/websocket'
|
||||
import { generateUUID } from '@/lib/utils'
|
||||
import type { ComputerUseScreenshot, ComputerUseSession, ComputerUseAction } from '@/api'
|
||||
|
||||
export type ComputerUseServerMessage =
|
||||
@@ -16,7 +17,7 @@ export function useComputerUseSocket(options: {
|
||||
}) {
|
||||
const connected = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
const clientId = crypto.randomUUID()
|
||||
const clientId = generateUUID()
|
||||
let ws: WebSocket | null = null
|
||||
let connectPromise: Promise<void> | null = null
|
||||
|
||||
|
||||
20
web/src/composables/useFeatureVisibility.ts
Normal file
20
web/src/composables/useFeatureVisibility.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useLocalStorage } from '@vueuse/core'
|
||||
import type { RemovableRef } from '@vueuse/core'
|
||||
|
||||
export type FeatureVisibilityKey = 'webTerminal' | 'computerUse'
|
||||
export type FeatureVisibility = Record<FeatureVisibilityKey, boolean>
|
||||
|
||||
const DEFAULT_FEATURE_VISIBILITY: FeatureVisibility = {
|
||||
webTerminal: true,
|
||||
computerUse: true,
|
||||
}
|
||||
|
||||
const featureVisibility = useLocalStorage<FeatureVisibility>(
|
||||
'featureVisibility',
|
||||
DEFAULT_FEATURE_VISIBILITY,
|
||||
{ mergeDefaults: true },
|
||||
)
|
||||
|
||||
export function useFeatureVisibility(): RemovableRef<FeatureVisibility> {
|
||||
return featureVisibility
|
||||
}
|
||||
Reference in New Issue
Block a user