Browse Source

fix issue

tags/v1.22.8.1^2
zhoupzh 3 years ago
parent
commit
88b1445080
7 changed files with 130 additions and 185 deletions
  1. +2
    -1
      options/locale/locale_en-US.ini
  2. +2
    -1
      options/locale/locale_zh-CN.ini
  3. +3
    -0
      templates/repo/cloudbrain/inference/new.tmpl
  4. +79
    -133
      templates/repo/cloudbrain/new.tmpl
  5. +1
    -1
      templates/repo/modelarts/inferencejob/new.tmpl
  6. +4
    -1
      templates/repo/modelmanage/convertIndex.tmpl
  7. +39
    -48
      web_src/js/features/cloudrbanin.js

+ 2
- 1
options/locale/locale_en-US.ini View File

@@ -3116,7 +3116,8 @@ dataset_path_rule = The dataset location is stored in the environment variable d
view_sample = View sample
inference_output_path_rule = The inference output path is stored in the environment variable result_url.
model_file_path_rule=The model file location is stored in the environment variable ckpt_url

model_file_postfix_rule = The supported format of the model file is [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt]
model_convert_postfix_rule = The supported format of the model file is [.pth, .pkl, .onnx, .mindir, .ckpt, .pb]
delete_task = Delete task
task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
operate_confirm = confirm


+ 2
- 1
options/locale/locale_zh-CN.ini View File

@@ -3131,7 +3131,8 @@ dataset_path_rule = 数据集位置存储在环境变量data_url中,训练输
view_sample = 查看样例
inference_output_path_rule = 推理输出路径存储在环境变量result_url中。
model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。

model_file_postfix_rule = 模型文件支持的格式为 [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt]
model_convert_postfix_rule = 模型文件支持的格式为 [.pth, .pkl, .onnx, .mindir, .ckpt, .pb]
delete_task = 删除任务
task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。
operate_confirm = 确定操作


+ 3
- 0
templates/repo/cloudbrain/inference/new.tmpl View File

@@ -141,6 +141,9 @@
</div>

</div>
<span >
<i class="question circle icon" data-content="{{.i18n.Tr "cloudbrain.model_file_postfix_rule"}}" data-position="top center" data-variation="inverted mini"></i>
</span>
</div>
<!-- AI引擎 -->


+ 79
- 133
templates/repo/cloudbrain/new.tmpl View File

@@ -1,91 +1,57 @@
{{template "base/head" .}}
<style>
#mask1 {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
filter: alpha(opacity=60);
background-color: rgba(119,119,119,0.8);
z-index: 1000;
display: none;
/* opacity: 0.8;
-moz-opacity: 0.5; */
/* padding-top: 100px; */
color: #000000;
}
#loadingPage1 {
width: 50px;
height: 40px;
text-align: center;
font-size: 10px;
display: block;
}

#loadingPage1 > 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;
}

#loadingPage1 .rect2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}

#loadingPage1 .rect3 {
-webkit-animation-delay: -1s;
animation-delay: -1s;
}

#loadingPage1 .rect4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}

#loadingPage1 .rect5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
/* 遮罩层css效果图 */

#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);
}
}

.inline.required.field.cloudbrain_benchmark {
display: none;
}
@@ -97,24 +63,38 @@
.inline.required.field.cloudbrain_brainscore {
display: none;
}

.icons {
/* position: absolute !important;
right: 150px;
top: 14px;
z-index: 2; */
.loadingWrap{
width: 20%;
height:25%;
border: 1px solid #bbb;
background-color:#fff;
margin:auto;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 20px;
}

</style>

<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 id="mask1">
<div class="loadingWrap">
<div id="loadingPage1">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<div style="margin-top: 10%;font-size: 14px;color:#101010;font-family: SourceHanSansSC-regular;">任务正在准备中,喝杯水回来再看看~</div>
</div>
</div>

<div class="repository">
@@ -287,9 +267,9 @@
</div>
{{template "base/footer" .}}
<script>
console.log({{index $.QueuesDetail "debugt4"}})
let form = document.getElementById('form_id');
$('#messageInfo').css('display', 'none')
document.getElementById("mask").style.display = "block"
function clearValue() {
context = inputs[0]
context.value = ''
@@ -331,7 +311,6 @@
let min_value_task = value_task.toLowerCase()
$("input[name='display_job_name']").attr("value", min_value_task)
document.getElementById("mask").style.display = "block"

}

// 页面加载完毕后遮罩层隐藏
@@ -346,44 +325,11 @@
.dropdown({
placeholder: "选择数据集类别",
})

console.log("=======================")
// $(document).ready(function(){
// let waitNums = $('.cloudbrain-type').data('queue').split('map')[1]
// let test = new Map()
// let waitNumsArray = waitNums.split(' ')
// waitNumsArray.forEach((element,index) => {
// if(index===0){
// test.set(element.slice(1,-2),parseInt(element.slice(-1)))
// }else if(index===waitNumsArray.length-1){
// test.set(element.slice(0,-3),parseInt(element.slice(-2,-1)))
// }else{
// test.set(element.slice(0,-2),parseInt(element.slice(-1)))
// }
// });
// console.log(test)
// $('.ui.search.dropdown.gpu-type').dropdown({
// onChange: function(value, text, $selectedItem) {
// console.log("=-------------",value)
// console.log("=-------------",test.get(value))
// let gpuTypeNums= test.get(value)
// $('#gpu-nums').text("{{.i18n.Tr "repo.wait_count_start"}}"+gpuTypeNums+"{{.i18n.Tr "repo.wait_count_end"}}")

// }
// });
// })

// $('#cloudbrain_image').select2({
// placeholder: "选择镜像"
// });

$(".ui.button.reset").click(function (e) {
e.preventDefault()
$('#cloudbrain_benchmark_category')
.dropdown("clear", true)
})

$(".ui.positive.button.active.all_selected").click(function (e) {
e.preventDefault()
var selected_value = new Array()


+ 1
- 1
templates/repo/modelarts/inferencejob/new.tmpl View File

@@ -141,7 +141,7 @@

</div>
<span >
<i class="question circle icon" data-content="{{.i18n.Tr "cloudbrain.model_file_path_rule"}}" data-position="top center" data-variation="inverted mini"></i>
<i class="question circle icon" data-content="{{.i18n.Tr "cloudbrain.model_file_path_rule"}} {{.i18n.Tr "cloudbrain.model_file_postfix_rule"}}" data-position="top center" data-variation="inverted mini"></i>
</span>
</div>
<!-- AI引擎 -->


+ 4
- 1
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -254,6 +254,10 @@

</div>
</div>
<div data-tooltip="{{.i18n.Tr "cloudbrain.model_convert_postfix_rule"}}" data-inverted="" data-variation="mini">
<i class="question circle icon"></i>
</div>
</div>
<div class="unite min_title inline fields required">
<div class="three wide field right aligned">
@@ -347,7 +351,6 @@
return true;
}
}

$('#submitId').click(function(){
let data={};
data['_csrf']=csrf


+ 39
- 48
web_src/js/features/cloudrbanin.js View File

@@ -404,58 +404,49 @@ export default async function initCloudrain() {
const jobName = this.dataset.jobname;
getModelInfo(repoPath, modelName, versionName, jobName);
});
function debugAgainPost(ID, debugUrl, redirect_to) {
$.ajax({
type: "POST",
url: debugUrl + "restart?redirect_to=" + redirect_to,
data: $("#debugAgainForm-" + ID).serialize(),
success: function (res) {
if (res["WechatRedirectUrl"]) {
window.location.href = res["WechatRedirectUrl"];
} else if (res.result_code === "0") {
if (res.id !== ID) {
location.reload();
} else {
$("#" + ID + "-icon")
.removeClass()
.addClass(res.status);
$("#" + ID + "-text").text(res.status);
$("#ai-debug-" + ID)
.removeClass("blue")
.addClass("disabled");
$("#ai-delete-" + ID)
.removeClass("blue")
.addClass("disabled");
$("#ai-debug-" + ID)
.text(debug_button)
.css("margin", "0 1rem");
}
} else {
$(".alert")
.html(res.error_msg)
.removeClass("alert-success")
.addClass("alert-danger")
.show()
.delay(2000)
.fadeOut();
}
},
error: function (res) {
console.log(res);
},
});
}
function debugAgain(ID, debugUrl, redirect_to) {
if ($("#" + ID + "-text").text() === "RUNNING") {
window.open(debugUrl + "debug");
} else {
$(".ui.mini.modal.debug-again")
.modal({
onApprove: function () {
console.log("-----------");
},
})
.modal("show");
$.ajax({
type: "POST",
url: debugUrl + "restart?redirect_to=" + redirect_to,
data: $("#debugAgainForm-" + ID).serialize(),
success: function (res) {
if (res["WechatRedirectUrl"]) {
window.location.href = res["WechatRedirectUrl"];
} else if (res.result_code === "0") {
if (res.id !== ID) {
location.reload();
} else {
$("#" + ID + "-icon")
.removeClass()
.addClass(res.status);
$("#" + ID + "-text").text(res.status);
$("#ai-debug-" + ID)
.removeClass("blue")
.addClass("disabled");
$("#ai-delete-" + ID)
.removeClass("blue")
.addClass("disabled");
$("#ai-debug-" + ID)
.text(debug_button)
.css("margin", "0 1rem");
}
} else {
$(".alert")
.html(res.error_msg)
.removeClass("alert-success")
.addClass("alert-danger")
.show()
.delay(2000)
.fadeOut();
}
},
error: function (res) {
console.log(res);
},
});
}
}
$(".ui.basic.ai_debug").click(function () {


Loading…
Cancel
Save