提交 e81ca340 编写于 作者: P ph

Merge branch 'phdev' of gitee.com:panhui3/mindinsight into phdev

...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
"50545001": "API 路由资源不存在", "50545001": "API 路由资源不存在",
"50545002": "请求API的HTTP方法错误", "50545002": "请求API的HTTP方法错误",
"50545005": "训练作业不存在或不在缓存中", "50545005": "训练作业不存在",
"50545006": "Summary日志路径无效", "50545006": "Summary日志路径无效",
"50545007": "Summary数据正在被加载,请等待Summary数据加载结束", "50545007": "Summary数据正在被加载,请等待Summary数据加载结束",
"50545009": "查询的节点不在图中", "50545009": "查询的节点不在图中",
......
...@@ -845,7 +845,7 @@ export default { ...@@ -845,7 +845,7 @@ export default {
this.initOver = true; this.initOver = true;
this.fileSearchBox.value = tags.length ? tags[0] : ''; this.fileSearchBox.value = tags.length ? tags[0] : '';
this.queryGraphData(); this.queryGraphData();
} else if(!hasFileSearchValue) { } else if (!hasFileSearchValue) {
this.fileSearchBox.value = ''; this.fileSearchBox.value = '';
} }
}) })
......
...@@ -257,7 +257,7 @@ export default { ...@@ -257,7 +257,7 @@ export default {
if (this.isTimeReload) { if (this.isTimeReload) {
this.autoUpdateSamples(); this.autoUpdateSamples();
} }
this.updateAllData(); this.updateAllData(false);
} }
}, },
/** /**
...@@ -274,7 +274,10 @@ export default { ...@@ -274,7 +274,10 @@ export default {
this.stopUpdateSamples(); this.stopUpdateSamples();
} }
}, },
timeReloadValue(newVal) { /**
*The refresh time is changed
*/
timeReloadValue() {
this.autoUpdateSamples(); this.autoUpdateSamples();
}, },
}, },
...@@ -295,6 +298,10 @@ export default { ...@@ -295,6 +298,10 @@ export default {
mounted() { mounted() {
this.getCharMainContentwidth(); this.getCharMainContentwidth();
this.getTagAndRunList(); this.getTagAndRunList();
// Automatic refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}, },
methods: { methods: {
...@@ -371,11 +378,6 @@ export default { ...@@ -371,11 +378,6 @@ export default {
// Obtains data on the current page // Obtains data on the current page
this.getCurPageDataArr(); this.getCurPageDataArr();
// Automatic refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}, this.requestErrorCallback) }, this.requestErrorCallback)
.catch((e) => { .catch((e) => {
this.$message.error(this.$t('public.dataError')); this.$message.error(this.$t('public.dataError'));
...@@ -445,8 +447,13 @@ export default { ...@@ -445,8 +447,13 @@ export default {
]; ];
} }
this.$forceUpdate(); this.$forceUpdate();
}) }, (e) => {
.catch((e) => {}); sampleItem.totalStepNum = 0;
sampleItem.sliderValue = 0;
sampleItem.curStep = '';
sampleItem.curImgUrl = '';
sampleItem.curTime = '';
}).catch((e) => {});
}); });
}, },
/** /**
...@@ -880,13 +887,14 @@ export default { ...@@ -880,13 +887,14 @@ export default {
}, },
/** /**
* Update all data. * Update all data.
* @param {Boolean} ignoreError whether ignore error tip
*/ */
updateAllData() { updateAllData(ignoreError) {
const params = { const params = {
plugin_name: 'image', plugin_name: 'image',
train_id: this.trainingJobId, train_id: this.trainingJobId,
}; };
RequestService.getSingleTrainJob(params, true) RequestService.getSingleTrainJob(params, ignoreError)
.then((res) => { .then((res) => {
if (this.isReloading) { if (this.isReloading) {
this.$store.commit('setIsReload', false); this.$store.commit('setIsReload', false);
...@@ -927,7 +935,7 @@ export default { ...@@ -927,7 +935,7 @@ export default {
} }
this.autoUpdateTimer = setInterval(() => { this.autoUpdateTimer = setInterval(() => {
this.$store.commit('clearToken'); this.$store.commit('clearToken');
this.updateAllData(); this.updateAllData(true);
}, this.timeReloadValue * 1000); }, this.timeReloadValue * 1000);
}, },
/** /**
......
...@@ -564,7 +564,11 @@ export default { ...@@ -564,7 +564,11 @@ export default {
ajaxArr.push(this.addAjax(params, yIndex)); ajaxArr.push(this.addAjax(params, yIndex));
}); });
Promise.all(ajaxArr) Promise.all(ajaxArr.map(function(promiseItem) {
return promiseItem.catch(function(err) {
return err;
});
}))
.then((res) => { .then((res) => {
if (!res) { if (!res) {
return; return;
......
...@@ -268,7 +268,7 @@ export default { ...@@ -268,7 +268,7 @@ export default {
if (this.isTimeReload) { if (this.isTimeReload) {
this.autoUpdateSamples(); this.autoUpdateSamples();
} }
this.updateAllData(); this.updateAllData(false);
} }
}, },
/** /**
...@@ -285,15 +285,8 @@ export default { ...@@ -285,15 +285,8 @@ export default {
} }
}, },
timeReloadValue(newVal) { timeReloadValue() {
if (this.autoUpdateTimer) { this.autoUpdateSamples();
clearInterval(this.autoUpdateTimer);
this.autoUpdateTimer = null;
}
this.autoUpdateTimer = setInterval(() => {
this.$store.commit('clearToken');
this.updateAllData();
}, newVal * 1000);
}, },
}, },
destroyed() { destroyed() {
...@@ -343,6 +336,11 @@ export default { ...@@ -343,6 +336,11 @@ export default {
this.getScalarsList(); this.getScalarsList();
this.firstNum = 1; this.firstNum = 1;
// auto refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}); });
}, },
methods: { methods: {
...@@ -436,11 +434,6 @@ export default { ...@@ -436,11 +434,6 @@ export default {
// Refresh the chart data on the current page // Refresh the chart data on the current page
this.freshCurPageData(); this.freshCurPageData();
} }
// auto refresh
if (this.isTimeReload) {
this.autoUpdateSamples();
}
}, this.requestErrorCallback) }, this.requestErrorCallback)
.catch((e) => { .catch((e) => {
this.$message.error(this.$t('public.dataError')); this.$message.error(this.$t('public.dataError'));
...@@ -506,22 +499,28 @@ export default { ...@@ -506,22 +499,28 @@ export default {
promiseArr.push(this.addPromise(params)); promiseArr.push(this.addPromise(params));
Promise.all(promiseArr) Promise.all(promiseArr.map(function(promiseItem) {
return promiseItem.catch(function(err) {
return err;
});
}))
.then((res) => { .then((res) => {
// error // error
if (!res || !res.length) { if (!res || !res.length) {
return; return;
} }
if (sampleObject.charObj) {
sampleObject.charObj.showLoading();
}
let scalarIndex = 0; let scalarIndex = 0;
let hasInvalidData = false; let hasInvalidData = false;
for (let i = 0; i < res.length; i++) { for (let i = 0; i < res.length; i++) {
if (!res[i] || !res[i].data) { if (!res[i] || !res[i].data) {
sampleObject.charObj.clear();
return; return;
} }
if (sampleObject.charObj) {
sampleObject.charObj.showLoading();
}
const resData = res[i].data; const resData = res[i].data;
const tempObject = { const tempObject = {
...@@ -1519,14 +1518,15 @@ export default { ...@@ -1519,14 +1518,15 @@ export default {
/** /**
* Updating Sliding Block Data * Updating Sliding Block Data
* @param {Boolean} ignoreError whether ignore error tip
*/ */
updateAllData() { updateAllData(ignoreError) {
const params = { const params = {
plugin_name: 'scalar', plugin_name: 'scalar',
train_id: this.trainingJobId, train_id: this.trainingJobId,
}; };
RequestService.getSingleTrainJob(params, true) RequestService.getSingleTrainJob(params, ignoreError)
.then((res) => { .then((res) => {
if (this.isReloading) { if (this.isReloading) {
this.$store.commit('setIsReload', false); this.$store.commit('setIsReload', false);
...@@ -1600,7 +1600,7 @@ export default { ...@@ -1600,7 +1600,7 @@ export default {
} }
this.autoUpdateTimer = setInterval(() => { this.autoUpdateTimer = setInterval(() => {
this.$store.commit('clearToken'); this.$store.commit('clearToken');
this.updateAllData(); this.updateAllData(true);
}, this.timeReloadValue * 1000); }, this.timeReloadValue * 1000);
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册