Browse Source

update

pull/655/head
zhoupzh 3 years ago
parent
commit
769b450e43
5 changed files with 160 additions and 69 deletions
  1. +20
    -20
      templates/repo/cloudbrain/index.tmpl
  2. +22
    -22
      templates/repo/modelarts/notebook/index.tmpl
  3. +21
    -21
      templates/repo/modelarts/trainjob/index.tmpl
  4. +95
    -4
      templates/repo/modelarts/trainjob/new.tmpl
  5. +2
    -2
      web_src/less/openi.less

+ 20
- 20
templates/repo/cloudbrain/index.tmpl View File

@@ -357,13 +357,13 @@
{{end}} {{end}}


<!-- 调试 --> <!-- 调试 -->
<a id="model-debug" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug" target="_blank">
<a id="model-debug-{{.JobID}}" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug" target="_blank">
调试 调试
</a> </a>
<form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;"> <form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="stop-model-debug" class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
<a id="stop-model-debug-{{.JobID}}" class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
停止 停止
</a> </a>
</form> </form>
@@ -376,14 +376,14 @@
<!-- 接收结果 --> <!-- 接收结果 -->
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe> <iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe>
<a id="model-image" class="imageBtn ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" value="{{.CanDebug}}">提交镜像</a>
<a id="model-image-{{.JobID}}" class="imageBtn ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" value="{{.CanDebug}}">提交镜像</a>


</div> </div>
<!-- 删除任务 --> <!-- 删除任务 -->
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="model-delete" class="ui compact {{if not .CanDel}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
<a id="model-delete-{{.JobID}}" class="ui compact {{if not .CanDel}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
删除 删除
</a> </a>
</form> </form>
@@ -532,31 +532,31 @@
//} //}
} }
if(status==="RUNNING"){ if(status==="RUNNING"){
$('#model-debug').removeClass('disabled')
$('#model-debug').addClass('blue')
$('#model-image').removeClass('disabled')
$('#model-image').addClass('blue')
$('#model-debug-'+jobID).removeClass('disabled')
$('#model-debug-'+jobID).addClass('blue')
$('#model-image-'+jobID).removeClass('disabled')
$('#model-image-'+jobID).addClass('blue')


} }
if(status!=="RUNNING"){ if(status!=="RUNNING"){
$('#model-debug').removeClass('blue')
$('#model-debug').addClass('disabled')
$('#model-image').removeClass('blue')
$('#model-image').addClass('disabled')
$('#model-debug-'+jobID).removeClass('blue')
$('#model-debug-'+jobID).addClass('disabled')
$('#model-image-'+jobID).removeClass('blue')
$('#model-image-'+jobID).addClass('disabled')


} }
if(status!=="STOPPED" || status!=="FAILED"){ if(status!=="STOPPED" || status!=="FAILED"){
$('#stop-model-debug').removeClass('disabled')
$('#stop-model-debug').addClass('blue')
$('#model-delete').removeClass('red')
$('#model-delete').addClass('disabled')
$('#stop-model-debug-'+jobID).removeClass('disabled')
$('#stop-model-debug-'+jobID).addClass('blue')
$('#model-delete-'+jobID).removeClass('red')
$('#model-delete-'+jobID).addClass('disabled')
} }
if(status=="STOPPED" || status=="FAILED"){ if(status=="STOPPED" || status=="FAILED"){
$('#stop-model-debug').removeClass('blue')
$('#stop-model-debug').addClass('disabled')
$('#model-delete').removeClass('disabled')
$('#model-delete').addClass('red')
$('#stop-model-debug-'+jobID).removeClass('blue')
$('#stop-model-debug-'+jobID).addClass('disabled')
$('#model-delete-'+jobID).removeClass('disabled')
$('#model-delete-'+jobID).addClass('red')
} }
}).fail(function(err) { }).fail(function(err) {
console.log(err); console.log(err);


+ 22
- 22
templates/repo/modelarts/notebook/index.tmpl View File

@@ -254,17 +254,17 @@
<!-- 表头 --> <!-- 表头 -->
<div class="ui grid stackable" style="background: #f0f0f0;;"> <div class="ui grid stackable" style="background: #f0f0f0;;">
<div class="row"> <div class="row">
<div class="five wide column">
<div class="six wide column">
<span style="margin:0 6px">{{$.i18n.Tr "repo.cloudbrain_task"}}</span> <span style="margin:0 6px">{{$.i18n.Tr "repo.cloudbrain_task"}}</span>
</div> </div>
<div class="three wide column"> <div class="three wide column">
<span>{{$.i18n.Tr "repo.cloudbrain_status_createtime"}}</span> <span>{{$.i18n.Tr "repo.cloudbrain_status_createtime"}}</span>
</div> </div>
<div class="one wide column">
<div class="two wide column text center">
<span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span> <span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span>
</div> </div>
<div class="seven wide column text center">
<span style="margin-left: 10rem;">{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
<div class="five wide column text center">
<span style="margin-left: 5rem;">{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
</div> </div>


</div> </div>
@@ -278,7 +278,7 @@
<div class="row"> <div class="row">
<!-- 任务名 --> <!-- 任务名 -->
<div class="five wide column">
<div class="six wide column">
<a class="title" href="{{$.Link}}/{{.JobID}}" title="{{.JobName}}" style="font-size: 15px;"> <a class="title" href="{{$.Link}}/{{.JobID}}" title="{{.JobName}}" style="font-size: 15px;">
<span class="fitted" style="vertical-align: middle;">{{svg "octicon-tasklist" 16}}</span> <span class="fitted" style="vertical-align: middle;">{{svg "octicon-tasklist" 16}}</span>
<span class="fitted" style="width: 90%;vertical-align: middle;margin-left: 0.4rem;">{{.JobName}}</span> <span class="fitted" style="width: 90%;vertical-align: middle;margin-left: 0.4rem;">{{.JobName}}</span>
@@ -297,7 +297,7 @@
<span style="font-size: 12px;margin-left: 0.4rem;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> <span style="font-size: 12px;margin-left: 0.4rem;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span>
</div> </div>


<div class="one wide column">
<div class="two wide column text center">
{{if .User.Name}} {{if .User.Name}}
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a> <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a>
{{else}} {{else}}
@@ -305,17 +305,17 @@
{{end}} {{end}}
</div> </div>


<div class="seven wide column text right">
<div class="five wide column text right">
<div class="ui compact buttons"> <div class="ui compact buttons">
<!-- <a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}"> <!-- <a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}">
查看 查看
</a> --> </a> -->
<a id="model-debug" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug" target="_blank">
<a id="model-debug-{{.JobID}}" style="margin-right: 2rem;" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug" target="_blank">
调试 调试
</a> </a>
<form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;"> <form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="stop-model-debug" class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
<a id="stop-model-debug-{{.JobID}}" style="margin-right: 2rem;" class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
停止 停止
</a> </a>
</form> </form>
@@ -336,7 +336,7 @@
<!-- 删除任务 --> <!-- 删除任务 -->
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="model-delete" class="ui compact {{if eq .Status "RUNNING"}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
<a id="model-delete-{{.JobID}}" class="ui compact {{if eq .Status "RUNNING"}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
删除 删除
</a> </a>
</form> </form>
@@ -445,27 +445,27 @@
//} //}
} }
if(status==="RUNNING"){ if(status==="RUNNING"){
$('#model-debug').removeClass('disabled')
$('#model-debug').addClass('blue')
$('#model-debug-'+jobID).removeClass('disabled')
$('#model-debug-'+jobID).addClass('blue')


} }
if(status!=="RUNNING"){ if(status!=="RUNNING"){
$('#model-debug').removeClass('blue')
$('#model-debug').addClass('disabled')
$('#model-debug-'+jobID).removeClass('blue')
$('#model-debug-'+jobID).addClass('disabled')


} }
if(status!=="STOPPED" || status!=="FAILED"){ if(status!=="STOPPED" || status!=="FAILED"){
$('#stop-model-debug').removeClass('disabled')
$('#stop-model-debug').addClass('blue')
$('#model-delete').removeClass('red')
$('#model-delete').addClass('disabled')
$('#stop-model-debug-'+jobID).removeClass('disabled')
$('#stop-model-debug-'+jobID).addClass('blue')
$('#model-delete-'+jobID).removeClass('red')
$('#model-delete-'+jobID).addClass('disabled')
} }
if(status=="STOPPED" || status=="FAILED"){ if(status=="STOPPED" || status=="FAILED"){
$('#stop-model-debug').removeClass('blue')
$('#stop-model-debug').addClass('disabled')
$('#model-delete').removeClass('disabled')
$('#model-delete').addClass('red')
$('#stop-model-debug-'+jobID).removeClass('blue')
$('#stop-model-debug-'+jobID).addClass('disabled')
$('#model-delete-'+jobID).removeClass('disabled')
$('#model-delete-'+jobID).addClass('red')
} }
}).fail(function(err) { }).fail(function(err) {
console.log(err); console.log(err);


+ 21
- 21
templates/repo/modelarts/trainjob/index.tmpl View File

@@ -286,11 +286,11 @@
<div class="three wide column"> <div class="three wide column">
<span>{{$.i18n.Tr "repo.cloudbrain_status_runtime"}}</span> <span>{{$.i18n.Tr "repo.cloudbrain_status_runtime"}}</span>
</div> </div>
<div class="one wide column">
<div class="one wide column text center">
<span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span> <span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span>
</div> </div>
<div class="four wide column text center"> <div class="four wide column text center">
<span style="margin-left: 10rem;">{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
<span>{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
</div> </div>


</div> </div>
@@ -329,13 +329,13 @@
{{.Status}} {{.Status}}
</span> --> </span> -->
<span id="model-duration">{{.TrainJobDuration}}</span>
<span>{{.TrainJobDuration}}</span>
<!-- 任务创建时间 --> <!-- 任务创建时间 -->
<!-- <span style="font-size: 12px;margin-left: 0.4rem;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> --> <!-- <span style="font-size: 12px;margin-left: 0.4rem;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> -->
</div> </div>


<div class="one wide column">
<div class="one wide column text center">
{{if .User.Name}} {{if .User.Name}}
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a> <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a>
{{else}} {{else}}
@@ -353,14 +353,14 @@
</a> --> </a> -->
<form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;"> <form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="stop-model-debug" class="ui basic {{if ne .Status "RUNNING"}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
<a id="stop-model-debug-{{.JobID}}" class="ui basic {{if or (eq .Status "KILLED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
停止 停止
</a> </a>
</form> </form>
</div> </div>
<div class="ui compact buttons" style="margin-right:10px;"> <div class="ui compact buttons" style="margin-right:10px;">
<!-- 模型下载 --> <!-- 模型下载 -->
<a id="stop-model-debug" class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank">
<a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank">
模型下载 模型下载
</a> </a>
@@ -372,7 +372,7 @@
<!-- 删除任务 --> <!-- 删除任务 -->
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a id="model-delete" class="ui compact {{if eq .Status "RUNNING" }}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
<a id="model-delete-{{.JobID}}" class="ui compact {{if eq .Status "RUNNING" }}disabled {{else}}red {{end}}button" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
删除 删除
</a> </a>
</form> </form>
@@ -493,8 +493,8 @@
//} //}
} }
if(status==="RUNNING"){ if(status==="RUNNING"){
$('#model-debug').removeClass('disabled')
$('#model-debug').addClass('blue')
$('#model-debug-'+jobID).removeClass('disabled')
$('#model-debug-'+jobID).addClass('blue')
// let TrainDuration = runtime(time) // let TrainDuration = runtime(time)
// $('#model-duration').text(TrainDuration) // $('#model-duration').text(TrainDuration)


@@ -502,21 +502,21 @@


} }
if(status!=="RUNNING"){ if(status!=="RUNNING"){
$('#model-debug').removeClass('blue')
$('#model-debug').addClass('disabled')
$('#model-debug-'+jobID).removeClass('blue')
$('#model-debug-'+jobID).addClass('disabled')


} }
if(status!=="STOPPED" || status!=="FAILED"){
$('#stop-model-debug').removeClass('disabled')
$('#stop-model-debug').addClass('blue')
$('#model-delete').removeClass('red')
$('#model-delete').addClass('disabled')
if(status!=="KILLED" || status!=="FAILED"){
$('#stop-model-debug-'+jobID).removeClass('disabled')
$('#stop-model-debug-'+jobID).addClass('blue')
$('#model-delete-'+jobID).removeClass('red')
$('#model-delete-'+jobID).addClass('disabled')
} }
if(status=="STOPPED" || status=="FAILED"){
$('#stop-model-debug').removeClass('blue')
$('#stop-model-debug').addClass('disabled')
$('#model-delete').removeClass('disabled')
$('#model-delete').addClass('red')
if(status=="KILLED" || status=="FAILED"){
$('#stop-model-debug-'+jobID).removeClass('blue')
$('#stop-model-debug-'+jobID).addClass('disabled')
$('#model-delete-'+jobID).removeClass('disabled')
$('#model-delete-'+jobID).addClass('red')
} }
}).fail(function(err) { }).fail(function(err) {
console.log(err); console.log(err);


+ 95
- 4
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -49,12 +49,98 @@
text-align: center; text-align: center;
color: #C2C7CC;" color: #C2C7CC;"
} }
#mask {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
filter: alpha(opacity=60);
background-color: #777;
z-index: 1000;
display: none;
opacity: 0.8;
-moz-opacity: 0.5;
padding-top: 100px;
color: #000000
}
/* 加载圈css效果图 */
#loadingPage {
margin: 200px auto;
width: 50px;
height: 40px;
text-align: center;
font-size: 10px;
display: block;
}
#loadingPage>div {
background-color: green;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
animation: sk-stretchdelay 1.2s infinite ease-in-out;
}
#loadingPage .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
#loadingPage .rect3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
#loadingPage .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
#loadingPage .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
@-webkit-keyframes sk-stretchdelay {
0%,
40%,
100% {
-webkit-transform: scaleY(0.4)
}
20% {
-webkit-transform: scaleY(1.0)
}
}
@keyframes sk-stretchdelay {
0%,
40%,
100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
}
20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}


</style> </style>
<div class="ui page dimmer">
<!-- <div class="ui page dimmer">
<div class="ui text loader">{{.i18n.Tr "loading"}}</div> <div class="ui text loader">{{.i18n.Tr "loading"}}</div>
</div> -->
<div id="mask">
<div id="loadingPage">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div> </div>

<div class="repository"> <div class="repository">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui container"> <div class="ui container">
@@ -412,14 +498,19 @@
} }
}, },
onSuccess: function(){ onSuccess: function(){
$('.ui.page.dimmer').dimmer('show')
// $('.ui.page.dimmer').dimmer('show')
document.getElementById("mask").style.display = "block"
}, },
onFailure: function(e){ onFailure: function(e){
return false; return false;
} }
}) })
} }

document.onreadystatechange = function() {
if (document.readyState === "complete") {
document.getElementById("mask").style.display = "none"
}
}
function send_run_para(){ function send_run_para(){
var run_parameters = [] var run_parameters = []
var msg = {} var msg = {}


+ 2
- 2
web_src/less/openi.less View File

@@ -227,12 +227,12 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;}
.STOPPED, .KILLED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -459px -52px;} .STOPPED, .KILLED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -459px -52px;}
.RUNNING{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -478px -52px;} .RUNNING{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -478px -52px;}
.i-bg-orange{background-position: -495px -51px;} .i-bg-orange{background-position: -495px -51px;}
.FAILED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -532px -52px;}
.FAILED,.START_FAILED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -532px -52px;}
.i-bg-green{background-position: -441px -52px;} .i-bg-green{background-position: -441px -52px;}
.i-bg-used{background-position: -514px -52px;} .i-bg-used{background-position: -514px -52px;}
.icon-bind{background-position: -550px -52px;} .icon-bind{background-position: -550px -52px;}
.icon-unbind{background-position: -568px -52px;} .icon-unbind{background-position: -568px -52px;}
.CREATING, .STOPPING, .DELETING, .STARTING, .WAITING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;}
.CREATING, .STOPPING, .DELETING, .STARTING, .WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;}


.COMPLETED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;} .COMPLETED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;}
.text_over{ .text_over{


Loading…
Cancel
Save