|
|
@@ -178,9 +178,9 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { getFileNotebook,createNotebook,getCb1Notebook,getCb2Notebook,stopNotebook } from "~/apis/modules/notobook"; |
|
|
|
import { getFileNotebook,createNotebook,getCb1Notebook,getCb2Notebook,getFileInfoNotebook,stopNotebook } from "~/apis/modules/notobook"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
let timerCb1,timerCb2 |
|
|
|
let timerCb1,timerCb2,timerCb3 |
|
|
|
let {AppSubUrl} = window.config |
|
|
|
const finalState = [ |
|
|
|
"STOPPED", |
|
|
@@ -253,27 +253,28 @@ export default { |
|
|
|
if(this.activeLoadFirst){ |
|
|
|
this.loading = true |
|
|
|
} |
|
|
|
getFileNotebook().then((res)=>{ |
|
|
|
if(res.data.code==0){ |
|
|
|
this.notebookInfo = res.data |
|
|
|
}else{ |
|
|
|
Message.error(res.data.message) |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
this.activeLoadFirst = false |
|
|
|
}).catch((err)=>{ |
|
|
|
Message.error(err) |
|
|
|
this.loading = false |
|
|
|
this.activeLoadFirst = false |
|
|
|
}) |
|
|
|
getFileNotebook().then((res)=>{ |
|
|
|
if(res.data.code==0){ |
|
|
|
this.notebookInfo = res.data |
|
|
|
}else{ |
|
|
|
Message.error(res.data.message) |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
this.activeLoadFirst = false |
|
|
|
}).catch((err)=>{ |
|
|
|
Message.error(err) |
|
|
|
this.loading = false |
|
|
|
this.activeLoadFirst = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCb1NotebookInfo(path,id,index){ |
|
|
|
getCb1NotebookInfo(path,id,index,data){ |
|
|
|
getCb1Notebook(path,id).then((res)=>{ |
|
|
|
if(res.status===200){ |
|
|
|
if(res.data.JobStatus==="RUNNING"){ |
|
|
|
this.btnStatus[index]=2 |
|
|
|
this.deubgUrlGpu = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/cloudbrain/${id}/debug` |
|
|
|
this.deubgUrlGpuStop = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/cloudbrain/${id}/stop` |
|
|
|
let fileData = {job_id:id,...data} |
|
|
|
timerCb3 = setInterval(() => { |
|
|
|
setTimeout(this.getFileInfoReadyNotebook(fileData,index), 0) |
|
|
|
}, 10000) |
|
|
|
clearInterval(timerCb1) |
|
|
|
} |
|
|
|
if(finalState.includes(res.data.JobStatus)){ |
|
|
@@ -281,23 +282,56 @@ export default { |
|
|
|
clearInterval(timerCb1) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch((err)=>{ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
clearInterval(timerCb1) |
|
|
|
Message.error(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCb2NotebookInfo(path,id){ |
|
|
|
getCb2NotebookInfo(path,id,data){ |
|
|
|
getCb2Notebook(path,id).then((res)=>{ |
|
|
|
if(res.status===200){ |
|
|
|
if(res.data.JobStatus==="RUNNING"){ |
|
|
|
this.btnStatus[2]=2 |
|
|
|
this.deubgUrlNpu = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${id}/debug` |
|
|
|
this.deubgUrlNpuStop = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${id}/stop` |
|
|
|
clearInterval(timerCb2) |
|
|
|
if(res.data.JobStatus==="RUNNING"){ |
|
|
|
let fileData = {job_id:id,...data} |
|
|
|
timerCb3 = setInterval(() => { |
|
|
|
setTimeout(this.getFileInfoReadyNotebook(fileData,2), 0) |
|
|
|
}, 10000) |
|
|
|
// this.btnStatus[2]=2 |
|
|
|
// this.deubgUrlNpu = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${id}/debug` |
|
|
|
// this.deubgUrlNpuStop = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${id}/stop` |
|
|
|
clearInterval(timerCb2) |
|
|
|
} |
|
|
|
if(finalState.includes(res.data.JobStatus)){ |
|
|
|
this.btnStatus[2] = 0 |
|
|
|
clearInterval(timerCb2) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch((err)=>{ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
clearInterval(timerCb2) |
|
|
|
Message.error(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getFileInfoReadyNotebook(data,index){ |
|
|
|
getFileInfoNotebook(data).then((res)=>{ |
|
|
|
console.log(res) |
|
|
|
if(res.data.code===0){ |
|
|
|
if(index===2){ |
|
|
|
this.btnStatus[2]=2 |
|
|
|
this.deubgUrlNpu = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${data.job_id}/debug?file=${this.fileInfo.owner_name}/${this.fileInfo.project_name}/${this.fileInfo.file}` |
|
|
|
this.deubgUrlNpuStop = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/modelarts/notebook/${data.job_id}/stop` |
|
|
|
}else{ |
|
|
|
this.btnStatus[index]=2 |
|
|
|
this.deubgUrlGpu = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/cloudbrain/${data.job_id}/debug?file=${this.fileInfo.owner_name}/${this.fileInfo.project_name}/${this.fileInfo.file}` |
|
|
|
this.deubgUrlGpuStop = `${AppSubUrl}/${this.fileInfo.sign_name}/${this.notebookInfo.projectName}/cloudbrain/${data.job_id}/stop` |
|
|
|
} |
|
|
|
clearInterval(timerCb3) |
|
|
|
} |
|
|
|
}).catch((err)=>{ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
clearInterval(timerCb3) |
|
|
|
Message.error(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
stopDebug(index){ |
|
|
|
this.btnStatus[index]=3 |
|
|
@@ -323,11 +357,11 @@ export default { |
|
|
|
if(res.data.code===0 && res.status===200){ |
|
|
|
if(index===2){ |
|
|
|
timerCb2 = setInterval(() => { |
|
|
|
setTimeout(this.getCb2NotebookInfo(repoPath,res.data.message), 0) |
|
|
|
setTimeout(this.getCb2NotebookInfo(repoPath,res.data.message,data), 0) |
|
|
|
}, 10000) |
|
|
|
}else{ |
|
|
|
timerCb1 = setInterval(() => { |
|
|
|
setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message,index), 0) |
|
|
|
setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message,index,data), 0) |
|
|
|
}, 10000) |
|
|
|
} |
|
|
|
this.alertCb = false |
|
|
|