feat(Device): remove useless device status

This commit is contained in:
AkiChase 2024-05-14 18:27:36 +08:00
parent 83f153eb34
commit db4f51e9e2
2 changed files with 5 additions and 7 deletions

View File

@ -98,7 +98,7 @@ onUnmounted(() => {
const devices: Ref<Device[]> = ref([]);
const availableDevice = computed(() => {
return devices.value.filter((d) => {
return store.controledDevice?.device.id !== d.id;
return store.controledDevice?.deviceID !== d.id;
});
});
const tableCols: DataTableColumns = [
@ -227,7 +227,7 @@ async function deviceControl() {
store.controledDevice = {
scid,
deviceName,
device,
deviceID: device.id,
};
nextTick(() => {
deviceWaitForMetadataTask = null;
@ -332,7 +332,7 @@ async function connectDevice() {
<div class="controled-device" v-if="store.controledDevice">
<div>
{{ store.controledDevice.deviceName }} ({{
store.controledDevice.device.id
store.controledDevice.deviceID
}})
</div>
<div class="device-op">
@ -344,8 +344,7 @@ async function connectDevice() {
</template>
</NButton>
</template>
scid: {{ store.controledDevice.scid }} <br />status:
{{ store.controledDevice.device.status }}
scid: {{ store.controledDevice.scid }}
</NTooltip>
<NButton quaternary circle type="error" @click="shutdownSC()">
<template #icon>

View File

@ -1,6 +1,5 @@
import { defineStore } from "pinia";
import { Ref, ref } from "vue";
import { Device } from "../invoke";
import {
KeyMapping,
KeyMappingConfig,
@ -22,7 +21,7 @@ export const useGlobalStore = defineStore("global", () => {
interface ControledDevice {
scid: string;
deviceName: string;
device: Device;
deviceID: string;
}
const controledDevice: Ref<ControledDevice | null> = ref(null);