diff --git a/mindinsight/ui/src/locales/en-us.json b/mindinsight/ui/src/locales/en-us.json index 3aefdaa09fa8ade39c8f86f0cd2d3d58a7f43043..428516552f79350dc888cde86e615f4559ce1991 100644 --- a/mindinsight/ui/src/locales/en-us.json +++ b/mindinsight/ui/src/locales/en-us.json @@ -49,7 +49,8 @@ "dataTraceback": "Dataset Lineage", "comparePlate": "Comparison Dashboard", "disableProfilerTip": "Failed to view profiling because no profiler log is available.", - "hardwareVisual": "Hardware Resources" + "hardwareVisual": "Hardware Resources", + "openNewTab": "Open Link in New Tab" }, "modelTraceback": { "summaryPath": "Summary Path", diff --git a/mindinsight/ui/src/locales/zh-cn.json b/mindinsight/ui/src/locales/zh-cn.json index 94147d25dd06872ce45c0dea5c86166dd85f5206..781389b059dfc8efbbd54690f7190c6a1e0236f9 100644 --- a/mindinsight/ui/src/locales/zh-cn.json +++ b/mindinsight/ui/src/locales/zh-cn.json @@ -49,7 +49,8 @@ "dataTraceback": "数据溯源", "comparePlate": "对比看板", "disableProfilerTip": "无profiler日志,无法查看性能分析", - "hardwareVisual": "硬件资源" + "hardwareVisual": "硬件资源", + "openNewTab": "打开新页签" }, "modelTraceback": { "summaryPath": "训练日志路径", diff --git a/mindinsight/ui/src/store.js b/mindinsight/ui/src/store.js index f7053350a34ea0d427bfd98cb8e86d01562f2c12..d9a98422139be444911cf2ded773abd50cf48a4b 100644 --- a/mindinsight/ui/src/store.js +++ b/mindinsight/ui/src/store.js @@ -29,7 +29,7 @@ export default new Vuex.Store({ // reload time timeReloadValue: localStorage.timeReloadValue ? localStorage.timeReloadValue - : 3, + : 10, // Scheduled hardware reload flag isHardwareTimeReload: localStorage.isHardwareTimeReload === 'false' ? false : true, // hardware reload time diff --git a/mindinsight/ui/src/views/profiling-gpu/profiling.vue b/mindinsight/ui/src/views/profiling-gpu/profiling.vue index 2ebf5fcac99a60fb49801b5d173d53b453a667a3..d4a8eed4e34960e96091655195e0917155c0e7af 100644 --- a/mindinsight/ui/src/views/profiling-gpu/profiling.vue +++ b/mindinsight/ui/src/views/profiling-gpu/profiling.vue @@ -65,7 +65,7 @@ import RequestService from '../../services/request-service'; export default { data() { return { - summaryPath: this.$route.query.summaryPath, + summaryPath: '', tipsArrayList: [ 'step_trace-iter_interval', 'minddata_pipeline-general', @@ -100,6 +100,7 @@ export default { this.curDashboardInfo.query.id = this.$route.query.id; this.curDashboardInfo.query.dir = this.$route.query.dir; this.curDashboardInfo.query.path = this.$route.query.path; + this.summaryPath = decodeURIComponent( this.$route.query.id); this.getDeviceList(); } else { this.curDashboardInfo.query.trainingJobId = ''; diff --git a/mindinsight/ui/src/views/profiling/profiling.vue b/mindinsight/ui/src/views/profiling/profiling.vue index 99d35a337a71fe15f2da26940102ffd416f2c9bc..f261d6f321daf3d81a42298cdb172dd792e32598 100644 --- a/mindinsight/ui/src/views/profiling/profiling.vue +++ b/mindinsight/ui/src/views/profiling/profiling.vue @@ -65,7 +65,7 @@ import RequestService from '../../services/request-service'; export default { data() { return { - summaryPath: this.$route.query.summaryPath, + summaryPath: '', tipsArrayList: [ 'step_trace-iter_interval', 'minddata_pipeline-general', @@ -101,6 +101,7 @@ export default { this.curDashboardInfo.query.id = this.$route.query.id; this.curDashboardInfo.query.dir = this.$route.query.dir; this.curDashboardInfo.query.path = this.$route.query.path; + this.summaryPath = decodeURIComponent( this.$route.query.id); this.getDeviceList(); } else { this.curDashboardInfo.query.trainingJobId = ''; diff --git a/mindinsight/ui/src/views/train-manage/compare-plate.vue b/mindinsight/ui/src/views/train-manage/compare-plate.vue index 6d1669ccfac901486db39d86d143b5d2b69524ff..8471e2f9f09d6827c4a22984eed01a6da153ce69 100644 --- a/mindinsight/ui/src/views/train-manage/compare-plate.vue +++ b/mindinsight/ui/src/views/train-manage/compare-plate.vue @@ -1208,9 +1208,7 @@ export default { this.$store.commit('setIsReload', false); this.isReloading = false; } - if (error.response && error.response.data) { - this.clearAllData(); - } + this.clearAllData(); }, /** diff --git a/mindinsight/ui/src/views/train-manage/summary-manage.vue b/mindinsight/ui/src/views/train-manage/summary-manage.vue index 25f58f1f7c041d491057d6c60d91d65f1b600230..5aef9f9350b517ea6ee418f87fd806687713eb75 100644 --- a/mindinsight/ui/src/views/train-manage/summary-manage.vue +++ b/mindinsight/ui/src/views/train-manage/summary-manage.vue @@ -69,14 +69,15 @@ limitations under the License. :label="$t('summaryManage.operation')" width="240"> @@ -117,11 +125,20 @@ export default { total: 0, layout: 'total, prev, pager, next, jumper', }, + contextMenu: { + show: false, + left: '', + top: '', + data: null, + type: 0, + }, }; }, computed: {}, watch: {}, - destroyed() {}, + destroyed() { + document.onclick = null; + }, activated() {}, mounted() { document.title = `${this.$t('summaryManage.summaryList')}-MindInsight`; @@ -132,6 +149,10 @@ export default { methods: { init() { + document.onclick = () => { + this.contextMenu.show = false; + }; + const params = { limit: this.pagination.pageSize, offset: this.pagination.currentPage - 1, @@ -187,34 +208,74 @@ export default { * @param {Object} row select row */ goToTrainDashboard(row) { + this.contextMenu.show = false; const trainId = encodeURIComponent(row.train_id); - const routeUrl = this.$router.resolve({ + this.$router.push({ path: '/train-manage/training-dashboard', query: {id: trainId}, }); - window.open(routeUrl.href, '_blank'); }, /** * go to Profiler * @param {Object} row select row */ goToProfiler(row) { + 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({ + this.$router.push({ path: router, query: { dir: profilerDir, id: trainId, 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: {}, @@ -282,5 +343,26 @@ export default { .operate-btn { 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; + } + } + } + } }