diff --git a/mindinsight/ui/src/views/train-manage/graph.vue b/mindinsight/ui/src/views/train-manage/graph.vue index 46c412c942a8d534381f93a518ba7c1a123dcb22..64f3c95048f925325acde088cb9c5b7e96b118e9 100644 --- a/mindinsight/ui/src/views/train-manage/graph.vue +++ b/mindinsight/ui/src/views/train-manage/graph.vue @@ -70,7 +70,7 @@ limitations under the License. { if (this.graphDom.el) { this.initGraphRectData(); @@ -813,14 +815,14 @@ export default { }, /** * To obtain datavisual plugins - * @param {Function} callback Call after get data visual plugins. */ - getDatavisualPlugins(callback) { + getDatavisualPlugins() { const params = { train_id: this.trainJobID, }; RequestService.getDatavisualPlugins(params) .then((res) => { + this.fileSearchBox.suggestions = []; if ( !res || !res.data || @@ -828,21 +830,27 @@ export default { !res.data.plugins.graph || !res.data.plugins.graph.length ) { + this.initOver = true; return; } - this.fileSearchBox.suggestions = []; const tags = res.data.plugins.graph; + let hasFileSearchValue = false; tags.forEach((k) => { this.fileSearchBox.suggestions.push({ value: k, }); + hasFileSearchValue = k === this.fileSearchBox.value || hasFileSearchValue; }); - this.fileSearchBox.value = this.fileSearchBox.value || tags[0]; - if (callback) { - callback(); + if (!this.initOver) { + this.initOver = true; + this.fileSearchBox.value = tags.length ? tags[0] : ''; + this.queryGraphData(); + } else if(!hasFileSearchValue) { + this.fileSearchBox.value = ''; } }) .catch(() => { + this.initOver = true; this.loading.show = false; }); }, diff --git a/mindinsight/ui/src/views/train-manage/training-dashboard.vue b/mindinsight/ui/src/views/train-manage/training-dashboard.vue index 819ff84ccd0871729c7f7ac92086010752b7bfc8..5395272800ad862a25ba417ae51699429a929313 100644 --- a/mindinsight/ui/src/views/train-manage/training-dashboard.vue +++ b/mindinsight/ui/src/views/train-manage/training-dashboard.vue @@ -24,12 +24,12 @@ limitations under the License.
{{$t("trainingDashboard.trainingScalar")}}
+ v-if="curPageArr.length && !wrongPlugin">
@@ -37,10 +37,10 @@ limitations under the License.
@@ -51,7 +51,7 @@ limitations under the License.
{{$t("trainingDashboard.calculationChart")}} @@ -59,9 +59,9 @@ limitations under the License.
+ v-show="firstFloorNodes.length && !wrongPlugin">
+ v-show="!firstFloorNodes.length || wrongPlugin">

@@ -71,16 +71,16 @@ limitations under the License.

{{$t("trainingDashboard.dataMap")}}
+ v-show="showDatasetGraph && !wrongPlugin">
+ v-show="!showDatasetGraph || wrongPlugin">

@@ -90,7 +90,7 @@ limitations under the License.

{{$t("trainingDashboard.samplingData")}}
@@ -104,15 +104,15 @@ limitations under the License.
+ :class="originImageDataArr.length && !wrongPlugin ? '' : 'no-data-img'"> + v-if="originImageDataArr.length && !wrongPlugin"> + v-if="!originImageDataArr.length || wrongPlugin">

+ v-if=" !originImageDataArr.length || wrongPlugin"> {{$t("public.noData")}}

@@ -157,6 +157,7 @@ export default { showDatasetGraph: false, datasetGraphviz: {}, reloadStopTime: 1000, + wrongPlugin: false, }; }, computed: { @@ -268,20 +269,30 @@ export default { train_id: this.trainingJobId, manual_update: fromInit || false, }; - RequestService.getDatavisualPlugins(params).then((res) => { - if (!res || !res.data || !res.data.plugins) { - return; - } - const data = res.data.plugins; - const imageTags = data.image || []; - const scalarTags = data.scalar || []; - const graphIds = data.graph || []; - this.dealImageData(imageTags); - this.getScalarList(scalarTags); - if (!this.firstFloorNodes.length && graphIds.length) { - this.queryGraphData(); - } - }); + RequestService.getDatavisualPlugins(params) + .then((res) => { + this.wrongPlugin = false; + if (!res || !res.data || !res.data.plugins) { + return; + } + const data = res.data.plugins; + const imageTags = data.image || []; + const scalarTags = data.scalar || []; + const graphIds = data.graph || []; + this.dealImageData(imageTags); + this.getScalarList(scalarTags); + if (!this.firstFloorNodes.length && graphIds.length) { + this.queryGraphData(); + } + }) + .catch((error)=>{ + if (!error.response || !error.response.data || !error.response.data.error_code) { + return; + } + if (error.response.data.error_code.toString() === '50545005') { + this.wrongPlugin = true; + } + }); }, /**