From 65fbbeed0c49f71a6e30a6b47adf16b2f87016a1 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 1 Mar 2025 17:09:32 -0500 Subject: [PATCH] Fetch VM data properly --- pvc-vue/src/App.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pvc-vue/src/App.vue b/pvc-vue/src/App.vue index d33596f..dffa3d1 100644 --- a/pvc-vue/src/App.vue +++ b/pvc-vue/src/App.vue @@ -39,8 +39,9 @@ @@ -61,6 +62,7 @@ const api = useApiStore(); const configPanelOpen = ref(false); const clusterData = ref({}); const nodeData = ref([]); +const vmData = ref([]); const metricsHistory = ref({ cpu: { labels: [], data: [] }, memory: { labels: [], data: [] }, @@ -172,15 +174,20 @@ const updateDashboard = async () => { } try { - const status = await api.fetchStatus(); - const nodes = await api.fetchNodes(); + const [status, nodes, vms] = await Promise.all([ + api.fetchStatus(), + api.fetchNodes(), + api.fetchVMs() + ]); console.log('[API] Status Response:', status); console.log('[API] Nodes Response:', nodes); + console.log('[API] VMs Response:', vms); - // Update state with new objects instead of mutating + // Update state with new objects clusterData.value = { ...status }; nodeData.value = [...nodes]; + vmData.value = [...vms]; const timestamp = new Date().toLocaleTimeString(); updateMetricsHistory(timestamp, status);