Browse Source

!1078 UI fix bug that loading not disappear after click next node at last step and reset data of watchpoint hits

From: @huang_wei_feng4
Reviewed-by: @panhui3,@lilongfei15,@wangyue01
Signed-off-by: @wangyue01
pull/1078/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
1766db8442
2 changed files with 22 additions and 5 deletions
  1. +15
    -1
      mindinsight/ui/src/mixins/debugger-mixin.vue
  2. +7
    -4
      mindinsight/ui/src/views/debugger/debugger.vue

+ 15
- 1
mindinsight/ui/src/mixins/debugger-mixin.vue View File

@@ -152,9 +152,11 @@ export default {
} }
} }
} }
this.loadingInstance.close();
}, },
(err) => { (err) => {
this.showErrorMsg(err); this.showErrorMsg(err);
this.loadingInstance.close();
}, },
); );
}, },
@@ -163,7 +165,9 @@ export default {
*/ */
getNextNodeInfo() { getNextNodeInfo() {
this.loadingInstance = this.$loading(this.loadingOption); this.loadingInstance = this.$loading(this.loadingOption);
this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
const params = { const params = {
mode: 'continue', mode: 'continue',
level: 'node', level: 'node',
@@ -449,6 +453,8 @@ export default {
} }
} }
} }
} else {
this.loadingInstance.close();
} }
} }
if (metadata.step && metadata.step > this.metadata.step) { if (metadata.step && metadata.step > this.metadata.step) {
@@ -498,6 +504,7 @@ export default {
this.radio1 = 'hit'; this.radio1 = 'hit';
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
this.searchWatchpointHits(true); this.searchWatchpointHits(true);
} }


@@ -531,6 +538,7 @@ export default {
if (type !== 3) { if (type !== 3) {
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
} }
const params = {}; const params = {};
if (type === 0) { if (type === 0) {
@@ -591,6 +599,7 @@ export default {
this.enableRecheck = res.data.metadata.enable_recheck; this.enableRecheck = res.data.metadata.enable_recheck;
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
} }
if (res.data.metadata.state) { if (res.data.metadata.state) {
this.metadata.state = 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) { if (res.data && res.data.watch_point_hits) {
this.hitsOutdated = res.data.outdated; this.hitsOutdated = res.data.outdated;
this.watchPointHits = [];
this.pagination.total = res.data.total; this.pagination.total = res.data.total;
this.pagination.currentPage = res.data.offset + 1; this.pagination.currentPage = res.data.offset + 1;
this.dealWatchpointHits(res.data.watch_point_hits); this.dealWatchpointHits(res.data.watch_point_hits);
@@ -1573,6 +1583,7 @@ export default {
this.searchWatchpointHits(false); this.searchWatchpointHits(false);
} }
} else { } else {
this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0; this.pagination.total = 0;
} }
@@ -1594,7 +1605,6 @@ export default {
} }
}, },
dealWatchpointHits(data) { dealWatchpointHits(data) {
this.watchPointHits = [];
if (data && data.length) { if (data && data.length) {
data.forEach((hit) => { data.forEach((hit) => {
const obj = { const obj = {
@@ -1636,6 +1646,10 @@ export default {
this.watchPointHits.push(obj); this.watchPointHits.push(obj);
}); });
this.focusWatchpointHit(); this.focusWatchpointHit();
} else {
this.pagination.currentPage = 1;
this.watchPointHits = [];
this.pagination.total = 0;
} }
}, },
focusWatchpointHit() { focusWatchpointHit() {


+ 7
- 4
mindinsight/ui/src/views/debugger/debugger.vue View File

@@ -887,6 +887,7 @@ export default {
} else if (this.oldState === this.state.running || oldValue === this.state.running) { } else if (this.oldState === this.state.running || oldValue === this.state.running) {
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
this.searchWatchpointHits(true); this.searchWatchpointHits(true);
} }
} }
@@ -1040,7 +1041,7 @@ export default {
(res) => { (res) => {
if (res.data && res.data.graph) { if (res.data && res.data.graph) {
const graph = res.data.graph; const graph = res.data.graph;
this.curNodeData = graph.nodes.map((val) => {
this.origialTree = graph.nodes.map((val) => {
return { return {
label: val.name.split('/').pop(), label: val.name.split('/').pop(),
...val, ...val,
@@ -1049,17 +1050,17 @@ export default {
}); });
this.node.childNodes = []; this.node.childNodes = [];
this.curWatchPointId = id; this.curWatchPointId = id;
this.resolve(this.curNodeData);
this.resolve(this.origialTree);
this.$refs.tree.getCheckedKeys().forEach((val) => { this.$refs.tree.getCheckedKeys().forEach((val) => {
this.$refs.tree.setChecked(val, false); this.$refs.tree.setChecked(val, false);
}); });
// watched 0:unchecked 1:indeterminate 2:checked -1:no checkbox // watched 0:unchecked 1:indeterminate 2:checked -1:no checkbox
this.defaultCheckedArr = this.curNodeData
this.defaultCheckedArr = this.origialTree
.filter((val) => { .filter((val) => {
return val.watched === this.checkboxStatus.checked; return val.watched === this.checkboxStatus.checked;
}) })
.map((val) => val.name); .map((val) => val.name);
const halfSelectArr = this.curNodeData
const halfSelectArr = this.origialTree
.filter((val) => { .filter((val) => {
return val.watched === this.checkboxStatus.indeterminate; return val.watched === this.checkboxStatus.indeterminate;
}) })
@@ -1274,6 +1275,7 @@ export default {
continueTo() { continueTo() {
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.watchPointHits = []; this.watchPointHits = [];
this.pagination.total = 0;
const params = { const params = {
mode: 'continue', mode: 'continue',
level: 'node', level: 'node',
@@ -1516,6 +1518,7 @@ export default {
} }
} }
this.isHitIntoView = true; this.isHitIntoView = true;
this.loadingInstance.close();
}, },
/** /**
* The node information of the selected node. * The node information of the selected node.


Loading…
Cancel
Save