From 0619aa4d2b313da768c636601b0e6d4333d3479c Mon Sep 17 00:00:00 2001 From: ph Date: Sat, 19 Sep 2020 17:00:26 +0800 Subject: [PATCH] update caching and not in cache icon --- .../ui/src/components/multiselectGroup.vue | 16 +++++++++++----- mindinsight/ui/src/locales/en-us.json | 2 +- mindinsight/ui/src/locales/zh-cn.json | 2 +- .../views/train-manage/training-dashboard.vue | 18 +++++++++++------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/mindinsight/ui/src/components/multiselectGroup.vue b/mindinsight/ui/src/components/multiselectGroup.vue index ff3970f7..6c5ee3b3 100644 --- a/mindinsight/ui/src/components/multiselectGroup.vue +++ b/mindinsight/ui/src/components/multiselectGroup.vue @@ -49,9 +49,12 @@ limitations under the License. :content="item.label" placement="top"> - + v-if="item.checked && item.loading==='NOT_IN_CACHE'"> + {{item.label}} @@ -83,9 +86,12 @@ limitations under the License. :content="item.label" placement="top"> - + + {{item.label}} diff --git a/mindinsight/ui/src/locales/en-us.json b/mindinsight/ui/src/locales/en-us.json index 2c25c9ba..45391adb 100644 --- a/mindinsight/ui/src/locales/en-us.json +++ b/mindinsight/ui/src/locales/en-us.json @@ -143,6 +143,7 @@ "invalidId": "Invalid training job.", "summaryDirPath": "Summary path:", "loadingTip": "Loading...", + "waitLoading": "waiting to be loaded", "switchTitle": "The Computational Graph and Data Graph modules do not support auto refresh." }, "scalar": { @@ -450,7 +451,6 @@ "gridAccuracy": "Decimal places are reserved.", "inCorrectInput": "Invalid input.", "gridTableNoData": "No data in the table.", - "cache": "CACHING", "value": "Value", "dimsFilterInputTitle": "Dimension Selection", "dimsFilterInputTip": "The dimension value can be a specific index (consistent with the Python index meaning and supporting negative signs) or a colon (:) that indicates all values of the current dimension." diff --git a/mindinsight/ui/src/locales/zh-cn.json b/mindinsight/ui/src/locales/zh-cn.json index 882c954e..e4312645 100644 --- a/mindinsight/ui/src/locales/zh-cn.json +++ b/mindinsight/ui/src/locales/zh-cn.json @@ -143,6 +143,7 @@ "invalidId": "无效的训练作业", "summaryDirPath": "训练日志路径:", "loadingTip": "加载中", + "waitLoading": "待加载", "switchTitle": "计算图和数据图模块不支持自动刷新" }, "scalar": { @@ -449,7 +450,6 @@ "gridAccuracy": "保留小数位", "inCorrectInput": "无效输入", "gridTableNoData": "表格无数据", - "cache": "正在加载", "value": "数值", "dimsFilterInputTitle": "维度选择", "dimsFilterInputTip": "维度输入值可以是具体的索引(和Python的索引含义一致,支持负号)或者冒号\":\",其中冒号\":\"表示当前维度的所有值" diff --git a/mindinsight/ui/src/views/train-manage/training-dashboard.vue b/mindinsight/ui/src/views/train-manage/training-dashboard.vue index f90ab428..7a373f07 100644 --- a/mindinsight/ui/src/views/train-manage/training-dashboard.vue +++ b/mindinsight/ui/src/views/train-manage/training-dashboard.vue @@ -21,9 +21,10 @@ limitations under the License.
{{$t('trainingDashboard.trainingDashboardTitle')}}
-
+ class="loading-icon" + :class="trainJobCached > 1 ? 'el-icon-loading' : 'el-icon-time'">
{{$t('symbols.leftbracket')}} {{$t('trainingDashboard.summaryDirPath')}} @@ -314,7 +315,7 @@ export default { mousedown: 'mousedown', mouseup: 'mouseup', }, - trainJobCached: false, + trainJobCached: 0, cacheKey: { notInCache: 'NOT_IN_CACHE', caching: 'CACHING', @@ -2110,13 +2111,16 @@ export default { response.data.train_jobs.length ) { const curTrain = response.data.train_jobs[0]; - if (curTrain.cache_status !== this.cacheKey.cached) { - this.trainJobCached = true; + const showIcon = curTrain.graph_files || curTrain.summary_files; + if (showIcon && curTrain.cache_status === this.cacheKey.notInCache) { + this.trainJobCached = 1; + } else if (showIcon && curTrain.cache_status === this.cacheKey.caching) { + this.trainJobCached = 2; } else { - this.trainJobCached = false; + this.trainJobCached = 0; } } else { - this.trainJobCached = false; + this.trainJobCached = 0; } }); },