|
@@ -77,7 +77,7 @@
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="300" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-if="isAuth('train:list')" type="text" size="small" :disabled="scope.row.missStatus==7?true:false"
|
|
|
- @click="watch(scope.row.algorithmTrainingId,scope.row.missStatus)">
|
|
|
+ @click="watch(scope.row.algorithmTrainingId,scope.row.missStatus,scope.row.logFile)">
|
|
|
查看
|
|
|
</el-button>
|
|
|
|
|
@@ -135,6 +135,7 @@ export default {
|
|
|
return {
|
|
|
loading:false,
|
|
|
timer:null,
|
|
|
+ logFile: "",
|
|
|
dataForm: {
|
|
|
missName: "",
|
|
|
},
|
|
@@ -153,7 +154,8 @@ export default {
|
|
|
missStatus: null,
|
|
|
classification: [],
|
|
|
publishVisible:false,
|
|
|
- selectAlgParaVisibel:false
|
|
|
+ selectAlgParaVisibel:false,
|
|
|
+ pollingInterval: null, // 存储轮询的定时器
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
@@ -164,6 +166,7 @@ export default {
|
|
|
|
|
|
activated() {
|
|
|
this.getDataList();
|
|
|
+ this.startPolling(); // 进入页面时启动轮询
|
|
|
//定时器
|
|
|
/* this.timer=window.setInterval(()=>{
|
|
|
setTimeout(()=>{
|
|
@@ -181,6 +184,9 @@ export default {
|
|
|
this.timer = null;
|
|
|
}
|
|
|
},
|
|
|
+ deactivated() {
|
|
|
+ this.stopPolling(); // 离开页面时停止轮询
|
|
|
+ },
|
|
|
methods: {
|
|
|
// startInterval() {
|
|
|
// setInterval(() => {
|
|
@@ -200,7 +206,18 @@ export default {
|
|
|
// this.flag = this.flag + 1;
|
|
|
// }, 1000);
|
|
|
// },
|
|
|
+ startPolling() {
|
|
|
+ this.pollingInterval = setInterval(() => {
|
|
|
+ this.getDataList();
|
|
|
+ }, 5000); // 每 5 秒请求一次
|
|
|
+ },
|
|
|
|
|
|
+ stopPolling() {
|
|
|
+ if (this.pollingInterval) {
|
|
|
+ clearInterval(this.pollingInterval);
|
|
|
+ this.pollingInterval = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取数据列表
|
|
|
getDataList() {
|
|
|
this.dataListLoading = true;
|
|
@@ -366,12 +383,13 @@ export default {
|
|
|
this.dataListSelections = val;
|
|
|
},
|
|
|
// 查看
|
|
|
- watch(id,missStatus) {
|
|
|
+ watch(id,missStatus,logFile) {
|
|
|
/* this.newWatchVisible = true;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.newWatch.init(id);
|
|
|
}); */
|
|
|
- this.$router.replace({ path: "/train-watch" ,query:{algorithmTrainingId:id,missStatus:missStatus}});
|
|
|
+ console.log("logFile",logFile);
|
|
|
+ this.$router.replace({ path: "/train-watch" ,query:{algorithmTrainingId:id,missStatus:missStatus,logFile:logFile} });
|
|
|
|
|
|
},
|
|
|
//保存tensorboard文件
|
|
@@ -448,7 +466,8 @@ export default {
|
|
|
algorithmTrainingId:id
|
|
|
}),
|
|
|
}).then(({data})=>{
|
|
|
-
|
|
|
+ console.
|
|
|
+ this.logFile = data.logFile;
|
|
|
});
|
|
|
}else{
|
|
|
this.selectAlgParaVisibel=true;
|
|
@@ -483,6 +502,8 @@ export default {
|
|
|
}),
|
|
|
}).then(({data})=>{
|
|
|
if(data && data.code === 0){
|
|
|
+ console.log("data",data)
|
|
|
+ this.logFile = data.logFile;
|
|
|
Message({
|
|
|
type: 'success',
|
|
|
message: '运行成功',
|