提交 fbbf4542 编写于 作者: X xiayifan

UI modify the error message display mode of the tensor

上级 c7a6d089
......@@ -33,7 +33,7 @@ limitations under the License.
class="grid-item"></div>
</div>
<div class="operate-container"
v-if="(showOperate && fullData.length) || requestError">
v-if="showOperate && (fullData.length || requestError)">
<div class="filter-container"
@keyup.enter="filterChange">
<div v-for="(item, itemIndex) in filterArr"
......@@ -401,7 +401,7 @@ export default {
*/
showRequestErrorMessage(errorMsg, dimension, filterStr) {
this.errorMsg = errorMsg;
if (!this.filterArr.length) {
if (!this.filterArr.length && dimension && filterStr) {
this.initializeFilterArr(dimension, filterStr);
}
this.requestError = true;
......
......@@ -174,7 +174,8 @@
"tensorType": "数据类型:",
"viewTypeTitle": "视图",
"chartViewType": "表格",
"histogramViewType": "直方图"
"histogramViewType": "直方图",
"tensorDashboardLimitErrorMsg": "请求的数据过大,请进入张量页使用其他维度重试。"
},
"graph": {
"titleText": "计算图",
......@@ -420,7 +421,7 @@
"50542217": "Summary日志路径错误",
"50542218": "筛选参数错误",
"50545012": "张量数据不存在,请刷新。",
"50545013": "请求的数据过大,无法返回,请使用其他维度重试。",
"50545013": "请求的数据过大,请使用其他维度重试。",
"50545014": "查询的张量数据已被新数据替换,请刷新。"
}
}
\ No newline at end of file
......@@ -52,17 +52,17 @@ axios.interceptors.response.use(
if (error.response && error.response.data && error.response.data.error_code) {
if (error.response.data.error_code.toString() === '50545005') {
if (error.config.headers.ignoreError ||
router.currentRoute.path === '/train-manage/training-dashboard') {
router.currentRoute.path === '/train-manage/training-dashboard') {
return Promise.reject(error);
}
} else if ( error.response.data.error_code.toString() === '50542216' &&
} else if (error.response.data.error_code.toString() === '50542216' &&
router.currentRoute.path === '/train-manage/training-dashboard') {
return Promise.reject(error);
} else if ( router.currentRoute.path === '/profiling/profiling-dashboard' &&
error.config.headers.ignoreError ) {
} else if (router.currentRoute.path === '/profiling/profiling-dashboard' &&
error.config.headers.ignoreError) {
return Promise.reject(error);
} else if ( error.response.data.error_code.toString() === '50545013' &&
router.currentRoute.path === '/train-manage/tensor') {
} else if (error.response.data.error_code.toString() === '50545013' ||
error.response.data.error_code.toString() === '50545014') {
return Promise.reject(error);
}
if (errorData[error.response.data.error_code]) {
......
......@@ -294,11 +294,11 @@ export default {
this.dataTypeChangeTimer = null;
}
if (this.viewNameChangeTimer) {
this.clearTimeout(this.viewNameChangeTimer);
clearTimeout(this.viewNameChangeTimer);
this.viewNameChangeTimer = null;
}
if (this.axisNameChangeTimer) {
this.clearTimeout(this.axisNameChangeTimer);
clearTimeout(this.axisNameChangeTimer);
this.axisNameChangeTimer = null;
}
},
......@@ -678,15 +678,18 @@ export default {
},
(e) => {
let showLimitError = false;
let errorMsg = '';
if (
e.response &&
e.response.data &&
e.response.data.error_code &&
e.response.data.error_code.toString() === '50545013'
(e.response.data.error_code.toString() === '50545013' ||
e.response.data.error_code.toString() === '50545014')
) {
showLimitError = true;
errorMsg = this.$t('error')[e.response.data.error_code];
}
this.clearMartixData(sampleItem, showLimitError);
this.clearMartixData(sampleItem, showLimitError, errorMsg);
sampleItem.showLoading = false;
},
);
......@@ -695,8 +698,9 @@ export default {
* Clear table display
* @param {Object} sampleItem The object that is being operated
* @param {Boolean} showLimitError Display request error message
* @param {String} errorMsg Error message
*/
clearMartixData(sampleItem, showLimitError) {
clearMartixData(sampleItem, showLimitError, errorMsg) {
sampleItem.curData = [];
sampleItem.newDataFlag = true;
let elementItem = null;
......@@ -706,7 +710,7 @@ export default {
elementItem[0].updateGridData();
if (showLimitError) {
elementItem[0].showRequestErrorMessage(
this.$t('error.50545013'),
errorMsg,
sampleItem.formateData.value.dims,
sampleItem.filterStr,
);
......
......@@ -969,12 +969,31 @@ export default {
}
});
},
() => {
(e) => {
this.tensorData = [];
let showLimitError = false;
let errorMsg = '';
if (
e.response &&
e.response.data &&
e.response.data.error_code &&
(e.response.data.error_code.toString() === '50545013' ||
e.response.data.error_code.toString() === '50545014')
) {
showLimitError = true;
if (e.response.data.error_code.toString() === '50545014') {
errorMsg = this.$t('error')[e.response.data.error_code];
} else {
errorMsg = this.$t('tensors.tensorDashboardLimitErrorMsg');
}
}
this.$nextTick(() => {
const elementItem = this.$refs.tensorChart;
if (elementItem) {
elementItem.updateGridData();
if (showLimitError) {
elementItem.showRequestErrorMessage(errorMsg);
}
}
});
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册