提交 867e3412 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!487 UI add loading icon in training dashboard

Merge pull request !487 from 夏易凡/r0.6
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
"samplingData": "数据抽样", "samplingData": "数据抽样",
"imagesampleSwitch": "切换标签", "imagesampleSwitch": "切换标签",
"invalidId": "无效的训练作业", "invalidId": "无效的训练作业",
"summaryDirPath": "训练日志路径:" "summaryDirPath": "训练日志路径:",
"loadingTip": "加载中"
}, },
"scalar": { "scalar": {
"titleText": "标量", "titleText": "标量",
......
...@@ -21,6 +21,9 @@ limitations under the License. ...@@ -21,6 +21,9 @@ limitations under the License.
<div class="cl-dashboard-top-title"> <div class="cl-dashboard-top-title">
{{$t('trainingDashboard.trainingDashboardTitle')}} {{$t('trainingDashboard.trainingDashboardTitle')}}
</div> </div>
<div :title="$t('trainingDashboard.loadingTip')"
v-if="trainJobCached"
class="el-icon-loading loading-icon"></div>
<div class="path-message"> <div class="path-message">
<span>{{$t('symbols.leftbracket')}}</span> <span>{{$t('symbols.leftbracket')}}</span>
<span>{{$t('trainingDashboard.summaryDirPath')}}</span> <span>{{$t('trainingDashboard.summaryDirPath')}}</span>
...@@ -234,6 +237,12 @@ export default { ...@@ -234,6 +237,12 @@ export default {
mousedown: 'mousedown', mousedown: 'mousedown',
mouseup: 'mouseup', mouseup: 'mouseup',
}, },
trainJobCached: false,
cacheKey: {
notInCache: 'NOT_IN_CACHE',
caching: 'CACHING',
cached: 'CACHED',
},
}; };
}, },
computed: { computed: {
...@@ -262,6 +271,7 @@ export default { ...@@ -262,6 +271,7 @@ export default {
} }
this.getDatavisualPlugins(true); this.getDatavisualPlugins(true);
this.queryDatasetGraph(); this.queryDatasetGraph();
this.queryTrainJobCacheState();
setTimeout(() => { setTimeout(() => {
this.$store.commit('setIsReload', false); this.$store.commit('setIsReload', false);
}, this.reloadStopTime); }, this.reloadStopTime);
...@@ -349,6 +359,7 @@ export default { ...@@ -349,6 +359,7 @@ export default {
this.startAutoUpdate(); this.startAutoUpdate();
} }
this.queryDatasetGraph(); this.queryDatasetGraph();
this.queryTrainJobCacheState();
}, },
/** /**
...@@ -504,6 +515,7 @@ export default { ...@@ -504,6 +515,7 @@ export default {
if (!Object.keys(this.allDatasetGraphData).length) { if (!Object.keys(this.allDatasetGraphData).length) {
this.queryDatasetGraph(); this.queryDatasetGraph();
} }
this.queryTrainJobCacheState();
}, this.timeReloadValue * 1000); }, this.timeReloadValue * 1000);
}, },
/** /**
...@@ -1941,6 +1953,31 @@ export default { ...@@ -1941,6 +1953,31 @@ export default {
.selectAll('title') .selectAll('title')
.remove(); .remove();
}, },
/**
* Query the cachee status of training jonb
*/
queryTrainJobCacheState() {
const params = {
train_id: this.trainingJobId,
};
RequestService.querySummaryList(params, true).then((response) => {
if (
response &&
response.data &&
response.data.train_jobs &&
response.data.train_jobs.length
) {
const curTrain = response.data.train_jobs[0];
if (curTrain.cache_status !== this.cacheKey.cached) {
this.trainJobCached = true;
} else {
this.trainJobCached = false;
}
} else {
this.trainJobCached = false;
}
});
},
}, },
}; };
</script> </script>
...@@ -1963,6 +2000,9 @@ export default { ...@@ -1963,6 +2000,9 @@ export default {
padding: 18px 16px; padding: 18px 16px;
font-weight: bold; font-weight: bold;
} }
.loading-icon {
margin-left: 5px;
}
.cl-dashboard-top-title { .cl-dashboard-top-title {
float: left; float: left;
color: #000000; color: #000000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册