From efc3b6a4429b121d92575c693033263332e25521 Mon Sep 17 00:00:00 2001 From: Scott Fasone Date: Mon, 3 Jun 2024 12:17:18 -0400 Subject: [PATCH 1/5] fix(frontend): updated attribute timeseries query to actually get current value --- frontend/lib/graphql/equipment.graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/graphql/equipment.graphql b/frontend/lib/graphql/equipment.graphql index 7241252..c6ed492 100644 --- a/frontend/lib/graphql/equipment.graphql +++ b/frontend/lib/graphql/equipment.graphql @@ -75,7 +75,7 @@ fragment AttributeOverview on Attribute { # Also fetching latest Time Series value, in case "current" value isn't set getTimeSeries( - first: 1, + offset: 1, maxSamples: 1, startTime: $startTime, endTime: $endTime From 4e87ffdf352d6e988af8f08660ba62afb82af125 Mon Sep 17 00:00:00 2001 From: Scott Fasone Date: Mon, 3 Jun 2024 12:18:52 -0400 Subject: [PATCH 2/5] refactor(frontend): exposed pending state on equipments query --- frontend/composables/useAsyncEquipmentWithOEE.ts | 9 ++++++++- frontend/pages/index.vue | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/composables/useAsyncEquipmentWithOEE.ts b/frontend/composables/useAsyncEquipmentWithOEE.ts index affae85..f1a0281 100644 --- a/frontend/composables/useAsyncEquipmentWithOEE.ts +++ b/frontend/composables/useAsyncEquipmentWithOEE.ts @@ -6,7 +6,12 @@ import { parseEquipmentWithOEE } from "~/lib/equipment"; export default function useAsyncEquipmentWithOEE() { - const { data: equipmentIds, refresh: idRefresh, status: idStatus } = useAsyncEquipmentIds(); + const { + data: equipmentIds, + refresh: idRefresh, + status: idStatus, + pending: idPending, + } = useAsyncEquipmentIds(); // TODO: Use equipment timezone instead of user timezone. const startTime = new Date(); @@ -39,10 +44,12 @@ export default function useAsyncEquipmentWithOEE() { // Compound status involving both queries. const status = computed(() => idStatus.value === "success" ? res.status.value : idStatus.value); + const pending = computed(() => idPending.value || res.pending.value); return { ...res, status, + pending, refresh: () => idRefresh().then(() => res.refresh()), }; } diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index ae00066..86586ab 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -1,7 +1,7 @@