From f0814fd1c9b281cbb6839db34d5a0cd3b49b20f8 Mon Sep 17 00:00:00 2001 From: Emanuele Ferrelli Date: Thu, 14 Nov 2024 09:05:36 +0100 Subject: [PATCH] fixed bug for AppBrowser and added field for execution list --- src/views/pages/ApplicationBrowser.vue | 80 ++++++++++++++++---------- src/views/pages/ScenarioExecList.vue | 15 ++++- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/src/views/pages/ApplicationBrowser.vue b/src/views/pages/ApplicationBrowser.vue index 9233a72..3300ef6 100644 --- a/src/views/pages/ApplicationBrowser.vue +++ b/src/views/pages/ApplicationBrowser.vue @@ -6,18 +6,31 @@
-
+
File Browser
- - - +
+
+ + +
+ +
+
+ +
-
-
+
+
File Explorer
- +

+ +

@@ -48,6 +61,7 @@ onMounted(() => { }) function fetchApplicationData() { + nodes.value = null; LoadingStore.another_loading = true; ApplicationCodeService.getApplication(userPrefStore.getSelApp.internal_name) .then(response => { @@ -56,12 +70,11 @@ function fetchApplicationData() { nodes.value = tmp expandAll() LoadingStore.another_loading = false; - }) .catch(error => { console.error("Error fetching application data:", error) LoadingStore.another_loading = false; - + collapseAll(); }) } @@ -72,7 +85,7 @@ function reloadPage() { fetchApplicationData(); } -watch(() => userPrefStore.getSelApp, reloadPage); +watch(() => userPrefStore.getSelApp, reloadPage, { immediate: true }); function onNodeSelect(e){ if(e.icon == "pi pi-fw pi-file"){ @@ -82,14 +95,10 @@ function onNodeSelect(e){ } - - - const expandAll = () => { for (let node of nodes.value) { - expandNode(node); + expandNode(node, true); } - expandedKeys.value = { ...expandedKeys.value }; }; @@ -97,25 +106,20 @@ const collapseAll = () => { expandedKeys.value = {}; }; -/*const expandNode = (node) => { - expandedKeys.value[node.key] = true; - +const expandNode = (node, expandAllChildren = false) => { if (node.children && node.children.length) { - for (let child of node.children) { - expandNode(child); - } - } -};*/ - -const expandNode = (node) => { - if (node.children && node.children.length) { - //node.children.forEach(child => { + expandedKeys.value[node.key] = true; + if (expandAllChildren) { + node.children.forEach(child => { + expandNode(child, expandAllChildren); + }); + } else { expandedKeys.value[node.children.key] = true; - // }); + } } expandedKeys.value = { ...expandedKeys.value }; }; - + const collapseNode = (node) => { if (node.children && node.children.length) { node.children.forEach(child => { @@ -125,6 +129,24 @@ const collapseNode = (node) => { expandedKeys.value = { ...expandedKeys.value }; }; +const skeletonConfigs = [ + { width: "30%", height: "3rem", inline: true }, + { width: "95%", height: "3rem" }, + { width: "50%", height: "1.5rem" }, + { width: "60%", height: "1.5rem" }, + { width: "70%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "70%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "70%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" }, + { width: "70%", height: "1.5rem" }, + { width: "80%", height: "1.5rem" } +]; + diff --git a/src/views/pages/ScenarioExecList.vue b/src/views/pages/ScenarioExecList.vue index 389e15a..f439eaa 100644 --- a/src/views/pages/ScenarioExecList.vue +++ b/src/views/pages/ScenarioExecList.vue @@ -51,10 +51,19 @@ - - + + + + + + +