From 698623f8d4deff9773a5164f17c4662e63913dab Mon Sep 17 00:00:00 2001 From: WeiFeng-mindinsight Date: Sat, 26 Dec 2020 17:03:31 +0800 Subject: [PATCH] UI fix bug that loading not disappear after click next node at last step and reset data of watchpoint hits --- mindinsight/ui/src/mixins/debugger-mixin.vue | 16 +++++++++++++++- mindinsight/ui/src/views/debugger/debugger.vue | 11 +++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/mindinsight/ui/src/mixins/debugger-mixin.vue b/mindinsight/ui/src/mixins/debugger-mixin.vue index e3b81d72..be2335bb 100644 --- a/mindinsight/ui/src/mixins/debugger-mixin.vue +++ b/mindinsight/ui/src/mixins/debugger-mixin.vue @@ -152,9 +152,11 @@ export default { } } } + this.loadingInstance.close(); }, (err) => { this.showErrorMsg(err); + this.loadingInstance.close(); }, ); }, @@ -163,7 +165,9 @@ export default { */ getNextNodeInfo() { this.loadingInstance = this.$loading(this.loadingOption); + this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; const params = { mode: 'continue', level: 'node', @@ -449,6 +453,8 @@ export default { } } } + } else { + this.loadingInstance.close(); } } if (metadata.step && metadata.step > this.metadata.step) { @@ -498,6 +504,7 @@ export default { this.radio1 = 'hit'; this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; this.searchWatchpointHits(true); } @@ -531,6 +538,7 @@ export default { if (type !== 3) { this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; } const params = {}; if (type === 0) { @@ -591,6 +599,7 @@ export default { this.enableRecheck = res.data.metadata.enable_recheck; this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; } if (res.data.metadata.state) { this.metadata.state = res.data.metadata.state; @@ -1560,6 +1569,7 @@ export default { } if (res.data && res.data.watch_point_hits) { this.hitsOutdated = res.data.outdated; + this.watchPointHits = []; this.pagination.total = res.data.total; this.pagination.currentPage = res.data.offset + 1; this.dealWatchpointHits(res.data.watch_point_hits); @@ -1573,6 +1583,7 @@ export default { this.searchWatchpointHits(false); } } else { + this.pagination.currentPage = 1; this.watchPointHits = []; this.pagination.total = 0; } @@ -1594,7 +1605,6 @@ export default { } }, dealWatchpointHits(data) { - this.watchPointHits = []; if (data && data.length) { data.forEach((hit) => { const obj = { @@ -1636,6 +1646,10 @@ export default { this.watchPointHits.push(obj); }); this.focusWatchpointHit(); + } else { + this.pagination.currentPage = 1; + this.watchPointHits = []; + this.pagination.total = 0; } }, focusWatchpointHit() { diff --git a/mindinsight/ui/src/views/debugger/debugger.vue b/mindinsight/ui/src/views/debugger/debugger.vue index 3f2791bd..3c9ed48b 100644 --- a/mindinsight/ui/src/views/debugger/debugger.vue +++ b/mindinsight/ui/src/views/debugger/debugger.vue @@ -887,6 +887,7 @@ export default { } else if (this.oldState === this.state.running || oldValue === this.state.running) { this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; this.searchWatchpointHits(true); } } @@ -1040,7 +1041,7 @@ export default { (res) => { if (res.data && res.data.graph) { const graph = res.data.graph; - this.curNodeData = graph.nodes.map((val) => { + this.origialTree = graph.nodes.map((val) => { return { label: val.name.split('/').pop(), ...val, @@ -1049,17 +1050,17 @@ export default { }); this.node.childNodes = []; this.curWatchPointId = id; - this.resolve(this.curNodeData); + this.resolve(this.origialTree); this.$refs.tree.getCheckedKeys().forEach((val) => { this.$refs.tree.setChecked(val, false); }); // watched 0:unchecked 1:indeterminate 2:checked -1:no checkbox - this.defaultCheckedArr = this.curNodeData + this.defaultCheckedArr = this.origialTree .filter((val) => { return val.watched === this.checkboxStatus.checked; }) .map((val) => val.name); - const halfSelectArr = this.curNodeData + const halfSelectArr = this.origialTree .filter((val) => { return val.watched === this.checkboxStatus.indeterminate; }) @@ -1274,6 +1275,7 @@ export default { continueTo() { this.pagination.currentPage = 1; this.watchPointHits = []; + this.pagination.total = 0; const params = { mode: 'continue', level: 'node', @@ -1516,6 +1518,7 @@ export default { } } this.isHitIntoView = true; + this.loadingInstance.close(); }, /** * The node information of the selected node.