{{if eq .JobType "DEBUG"}}
{{end}}
@@ -228,7 +230,7 @@
+ data-jobid="{{$JobID}}" data-bootfile="{{.BootFile}}">
{{$.i18n.Tr "repo.stop"}}
@@ -236,7 +238,7 @@
+ data-jobid="{{$JobID}}" data-version="{{.VersionName}}" data-bootfile="{{.BootFile}}">
{{$.i18n.Tr "repo.stop"}}
{{end}}
diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js
index 5a95dfe6c..e6166ab7c 100644
--- a/web_src/js/features/cloudrbanin.js
+++ b/web_src/js/features/cloudrbanin.js
@@ -24,6 +24,8 @@ export default async function initCloudrain() {
const repoPath = job.dataset.repopath;
// const computeResource = job.dataset.resource
const versionname = job.dataset.version;
+ const bootfile = job.dataset.bootfile;
+ console.log("bootfile---",bootfile)
const status_text = $(`#${ID}-text`).text();
const finalState = [
"STOPPED",
@@ -99,11 +101,16 @@ export default async function initCloudrain() {
"SUCCEEDED",
].includes(status)
) {
- $("#ai-debug-" + ID)
- .removeClass("disabled")
- .addClass("blue")
- .text(debug_again_button)
- .css("margin", "0");
+ if (!bootfile) {
+ $("#ai-debug-" + ID)
+ .removeClass("disabled")
+ .addClass("blue")
+ .text(debug_again_button)
+ .css("margin", "0");
+ } else {
+ $("#ai-debug-" + ID).remove()
+ }
+
}
if (["RUNNING", "WAITING"].includes(status)) {
$("#ai-stop-" + ID)
@@ -289,7 +296,8 @@ export default async function initCloudrain() {
assertDelete(this);
}
});
- function stopDebug(ID, stopUrl) {
+ function stopDebug(ID, stopUrl,bootFile) {
+ console.log("---------=-=-=-==--===")
$.ajax({
type: "POST",
url: stopUrl,
@@ -301,11 +309,15 @@ export default async function initCloudrain() {
.addClass(res.status);
$("#" + ID + "-text").text(res.status);
if (res.status === "STOPPED") {
- $("#ai-debug-" + ID)
- .removeClass("disabled")
- .addClass("blue")
- .text(debug_again_button)
- .css("margin", "0");
+ if (!bootFile) {
+ $("#ai-debug-" + ID)
+ .removeClass("disabled")
+ .addClass("blue")
+ .text(debug_again_button)
+ .css("margin", "0");
+ } else {
+ $("#ai-debug-" + ID).remove()
+ }
$("#ai-image-" + ID)
.removeClass("blue")
.addClass("disabled");
@@ -344,7 +356,8 @@ export default async function initCloudrain() {
$(".ui.basic.ai_stop").click(function () {
const ID = this.dataset.jobid;
const repoPath = this.dataset.repopath;
- stopDebug(ID, repoPath);
+ const bootFile = this.dataset.bootfile
+ stopDebug(ID, repoPath,bootFile);
});
function stopVersion(version_name, ID, repoPath) {
diff --git a/web_src/vuepages/pages/notebook/debug/index.vue b/web_src/vuepages/pages/notebook/debug/index.vue
index 793e44a0f..c2b36ce67 100644
--- a/web_src/vuepages/pages/notebook/debug/index.vue
+++ b/web_src/vuepages/pages/notebook/debug/index.vue
@@ -200,8 +200,8 @@ export default {
},
methods: {
handleClose(done) {
- console.log("close")
this.initSelect = true
+ this.alertCb = false
},
selectResource(index) {
this.getNotebookInfo()
@@ -244,7 +244,6 @@ export default {
},
getCb2NotebookInfo(path,id){
getCb2Notebook(path,id).then((res)=>{
- console.log(res)
if(res.status===200){
if(res.data.JobStatus==="RUNNING"){
this.btnStatus[2]=2
@@ -257,32 +256,23 @@ export default {
},
stopDebug(index){
this.btnStatus[index]=3
- if(index===2){
- stopNotebook(this.deubgUrlNpuStop).then((res)=>{
- console.log(res)
- if(res.data.result_code==='0'){
- this.btnStatus[index]=0
- Message.success("停止任务成功")
- }else{
- Message.error(res.data.error_msg)
- }
- })
- }else{
- stopNotebook(this.deubgUrlGpuStop).then((res)=>{
- console.log(res)
- })
- }
+ let url = index===2 ? this.deubgUrlNpuStop :this.deubgUrlGpuStop
+ stopNotebook(url).then((res)=>{
+ if(res.data.result_code==='0'){
+ this.btnStatus[index]=0
+ Message.success("停止任务成功")
+ }else{
+ Message.error(res.data.error_msg)
+ }
+ })
},
createTask(index){
this.btnStatus[index]=1
const data = {type:index,...this.fileInfo}
let repoPath = `repos/${this.fileInfo.owner_name}/${this.fileInfo.project_name}`
createNotebook(data).then((res)=>{
- console.log("=========",res)
if(res.data.code===0 && res.status===200){
- // this.btnStatus[index]=2
if(index===2){
- console.log("index",index)
timerCb2 = setInterval(() => {
setTimeout(this.getCb2NotebookInfo(repoPath,res.data.message), 0)
}, 10000)
@@ -296,10 +286,12 @@ export default {
}else if(res.data.code===1 && res.status===403){
this.btnStatus[index]=0
+ }else if(res.data.code==2){
+ this.btnStatus[index]=0
+ this.alertCb = true
}else{
this.btnStatus[index]=0
Message.error(res.data.message)
- this.alertCb = true
}
}).catch((err)=>{
this.btnStatus[index]=0
@@ -332,14 +324,11 @@ export default {
},
mounted() {
this.getNotebookInfo()
- // this.dialogVisible = true
- console.log("-----------aaaaa--");
const selfData = document.querySelector('#__vue-self-data')
this.fileInfo.file = selfData.getAttribute('data-file')
this.fileInfo.branch_name = selfData.getAttribute('data-branch')
this.fileInfo.owner_name = selfData.getAttribute('data-owner')
this.fileInfo.project_name = selfData.getAttribute('data-project')
- console.log(this.fileInfo)
let that = this;
document
.querySelector("#notebook-debug")