Browse Source

!953 UI the error message of the image module is optimized

From: @xia_yi_fan1
Reviewed-by: @ouwenchang,@lilongfei15
Signed-off-by: @lilongfei15
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
6d5957cd77
4 changed files with 32 additions and 11 deletions
  1. +2
    -0
      mindinsight/ui/src/locales/en-us.json
  2. +2
    -0
      mindinsight/ui/src/locales/zh-cn.json
  3. +1
    -1
      mindinsight/ui/src/services/fetcher.js
  4. +27
    -10
      mindinsight/ui/src/views/train-manage/image.vue

+ 2
- 0
mindinsight/ui/src/locales/en-us.json View File

@@ -189,6 +189,8 @@
},
"images": {
"titleText": "Image",
"titleTip": "The Image only displays 10 images randomly.",
"imageErrorTip": "The current picture has been updated, Please wait until the data loading is complete.",
"tagSelectTitle": "Tag Selection",
"selectAll": "All",
"open": "More",


+ 2
- 0
mindinsight/ui/src/locales/zh-cn.json View File

@@ -188,6 +188,8 @@
},
"images": {
"titleText": "图像",
"titleTip": "图像可视仅随机展示10张图片。",
"imageErrorTip": "当前图片被更新,请等待数据加载完后再查看。",
"tagSelectTitle": "标签选择",
"open": "展开",
"close": "折叠",


+ 1
- 1
mindinsight/ui/src/services/fetcher.js View File

@@ -46,7 +46,7 @@ axios.interceptors.request.use(
// Add a response interceptor
axios.interceptors.response.use(
function(response) {
if (typeof response.data === 'string') {
if (typeof response.data === 'string' && router.currentRoute.path !== '/train-manage/image') {
const variant = new Date().getTime();
response.data = JSON.parse(
response.data


+ 27
- 10
mindinsight/ui/src/views/train-manage/image.vue View File

@@ -19,6 +19,18 @@ limitations under the License.
<div class="image-bk">
<div class="cl-title cl-image-title">
<div class="cl-title-left">{{$t('images.titleText')}}
<el-tooltip placement="right-start"
effect="light">
<div slot="content"
class="tooltip-container">
<div class="cl-title-tip">
<div class="tip-part">
{{$t('images.titleTip')}}
</div>
</div>
</div>
<i class="el-icon-info"></i>
</el-tooltip>
<div class="path-message">
<span>{{$t('symbols.leftbracket')}}</span>
<span>{{$t('trainingDashboard.summaryDirPath')}}</span>
@@ -392,16 +404,11 @@ export default {
if (e.response && e.response.data && e.response.data.error_code) {
sampleItem.curImgUrl = '';
sampleItem.showErrMsg = true;
sampleItem.errMsg = this.$t('error')[e.response.data.error_code];
} else {
sampleItem.showErrMsg = false;
sampleItem.curImgUrl =
`${basePath}${this.imageBasePath}train_id=${encodeURIComponent(
sampleItem.summaryId,
)}` +
`&tag=${encodeURIComponent(sampleItem.tagName)}&step=${
params.step
}&wt=${params.wt}`;
if (e.response.data.error_code === '5054500D') {
sampleItem.errMsg = this.$t('images.imageErrorTip');
} else {
sampleItem.errMsg = this.$t('error')[e.response.data.error_code];
}
}
},
);
@@ -654,6 +661,16 @@ export default {
font-weight: bold;
vertical-align: bottom;
}
.cl-title-tip {
padding: 10px;
.tip-part {
line-height: 20px;
word-break: normal;
}
}
.el-icon-info {
color: #6c7280;
}
}
}
.title {


Loading…
Cancel
Save