diff --git a/adminui/frontend/src/pages/Dashboard.vue b/adminui/frontend/src/pages/Dashboard.vue
index aa8ff548..e70c956f 100644
--- a/adminui/frontend/src/pages/Dashboard.vue
+++ b/adminui/frontend/src/pages/Dashboard.vue
@@ -72,9 +72,7 @@ const { next: nextPage, prev: prevPage, totalPages, currentItems: currentLogLine
View Active Sessions
{{
- allDevices.filter(e => {
- e.active
- }).length ?? 0 + ' active sessions'
+ devicesStore.numActive() + ' active sessions'
}}
diff --git a/adminui/frontend/src/stores/devices.ts b/adminui/frontend/src/stores/devices.ts
index 61c0d99e..de67011b 100644
--- a/adminui/frontend/src/stores/devices.ts
+++ b/adminui/frontend/src/stores/devices.ts
@@ -37,6 +37,7 @@ export const useDevicesStore = defineStore({
getters: {
byAddress: state => (address: string) => state.devices.find(x => x.internal_ip == address),
byOwner: state => (owner: string) => state.devices.find(x => x.owner == owner),
- numDevices: state => () => state.devices?.length ?? 0
+ numDevices: state => () => state.devices?.length ?? 0,
+ numActive: state => () => state.devices?.filter(x => x.active).length ?? 0
}
})