From 66bb03a5bb45163ecb458e3d8776af096a217200 Mon Sep 17 00:00:00 2001 From: WeiFeng-mindinsight Date: Tue, 23 Jun 2020 10:34:43 +0800 Subject: [PATCH] UI fix bug of step trace, optimize data-process and profiling-dashboard display --- mindinsight/ui/src/locales/zh-cn.json | 13 +- mindinsight/ui/src/router.js | 7 +- .../src/views/train-manage/data-process.vue | 29 +-- .../ui/src/views/train-manage/operator.vue | 1 + .../train-manage/profiling-dashboard.vue | 19 +- .../ui/src/views/train-manage/step-trace.vue | 167 ++++++++++++------ 6 files changed, 162 insertions(+), 74 deletions(-) diff --git a/mindinsight/ui/src/locales/zh-cn.json b/mindinsight/ui/src/locales/zh-cn.json index 4732668..3999172 100644 --- a/mindinsight/ui/src/locales/zh-cn.json +++ b/mindinsight/ui/src/locales/zh-cn.json @@ -134,7 +134,7 @@ "lessThan": "小于", "applyAllSelectTag": "应用到当前所选标签", "placeHolderNumber": "请输入数值", - "noSpace":"请勿输入空格", + "noSpace": "请勿输入空格", "sameCompare": "不能有相同的比较运算符", "unreasonable": "逻辑不合理", "info": "提示", @@ -318,7 +318,7 @@ "pipelineTopTitle": "算子间队列平均使用率", "pipelineMiddleTitle": "算子间队列关系", "deviceQueueOp": "数据发送", - "deviceQueueOpTip": "前向+后向", + "deviceQueueOpTip": "前向+反向", "getNext": "取数据算子", "connectorQuene": "主机队列", "getData": "数据获取", @@ -356,9 +356,12 @@ "queueTip2": "队列为空比例:", "totalCapacity": "总容量", "averageCapacity": "平均使用容量", - "FPMessage": "FP起始算子:", - "BPMessage": "BP终止算子:", - "approximateTime": "总时长 ≈ " + "FPMessage": "前向起始算子:", + "BPMessage": "反向终止算子:", + "approximateTime": "总时长 ≈ ", + "stepInputTip": "请输入step值(1~{max}的正整数)", + "inputError": "输入参数异常,请输入一个1~{max}的正整数", + "defaultTip": "默认展示平均值" }, "components": { "summaryTitle": "训练选择", diff --git a/mindinsight/ui/src/router.js b/mindinsight/ui/src/router.js index 413253b..27d8f96 100644 --- a/mindinsight/ui/src/router.js +++ b/mindinsight/ui/src/router.js @@ -16,6 +16,10 @@ import Vue from 'vue'; import Router from 'vue-router'; Vue.use(Router); +const VueRouterPush = Router.prototype.push; +Router.prototype.push = function push(to) { + return VueRouterPush.call(this, to).catch((err) => err); +}; export default new Router({ base: process.env.BASE_URL, @@ -77,7 +81,8 @@ export default new Router({ children: [ { path: 'profiling-dashboard', - component: () => import('./views/train-manage/profiling-dashboard.vue'), + component: () => + import('./views/train-manage/profiling-dashboard.vue'), }, { path: 'step-trace', diff --git a/mindinsight/ui/src/views/train-manage/data-process.vue b/mindinsight/ui/src/views/train-manage/data-process.vue index 7289cc2..9fee613 100644 --- a/mindinsight/ui/src/views/train-manage/data-process.vue +++ b/mindinsight/ui/src/views/train-manage/data-process.vue @@ -543,10 +543,13 @@ export default { }; option.dataZoom = [ { - startValue: 0, + start: 0, + end: 100, bottom: 0, }, { + start: 0, + end: 100, type: 'inside', bottom: 0, }, @@ -756,11 +759,10 @@ export default { }, ], dataZoom: [ + {start: 0, end: 100, orient: 'vertical', right: 10}, { - orient: 'vertical', - right: 10, - }, - { + start: 0, + end: 100, type: 'inside', orient: 'vertical', right: 10, @@ -840,13 +842,11 @@ export default { }, dataZoom: [ { - startValue: 0, - bottom: 10, - }, - { - type: 'inside', + start: 0, + end: 100, bottom: 10, }, + {start: 0, end: 100, type: 'inside', bottom: 10}, ], }; echart.setOption(option); @@ -1354,15 +1354,14 @@ export default { height: calc(100% - 25px); } } - .queue-step-wrap.single{ + .queue-step-wrap.single { height: 100%; - .chart-content{ - .chart-wrap{ + .chart-content { + .chart-wrap { width: 100%; } } } - } .pipeline-wrap { height: 100%; @@ -1378,6 +1377,7 @@ export default { #average-rate { height: 100%; min-height: 180px; + overflow: hidden; } } } @@ -1441,6 +1441,7 @@ export default { height: 100%; width: 100%; min-height: 220px; + overflow: hidden; } } .right { diff --git a/mindinsight/ui/src/views/train-manage/operator.vue b/mindinsight/ui/src/views/train-manage/operator.vue index 4d4de16..b06c62a 100644 --- a/mindinsight/ui/src/views/train-manage/operator.vue +++ b/mindinsight/ui/src/views/train-manage/operator.vue @@ -528,6 +528,7 @@ export default { row.op_sort_condition.type, ); } + this.$refs.expandTable.doLayout(); }); } }) diff --git a/mindinsight/ui/src/views/train-manage/profiling-dashboard.vue b/mindinsight/ui/src/views/train-manage/profiling-dashboard.vue index 2f01e7a..7bddd41 100644 --- a/mindinsight/ui/src/views/train-manage/profiling-dashboard.vue +++ b/mindinsight/ui/src/views/train-manage/profiling-dashboard.vue @@ -704,6 +704,21 @@ export default { rowIndex * this.svg.rowHeight + (this.svg.rowHeight - height) / 2; const g = document.createElementNS(this.svg.namespaceURI, 'g'); const gChild = document.createElementNS(this.svg.namespaceURI, 'g'); + let name = ''; + switch (data.name) { + case 'iteration_interval': + name = this.$t('profiling.lterationGap'); + break; + case 'fp_and_bp': + name = this.$t('profiling.deviceQueueOpTip'); + break; + case 'tail': + name = this.$t('profiling.lterationTail'); + break; + default: + name = data.name; + break; + } const rect = document.createElementNS(this.svg.namespaceURI, 'rect'); rect.setAttribute('x', x1); @@ -725,10 +740,10 @@ export default { `overflow:hidden;text-align:center;text-overflow:ellipsis;` + `white-space:nowrap;font-size:12px;line-height:${height}px;color:${color[0]}`, ); - foreignObject.textContent = `${data.name}: ${data.duration.toFixed(4)}ms`; + foreignObject.textContent = `${name}: ${data.duration.toFixed(4)}ms`; const title = document.createElementNS(this.svg.namespaceURI, 'title'); - title.textContent = `${data.name}: ${data.duration.toFixed(4)}ms`; + title.textContent = `${name}: ${data.duration.toFixed(4)}ms`; gChild.appendChild(rect); gChild.appendChild(foreignObject); diff --git a/mindinsight/ui/src/views/train-manage/step-trace.vue b/mindinsight/ui/src/views/train-manage/step-trace.vue index a246e34..89fdd05 100644 --- a/mindinsight/ui/src/views/train-manage/step-trace.vue +++ b/mindinsight/ui/src/views/train-manage/step-trace.vue @@ -16,21 +16,32 @@ limitations under the License.