提交 229bfdb8 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!568 UI change dashboard jumping mode and default auto fresh time

Merge pull request !568 from 潘慧/master_ph
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
"dataTraceback": "Dataset Lineage", "dataTraceback": "Dataset Lineage",
"comparePlate": "Comparison Dashboard", "comparePlate": "Comparison Dashboard",
"disableProfilerTip": "Failed to view profiling because no profiler log is available.", "disableProfilerTip": "Failed to view profiling because no profiler log is available.",
"hardwareVisual": "Hardware Resources" "hardwareVisual": "Hardware Resources",
"openNewTab": "Open Link in New Tab"
}, },
"modelTraceback": { "modelTraceback": {
"summaryPath": "Summary Path", "summaryPath": "Summary Path",
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
"dataTraceback": "数据溯源", "dataTraceback": "数据溯源",
"comparePlate": "对比看板", "comparePlate": "对比看板",
"disableProfilerTip": "无profiler日志,无法查看性能分析", "disableProfilerTip": "无profiler日志,无法查看性能分析",
"hardwareVisual": "硬件资源" "hardwareVisual": "硬件资源",
"openNewTab": "打开新页签"
}, },
"modelTraceback": { "modelTraceback": {
"summaryPath": "训练日志路径", "summaryPath": "训练日志路径",
......
...@@ -29,7 +29,7 @@ export default new Vuex.Store({ ...@@ -29,7 +29,7 @@ export default new Vuex.Store({
// reload time // reload time
timeReloadValue: localStorage.timeReloadValue timeReloadValue: localStorage.timeReloadValue
? localStorage.timeReloadValue ? localStorage.timeReloadValue
: 3, : 10,
// Scheduled hardware reload flag // Scheduled hardware reload flag
isHardwareTimeReload: localStorage.isHardwareTimeReload === 'false' ? false : true, isHardwareTimeReload: localStorage.isHardwareTimeReload === 'false' ? false : true,
// hardware reload time // hardware reload time
......
...@@ -65,7 +65,7 @@ import RequestService from '../../services/request-service'; ...@@ -65,7 +65,7 @@ import RequestService from '../../services/request-service';
export default { export default {
data() { data() {
return { return {
summaryPath: this.$route.query.summaryPath, summaryPath: '',
tipsArrayList: [ tipsArrayList: [
'step_trace-iter_interval', 'step_trace-iter_interval',
'minddata_pipeline-general', 'minddata_pipeline-general',
...@@ -100,6 +100,7 @@ export default { ...@@ -100,6 +100,7 @@ export default {
this.curDashboardInfo.query.id = this.$route.query.id; this.curDashboardInfo.query.id = this.$route.query.id;
this.curDashboardInfo.query.dir = this.$route.query.dir; this.curDashboardInfo.query.dir = this.$route.query.dir;
this.curDashboardInfo.query.path = this.$route.query.path; this.curDashboardInfo.query.path = this.$route.query.path;
this.summaryPath = decodeURIComponent( this.$route.query.id);
this.getDeviceList(); this.getDeviceList();
} else { } else {
this.curDashboardInfo.query.trainingJobId = ''; this.curDashboardInfo.query.trainingJobId = '';
......
...@@ -65,7 +65,7 @@ import RequestService from '../../services/request-service'; ...@@ -65,7 +65,7 @@ import RequestService from '../../services/request-service';
export default { export default {
data() { data() {
return { return {
summaryPath: this.$route.query.summaryPath, summaryPath: '',
tipsArrayList: [ tipsArrayList: [
'step_trace-iter_interval', 'step_trace-iter_interval',
'minddata_pipeline-general', 'minddata_pipeline-general',
...@@ -101,6 +101,7 @@ export default { ...@@ -101,6 +101,7 @@ export default {
this.curDashboardInfo.query.id = this.$route.query.id; this.curDashboardInfo.query.id = this.$route.query.id;
this.curDashboardInfo.query.dir = this.$route.query.dir; this.curDashboardInfo.query.dir = this.$route.query.dir;
this.curDashboardInfo.query.path = this.$route.query.path; this.curDashboardInfo.query.path = this.$route.query.path;
this.summaryPath = decodeURIComponent( this.$route.query.id);
this.getDeviceList(); this.getDeviceList();
} else { } else {
this.curDashboardInfo.query.trainingJobId = ''; this.curDashboardInfo.query.trainingJobId = '';
......
...@@ -1208,9 +1208,7 @@ export default { ...@@ -1208,9 +1208,7 @@ export default {
this.$store.commit('setIsReload', false); this.$store.commit('setIsReload', false);
this.isReloading = false; this.isReloading = false;
} }
if (error.response && error.response.data) { this.clearAllData();
this.clearAllData();
}
}, },
/** /**
......
...@@ -69,14 +69,15 @@ limitations under the License. ...@@ -69,14 +69,15 @@ limitations under the License.
:label="$t('summaryManage.operation')" :label="$t('summaryManage.operation')"
width="240"> width="240">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <span class="menu-item"
@click.stop="goToTrainDashboard(scope.row)"> @contextmenu.prevent="rightClick(scope.row, $event, 0)"
{{$t('summaryManage.viewDashboard')}} </el-button> @click.stop="goToTrainDashboard(scope.row)">
<el-button type="text" {{$t('summaryManage.viewDashboard')}} </span>
class="operate-btn" <span class="menu-item operate-btn"
v-if="scope.row.viewProfiler" v-if="scope.row.viewProfiler"
@contextmenu.prevent="rightClick(scope.row, $event, 1)"
@click.stop="goToProfiler(scope.row)"> @click.stop="goToProfiler(scope.row)">
{{$t('summaryManage.viewProfiler')}} </el-button> {{$t('summaryManage.viewProfiler')}} </span>
<el-button type="text" <el-button type="text"
class="operate-btn" class="operate-btn"
disabled disabled
...@@ -99,6 +100,13 @@ limitations under the License. ...@@ -99,6 +100,13 @@ limitations under the License.
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<div id="contextMenu"
v-if="contextMenu.show"
:style="{left: contextMenu.left, top: contextMenu.top}">
<ul>
<li @click="doRightClick()">{{$t('summaryManage.openNewTab')}}</li>
</ul>
</div>
</div> </div>
</template> </template>
...@@ -117,11 +125,20 @@ export default { ...@@ -117,11 +125,20 @@ export default {
total: 0, total: 0,
layout: 'total, prev, pager, next, jumper', layout: 'total, prev, pager, next, jumper',
}, },
contextMenu: {
show: false,
left: '',
top: '',
data: null,
type: 0,
},
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
destroyed() {}, destroyed() {
document.onclick = null;
},
activated() {}, activated() {},
mounted() { mounted() {
document.title = `${this.$t('summaryManage.summaryList')}-MindInsight`; document.title = `${this.$t('summaryManage.summaryList')}-MindInsight`;
...@@ -132,6 +149,10 @@ export default { ...@@ -132,6 +149,10 @@ export default {
methods: { methods: {
init() { init() {
document.onclick = () => {
this.contextMenu.show = false;
};
const params = { const params = {
limit: this.pagination.pageSize, limit: this.pagination.pageSize,
offset: this.pagination.currentPage - 1, offset: this.pagination.currentPage - 1,
...@@ -187,34 +208,74 @@ export default { ...@@ -187,34 +208,74 @@ export default {
* @param {Object} row select row * @param {Object} row select row
*/ */
goToTrainDashboard(row) { goToTrainDashboard(row) {
this.contextMenu.show = false;
const trainId = encodeURIComponent(row.train_id); const trainId = encodeURIComponent(row.train_id);
const routeUrl = this.$router.resolve({ this.$router.push({
path: '/train-manage/training-dashboard', path: '/train-manage/training-dashboard',
query: {id: trainId}, query: {id: trainId},
}); });
window.open(routeUrl.href, '_blank');
}, },
/** /**
* go to Profiler * go to Profiler
* @param {Object} row select row * @param {Object} row select row
*/ */
goToProfiler(row) { goToProfiler(row) {
this.contextMenu.show = false;
const profilerDir = encodeURIComponent(row.profiler_dir); const profilerDir = encodeURIComponent(row.profiler_dir);
const trainId = encodeURIComponent(row.train_id); const trainId = encodeURIComponent(row.train_id);
const path = encodeURIComponent(row.relative_path); const path = encodeURIComponent(row.relative_path);
const router = `/profiling${row.profiler_type === 'gpu' ? '-gpu' : ''}`; const router = `/profiling${row.profiler_type === 'gpu' ? '-gpu' : ''}`;
const routeUrl = this.$router.resolve({ this.$router.push({
path: router, path: router,
query: { query: {
dir: profilerDir, dir: profilerDir,
id: trainId, id: trainId,
path: path, path: path,
summaryPath: row.train_id,
}, },
}); });
window.open(routeUrl.href, '_blank'); },
rightClick(row, event, type) {
this.contextMenu.data = row;
this.contextMenu.type = type;
this.contextMenu.left = event.x + 'px';
this.contextMenu.top = event.y + 'px';
this.contextMenu.show = true;
},
doRightClick(key) {
const row = this.contextMenu.data;
if (!row) {
return;
}
if (this.contextMenu.type) {
this.contextMenu.show = false;
const profilerDir = encodeURIComponent(row.profiler_dir);
const trainId = encodeURIComponent(row.train_id);
const path = encodeURIComponent(row.relative_path);
const router = `/profiling${row.profiler_type === 'gpu' ? '-gpu' : ''}`;
const routeUrl = this.$router.resolve({
path: router,
query: {
dir: profilerDir,
id: trainId,
path: path,
},
});
window.open(routeUrl.href, '_blank');
} else {
this.contextMenu.show = false;
const trainId = encodeURIComponent(row.train_id);
const routeUrl = this.$router.resolve({
path: '/train-manage/training-dashboard',
query: {id: trainId},
});
window.open(routeUrl.href, '_blank');
}
}, },
}, },
components: {}, components: {},
...@@ -282,5 +343,26 @@ export default { ...@@ -282,5 +343,26 @@ export default {
.operate-btn { .operate-btn {
margin-left: 20px; margin-left: 20px;
} }
.menu-item {
color: #00a5a7;
cursor: pointer;
}
#contextMenu {
position: absolute;
min-width: 150px;
border: 1px solid #d4d4d4;
ul {
background-color: #f7faff;
border-radius: 2px;
li {
padding: 5px 18px;
cursor: pointer;
&:hover {
background-color: rgb(167, 167, 167);
color: white;
}
}
}
}
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册