|
|
|
@@ -8,6 +8,15 @@ |
|
|
|
@closed="handleClose" |
|
|
|
> |
|
|
|
<div class="wrapper"> |
|
|
|
<div v-show="alertCb" class="ui message alert-info"> |
|
|
|
<div style="display: flex;align-items: center;"> |
|
|
|
<i class="ri-information-line" style="font-size: 35px;color: rgba(242, 113, 28, 1);;"></i> |
|
|
|
<div style="text-align: left;margin-left: 1rem;"> |
|
|
|
<div style="font-weight: 600;line-height: 2;">您已经有 <span style="color:rgba(242, 113, 28, 1);">同类任务</span> 正在等待或运行中,请等待任务结束再创建</div> |
|
|
|
<div style="color:#939393">可以在 “<a href="/cloudbrains" target="_blank">个人中心 > 云脑任务</a>” 查看您所有的云脑任务。</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
class="three-resource-type" |
|
|
|
:class="{ active: selectIndex == 0 }" |
|
|
|
@@ -107,7 +116,9 @@ |
|
|
|
<button v-if="btnStatus[2]===0" class="ui green small button" @click="createTask(2)"></i>新建任务3</button> |
|
|
|
<button v-else-if="btnStatus[2]===1"class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>新建任务</button> |
|
|
|
<div v-else> |
|
|
|
<button class="ui small button" style="background-color: #1684fc;">调试</button> |
|
|
|
<button class="ui small button" style="background-color: #1684fc;"> |
|
|
|
<a :href="deubgUrlNpu" target="_blank">调试</a> |
|
|
|
</button> |
|
|
|
<button class="ui small button">停止</button> |
|
|
|
</div> |
|
|
|
<span>当前有个<span style="color: red;">{{waitCount}}</span>任务在排队</span> |
|
|
|
@@ -119,7 +130,9 @@ |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { getFileNotebook,createNotebook,getCb1Notebook,getCb2Notebook } from "~/apis/modules/notobook"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
let timerCb1,timerCb2 |
|
|
|
let {AppSubUrl} = window.config |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@@ -139,6 +152,9 @@ export default { |
|
|
|
firtstStatus:0, |
|
|
|
secondStatus:0, |
|
|
|
thirdStatus:0, |
|
|
|
alertCb:false, |
|
|
|
deubgUrlNpu:'', |
|
|
|
deubgUrlGpu:'', |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@@ -147,6 +163,7 @@ export default { |
|
|
|
this.initSelect = true |
|
|
|
}, |
|
|
|
selectResource(index,type) { |
|
|
|
this.getNotebookInfo() |
|
|
|
if(index==this.selectIndex){ |
|
|
|
return |
|
|
|
} |
|
|
|
@@ -158,6 +175,7 @@ export default { |
|
|
|
this.selectIndex = index; |
|
|
|
this.initSelect = false |
|
|
|
this.waitCount += this.notebookInfo[type] +1 |
|
|
|
this.alertCb = false |
|
|
|
}, |
|
|
|
getNotebookInfo(){ |
|
|
|
getFileNotebook().then((res)=>{ |
|
|
|
@@ -167,19 +185,33 @@ export default { |
|
|
|
this.waitCount = res.data.waitCountGpu |
|
|
|
}else{ |
|
|
|
console.log(res.data.message) |
|
|
|
Message.error(res.data.message) |
|
|
|
} |
|
|
|
}).catch((err)=>{ |
|
|
|
Message.error(err) |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCb1NotebookInfo(path,id){ |
|
|
|
getCb1Notebook(path,id).then((res)=>{ |
|
|
|
console.log(res) |
|
|
|
if(res.status===200){ |
|
|
|
if(res.data.JobStatus==="RUNNING"){ |
|
|
|
this.btnStatus[2]=2 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCb2NotebookInfo(path,id){ |
|
|
|
getCb2Notebook(path,id).then((res)=>{ |
|
|
|
console.log(res) |
|
|
|
if(res.status===200){ |
|
|
|
if(res.data.JobStatus==="RUNNING"){ |
|
|
|
this.btnStatus[2]=2 |
|
|
|
this.deubgUrlNpu = `${AppSubUrl}/${this.fileInfo.owner_name}/${this.fileInfo.project_name}/modelarts/notebook/${id}/` |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
createTask(index){ |
|
|
|
@@ -203,12 +235,16 @@ export default { |
|
|
|
|
|
|
|
}else if(res.data.code===1 && res.status===403){ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
Message.error(res.data.message) |
|
|
|
this.alertCb = true |
|
|
|
} |
|
|
|
}).catch((err)=>{ |
|
|
|
this.btnStatus[index]=0 |
|
|
|
console.log(err) |
|
|
|
Message.error(err) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
@@ -293,6 +329,14 @@ export default { |
|
|
|
); |
|
|
|
border-radius: 5px 5px 0px 0px; |
|
|
|
} |
|
|
|
.alert-info{ |
|
|
|
width: 70%; |
|
|
|
background-color: rgba(242, 113, 28, 0.05); |
|
|
|
border: 1px solid rgb(242, 113, 28); |
|
|
|
border-radius: 5px; |
|
|
|
margin: 0 auto; |
|
|
|
padding-bottom: 10px; |
|
|
|
} |
|
|
|
.three-resource-type { |
|
|
|
width: 70%; |
|
|
|
margin: 0 auto; |
|
|
|
|