From d21d4ed16b731fceb65fa203a6c13d291c6c9038 Mon Sep 17 00:00:00 2001 From: chiayin Date: Mon, 6 Nov 2023 14:49:25 +0800 Subject: [PATCH] Issues #182: done. --- src/components/Discover/Map/SidebarFilter.vue | 2 +- src/components/Discover/Map/SidebarTraces.vue | 4 ---- src/stores/allMapData.js | 4 ++-- src/views/Discover/Map/index.vue | 2 +- src/views/Files/index.vue | 1 + 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/Discover/Map/SidebarFilter.vue b/src/components/Discover/Map/SidebarFilter.vue index d109825..01b158f 100644 --- a/src/components/Discover/Map/SidebarFilter.vue +++ b/src/components/Discover/Map/SidebarFilter.vue @@ -455,7 +455,7 @@ export default { type = "Attributes"; break; case 'boolean-attr': - label = `${includeStr}, ${e.key}, ${this.selectAttribute.label}`; + label = `${includeStr}, ${e.key}, ${this.selectAttribute?.label}`; type = "Attributes"; break; case 'int-attr': diff --git a/src/components/Discover/Map/SidebarTraces.vue b/src/components/Discover/Map/SidebarTraces.vue index 8e0a751..8cd76b7 100644 --- a/src/components/Discover/Map/SidebarTraces.vue +++ b/src/components/Discover/Map/SidebarTraces.vue @@ -230,7 +230,6 @@ export default { // 因 trace api 連動,所以關閉側邊欄時讓數值歸 traces 第一筆 id this.showTraceId = await this.traces[0]?.id; this.infiniteStart = await 0; - await this.allMapDataStore.getTraceDetail(); this.setNodesData(); this.setEdgesData(); this.createCy(); @@ -261,9 +260,6 @@ export default { } } }, - async created() { - this.allMapDataStore.getTraceDetail(); - } } diff --git a/src/stores/allMapData.js b/src/stores/allMapData.js index 2bd4928..619ba79 100644 --- a/src/stores/allMapData.js +++ b/src/stores/allMapData.js @@ -7,7 +7,7 @@ export default defineStore('allMapDataStore', { state: () => ({ baseLogId: null, logId: null, - traceId: 1, + traceId: null, baseTraceId: 1, tempFilterId: null, createFilterId: null, @@ -223,7 +223,7 @@ export default defineStore('allMapDataStore', { return this.allBaseCase; } catch(error) { if(error.response.status === 404) return this.infinite404 = 404; - apiError(error, 'Failed to load the Trace Detail.'); + apiError(error, 'Failed to load the Base Trace Detail.'); }; }, /** diff --git a/src/views/Discover/Map/index.vue b/src/views/Discover/Map/index.vue index fe4ef34..4c21121 100644 --- a/src/views/Discover/Map/index.vue +++ b/src/views/Discover/Map/index.vue @@ -299,7 +299,6 @@ export default { // 先 loading 再執行以下程式 this.isLoading = true; // Log 檔前往 Map Log 頁, Filter 檔前往 Map Filter 頁 - this.baseLogId = this.$route.params.fileId; if(this.$route.params.type === 'log'){ this.logId = this.$route.params.fileId; }else if(this.$route.params.type === 'filter') { @@ -317,6 +316,7 @@ export default { this.baseTraceId = await this.baseTraces[0]?.id; this.createCy(this.mapType); await this.allMapDataStore.getFilterParams(); + await this.allMapDataStore.getTraceDetail(); // 執行完後才取消 loading this.isLoading = false; diff --git a/src/views/Files/index.vue b/src/views/Files/index.vue index 1723f66..97f466f 100644 --- a/src/views/Files/index.vue +++ b/src/views/Files/index.vue @@ -148,6 +148,7 @@ case 'Filter': this.createFilterId = file.id; this.baseLogId = file.log.id; + console.log('files filter:', this.baseLogId); fileId = file.id; type = 'filter'; params = { type: type, fileId: fileId };