From e4aa45313aeb875a2ae6059c82fdc798bc9dedb1 Mon Sep 17 00:00:00 2001 From: xiayifan Date: Wed, 1 Apr 2020 17:17:15 +0800 Subject: [PATCH] =?UTF-8?q?image=E5=92=8Cscalar=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mindinsight/ui/src/locales/zh-cn.json | 2 +- .../ui/src/views/train-manage/image.vue | 32 ++++++++++++------- .../ui/src/views/train-manage/scalar.vue | 20 ++++-------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/mindinsight/ui/src/locales/zh-cn.json b/mindinsight/ui/src/locales/zh-cn.json index f349024..d1c07f7 100644 --- a/mindinsight/ui/src/locales/zh-cn.json +++ b/mindinsight/ui/src/locales/zh-cn.json @@ -132,7 +132,7 @@ "50545001": "API 路由资源不存在", "50545002": "请求API的HTTP方法错误", - "50545005": "训练作业不存在或不在缓存中", + "50545005": "训练作业不存在", "50545006": "Summary日志路径无效", "50545007": "Summary数据正在被加载,请等待Summary数据加载结束", "50545009": "查询的节点不在图中", diff --git a/mindinsight/ui/src/views/train-manage/image.vue b/mindinsight/ui/src/views/train-manage/image.vue index 7b3e7eb..1b6725f 100644 --- a/mindinsight/ui/src/views/train-manage/image.vue +++ b/mindinsight/ui/src/views/train-manage/image.vue @@ -257,7 +257,7 @@ export default { if (this.isTimeReload) { this.autoUpdateSamples(); } - this.updateAllData(); + this.updateAllData(false); } }, /** @@ -274,7 +274,10 @@ export default { this.stopUpdateSamples(); } }, - timeReloadValue(newVal) { + /** + *The refresh time is changed + */ + timeReloadValue() { this.autoUpdateSamples(); }, }, @@ -295,6 +298,10 @@ export default { mounted() { this.getCharMainContentwidth(); this.getTagAndRunList(); + // Automatic refresh + if (this.isTimeReload) { + this.autoUpdateSamples(); + } }, methods: { @@ -371,11 +378,6 @@ export default { // Obtains data on the current page this.getCurPageDataArr(); - - // Automatic refresh - if (this.isTimeReload) { - this.autoUpdateSamples(); - } }, this.requestErrorCallback) .catch((e) => { this.$message.error(this.$t('public.dataError')); @@ -445,8 +447,13 @@ export default { ]; } this.$forceUpdate(); - }) - .catch((e) => {}); + }, (e) => { + sampleItem.totalStepNum = 0; + sampleItem.sliderValue = 0; + sampleItem.curStep = ''; + sampleItem.curImgUrl = ''; + sampleItem.curTime = ''; + }).catch((e) => {}); }); }, /** @@ -880,13 +887,14 @@ export default { }, /** * Update all data. + * @param {Boolean} ignoreError whether ignore error tip */ - updateAllData() { + updateAllData(ignoreError) { const params = { plugin_name: 'image', train_id: this.trainingJobId, }; - RequestService.getSingleTrainJob(params, true) + RequestService.getSingleTrainJob(params, ignoreError) .then((res) => { if (this.isReloading) { this.$store.commit('setIsReload', false); @@ -927,7 +935,7 @@ export default { } this.autoUpdateTimer = setInterval(() => { this.$store.commit('clearToken'); - this.updateAllData(); + this.updateAllData(true); }, this.timeReloadValue * 1000); }, /** diff --git a/mindinsight/ui/src/views/train-manage/scalar.vue b/mindinsight/ui/src/views/train-manage/scalar.vue index 833c2b5..1a63f32 100644 --- a/mindinsight/ui/src/views/train-manage/scalar.vue +++ b/mindinsight/ui/src/views/train-manage/scalar.vue @@ -268,7 +268,7 @@ export default { if (this.isTimeReload) { this.autoUpdateSamples(); } - this.updateAllData(); + this.updateAllData(false); } }, /** @@ -285,15 +285,8 @@ export default { } }, - timeReloadValue(newVal) { - if (this.autoUpdateTimer) { - clearInterval(this.autoUpdateTimer); - this.autoUpdateTimer = null; - } - this.autoUpdateTimer = setInterval(() => { - this.$store.commit('clearToken'); - this.updateAllData(); - }, newVal * 1000); + timeReloadValue() { + this.autoUpdateSamples(); }, }, destroyed() { @@ -1519,14 +1512,15 @@ export default { /** * Updating Sliding Block Data + * @param {Boolean} ignoreError whether ignore error tip */ - updateAllData() { + updateAllData(ignoreError) { const params = { plugin_name: 'scalar', train_id: this.trainingJobId, }; - RequestService.getSingleTrainJob(params, true) + RequestService.getSingleTrainJob(params, ignoreError) .then((res) => { if (this.isReloading) { this.$store.commit('setIsReload', false); @@ -1600,7 +1594,7 @@ export default { } this.autoUpdateTimer = setInterval(() => { this.$store.commit('clearToken'); - this.updateAllData(); + this.updateAllData(true); }, this.timeReloadValue * 1000); }, -- GitLab