diff --git a/webclient-vue/src/components/device/DeviceTable.vue b/webclient-vue/src/components/device/DeviceTable.vue index 25e7034..df0b0c7 100644 --- a/webclient-vue/src/components/device/DeviceTable.vue +++ b/webclient-vue/src/components/device/DeviceTable.vue @@ -44,7 +44,7 @@ diff --git a/webclient-vue/src/features/devices/pages/DeviceDetailPage.vue b/webclient-vue/src/features/devices/pages/DeviceDetailPage.vue index c400dd3..58eaf9e 100644 --- a/webclient-vue/src/features/devices/pages/DeviceDetailPage.vue +++ b/webclient-vue/src/features/devices/pages/DeviceDetailPage.vue @@ -29,6 +29,18 @@ {{ device.device_type }}
+ State: + + + +
+
IP: {{ device.device_ip }}
@@ -64,33 +76,6 @@
Description

{{ device.description }}

- -
-
Channel status
- - - - - - -
devicesStore.currentDevice); const isLoading = computed(() => devicesStore.isLoadingDetail); const error = computed(() => devicesStore.errorDetail); -const isLoadingStatus = computed(() => devicesStore.isLoadingStates); -const statusError = computed(() => devicesStore.stateError); -const channels = computed(() => devicesStore.currentDeviceStatus?.channels || []); + +const isLoadingStatus = ref(false); +const statusError = ref(null); const area = computed(() => { const areaId = device.value?.area_id; @@ -231,11 +216,6 @@ const removeLoading = ref(false); const removeError = ref(""); -const channelColumns = [ - { key: "channel", label: "Channel" }, - { key: "state", label: "State" }, - { key: "type", label: "Type" }, -]; const deviceActions = computed(() => [ { label: "Edit", icon: "ph-pencil", onSelect: openEdit }, @@ -334,7 +314,7 @@ if (!result.ok) { toast.error({ title: "Reboot failed", text: result.error?.message || "Failed to reboot device" }); } else { - toast.success({ title: "Rebooting", text: `Device ${device.value.name || device.value.alias} is rebooting` }); + toast.success({ title: "Rebooting", text: `Device ${device.value.name || device.value.alias || "#" + device.value.id} is rebooting` }); } } @@ -342,7 +322,17 @@ const id = deviceId.value; if (!id || !device.value) return; if (device.value.connection_status !== "active") return; - await devicesStore.loadDeviceStatus(id); + + isLoadingStatus.value = true; + statusError.value = null; + + const result = await devicesStore.loadDeviceStatus(id); + + isLoadingStatus.value = false; + + if (!result.ok) { + statusError.value = result.error; + } } async function init() {