diff --git a/packages/machine-setup/frontend/src/components/VideoInfo.vue b/packages/machine-setup/frontend/src/components/VideoInfo.vue index 338fa9d..0eb6f92 100644 --- a/packages/machine-setup/frontend/src/components/VideoInfo.vue +++ b/packages/machine-setup/frontend/src/components/VideoInfo.vue @@ -5,7 +5,7 @@

摄像头服务:

- {{ hasCamera ? '已连接' : '未连接' }} + {{ hasCamera ? hasCamera : '未连接' }} {{ runCamera ? '运行中' : '未运行' }}
@@ -13,8 +13,10 @@ 启动 停止 测试 - 激活 状态 + 激活 + 禁用 + 强制摄像头存在

屏幕捕获服务:

@@ -24,8 +26,9 @@ 启动 停止 测试 - 激活 状态 + 激活 + 禁用 @@ -49,7 +52,7 @@ import { filesystem, os } from '@neutralinojs/lib'; import { NCard, NGrid, NGi, NButton, NInput, NTabs, NTabPane } from 'naive-ui'; import { onMounted, ref } from 'vue'; -const hasCamera = ref(false); +const hasCamera = ref(''); const runCamera = ref(false); const runScreen = ref(false); @@ -123,7 +126,7 @@ const saveConfig = async (service: string) => { onMounted(async () => { try { const checkCamera = await filesystem.readDirectory('/dev'); - hasCamera.value = checkCamera.map((item) => item.path).includes('video0'); + hasCamera.value = checkCamera.map((item) => item.entry).filter((item) => item.startsWith('video')).join(', ') || ''; const camera = await filesystem.readFile('/etc/default/vlc-webcam'); const screen = await filesystem.readFile('/etc/default/vlc-screen'); cameraInfo.value = camera;