Browse Source

#654

add English version of debug task create page
pull/1649/head
chenyifan01 3 years ago
parent
commit
3f6785cdca
4 changed files with 106 additions and 64 deletions
  1. +21
    -0
      options/locale/locale_en-US.ini
  2. +22
    -1
      options/locale/locale_zh-CN.ini
  3. +35
    -35
      templates/repo/cloudbrain/new.tmpl
  4. +28
    -28
      templates/repo/debugjob/index.tmpl

+ 21
- 0
options/locale/locale_en-US.ini View File

@@ -850,6 +850,8 @@ model_rename=Duplicate model name, please modify model name.
debug=Debug
stop=Stop
delete=Delete
more=More
gpu_type_all=All
model_download=Model Download
submit_image=Submit Image
download=Download
@@ -879,6 +881,8 @@ cloudbrain_status_createtime = Status/Createtime
cloudbrain_status_runtime = Running Time
cloudbrain_jobname_err=Name must start with a lowercase letter or number,can include lowercase letter,number,_ and -,can not end with _, and can be up to 36 characters long.
cloudbrain_query_fail=Failed to query cloudbrain information.
cloudbrain.mirror_tag = Mirror Tag
cloudbrain.mirror_description = Mirror Description

record_begintime_get_err=Can not get the record begin time.
parameter_is_wrong=The input parameter is wrong.
@@ -2796,3 +2800,20 @@ foot.help = help
foot.copyright= Copyright: New Generation Artificial Intelligence Open Source Open Platform (OpenI)
Platform_Tutorial = Tutorial
foot.advice_feedback = Feedback

[cloudbrain]
compute_resource = Computing resources
task_name = Task name
task_type = Task type
gpu_type = GPU type
mirror = Mirror
dataset = Dataset
resource_specification = Resource specification
dataset_storage_path = Dataset storage path
model_storage_path = Model storage path
code_storage_path = Code storage path
benchmark_path = Benchmark script path
snn4imagenet_path = Snn4imagenet script path
brainscore_path = Brainscore script path
start_command = Start command
choose_mirror = select mirror

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

@@ -855,6 +855,8 @@ debug=调试
debug_again=再次调试
stop=停止
delete=删除
more=更多
gpu_type_all=全部
model_download=结果下载
submit_image=提交镜像
download=模型下载
@@ -883,6 +885,8 @@ cloudbrain_status_createtime=状态/创建时间
cloudbrain_status_runtime = 运行时长
cloudbrain_jobname_err=只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。
cloudbrain_query_fail=查询云脑任务失败。
cloudbrain.mirror_tag = 镜像标签
cloudbrain.mirror_description = 镜像描述

record_begintime_get_err=无法获取统计开始时间。
parameter_is_wrong=输入参数错误,请检查输入参数。
@@ -2094,7 +2098,7 @@ team_permission_desc=权限
team_unit_desc=允许访问项目单元
team_unit_disabled=(已禁用)
selected_couse=精选课程
release_course = 发布课程
release_course = 发布课程
all_keywords=全部关键字
all_org_topics=全部
max_selectedPro= 最多可选9个公开项目
@@ -2804,3 +2808,20 @@ foot.help=帮助
foot.copyright= 版权所有:新一代人工智能开源开放平台(OpenI)
Platform_Tutorial=新手指引
foot.advice_feedback = 意见反馈

[cloudbrain]
compute_resource = 计算资源
task_name = 任务名称
task_type = 任务类型
gpu_type = GPU类型
mirror = 镜像
dataset = 数据集
resource_specification = 资源规格
dataset_storage_path = 数据集存放路径
model_storage_path = 模型存放路径
code_storage_path = 代码存放路径
benchmark_path = benchmark脚本存放路径
snn4imagenet_path = snn4imagenet脚本存放路径
brainscore_path = brainscore脚本存放路径
start_command = 启动命令
choose_mirror = 选择镜像

+ 35
- 35
templates/repo/cloudbrain/new.tmpl View File

@@ -1,7 +1,7 @@
{{template "base/head" .}}
<style>
/* 遮罩层css效果图 */
#mask {
position: fixed;
top: 0px;
@@ -18,7 +18,7 @@
color: #000000
}
/* 加载圈css效果图 */
#loadingPage {
margin: 200px auto;
width: 50px;
@@ -27,7 +27,7 @@
font-size: 10px;
display: block;
}
#loadingPage>div {
background-color: green;
height: 100%;
@@ -36,27 +36,27 @@
-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%,
@@ -67,7 +67,7 @@
-webkit-transform: scaleY(1.0)
}
}
@keyframes sk-stretchdelay {
0%,
40%,
@@ -80,7 +80,7 @@
-webkit-transform: scaleY(1.0);
}
}
.inline.required.field.cloudbrain_benchmark {
display: none;
}
@@ -128,7 +128,7 @@
</h3>
<div class="ui attached segment">
<div class="inline required field">
<label>计算资源</label>
<label>{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
<div class="ui blue small menu compact selectcloudbrain">
<a class="active item" href="{{.RepoLink}}/cloudbrain/create">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
@@ -146,12 +146,12 @@
</div>
</div>
<div class="inline required field">
<label>任务名称</label>
<label>{{.i18n.Tr "cloudbrain.task_name"}}</label>
<input name="job_name" id="cloudbrain_job_name" placeholder="任务名称" value="{{.job_name}}" tabindex="3" autofocus required maxlength="255" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div>

<div class="inline required field">
<label>任务类型</label>
<label>{{.i18n.Tr "cloudbrain.task_type"}}</label>
<select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type">
<option name="job_type" value="DEBUG">DEBUG</option>
{{if .is_snn4imagenet_enabled}}
@@ -179,7 +179,7 @@
<input id="store_category" type="hidden" name="get_benchmark_category">

<div class="inline required field">
<label>GPU类型</label>
<label>{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
<select id="cloudbrain_gpu_type" class="ui search dropdown" placeholder="选择GPU类型" style='width:385px' name="gpu_type">
{{range .gpu_types}}
<option value="{{.Queue}}">{{.Value}}</option>
@@ -188,8 +188,8 @@
</div>

<div class="inline required field" style="position: relative;">
<label>镜像</label>
<input type="text" list="cloudbrain_image" placeholder="选择镜像" name="image" required autofocus maxlength="255">
<label>{{.i18n.Tr "cloudbrain.mirror"}}</label>
<input type="text" list="cloudbrain_image" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" name="image" required autofocus maxlength="255">
<i class="times circle outline icon icons" style="visibility: hidden;" onclick="clearValue()"></i>
<datalist class="ui search" id="cloudbrain_image" style='width:385px;' name="image">
{{range .images}}
@@ -202,9 +202,9 @@
</div>

<div class="inline required field">
<label>数据集</label>
<select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment" required>
<label>{{.i18n.Tr "cloudbrain.dataset"}}</label>
<select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment" required>
{{range .attachments}}
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
{{end}}
@@ -212,7 +212,7 @@
</div>

<div class="inline required field">
<label>资源规格</label>
<label>{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
<select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" style='width:385px' name="resource_spec_id">
{{range .resource_specs}}
<option name="resource_spec_id" value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
@@ -221,31 +221,31 @@
</div>

<div class="inline required field">
<label>数据集存放路径</label>
<label>{{.i18n.Tr "cloudbrain.dataset_storage_path"}}</label>
<input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field">
<label>模型存放路径</label>
<label>{{.i18n.Tr "cloudbrain.model_storage_path"}}</label>
<input name="model_path" id="cloudbrain_model_path" value="{{.model_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field">
<label>代码存放路径</label>
<label>{{.i18n.Tr "cloudbrain.code_storage_path"}}</label>
<input name="code_path" id="cloudbrain_code_path" value="{{.code_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field cloudbrain_benchmark">
<label>benchmark脚本存放路径</label>
<label>{{.i18n.Tr "cloudbrain.benchmark_path"}}</label>
<input name="benchmark_path" id="cloudbrain_benchmark_path" value="{{.benchmark_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field cloudbrain_snn4imagenet">
<label>snn4imagenet脚本存放路径</label>
<label>{{.i18n.Tr "cloudbrain.snn4imagenet_path"}}</label>
<input name="snn4imagenet_path" id="cloudbrain_snn4imagenet_path" value="{{.snn4imagenet_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field cloudbrain_brainscore">
<label>brainscore脚本存放路径</label>
<label>{{.i18n.Tr "cloudbrain.brainscore_path"}}</label>
<input name="brainscore_path" id="cloudbrain_brainscore_path" value="{{.brainscore_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field" hidden>
<label>启动命令</label>
<label>{{.i18n.Tr "cloudbrain.start_command"}}</label>
<textarea name="command" rows="10" readonly="readonly">{{.command}}</textarea>
</div>

@@ -259,7 +259,7 @@
</div>
</form>

</div>
</div>
</div>
@@ -293,7 +293,7 @@
let min_value_task = value_task.toLowerCase()
$("input[name='job_name']").attr("value",min_value_task)
document.getElementById("mask").style.display = "block"
}

// 页面加载完毕后遮罩层隐藏
@@ -302,21 +302,21 @@
document.getElementById("mask").style.display = "none"
}
}
$('#cloudbrain_benchmark_category')
.dropdown({
placeholder: "选择数据集类别",
})
})
$('select.dropdown')
.dropdown();

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

$(".ui.button.reset").click(function(e){
e.preventDefault()
$('#cloudbrain_benchmark_category')
@@ -354,4 +354,4 @@
$('#store_category').attr("value", selected_value)
})

</script>
</script>

+ 28
- 28
templates/repo/debugjob/index.tmpl View File

@@ -189,7 +189,7 @@
margin-top: 0.4rem;
display: inline-block;
}
</style>

<!-- 弹窗 -->
@@ -208,10 +208,10 @@
{{template "repo/header" .}}
{{template "base/alert" .}}
<!-- 提示框 -->
<!-- 列表容器 -->
<div class="ui container">
<div class="ui two column stackable grid">
<div class="column">
<div class="ui blue small menu compact selectcloudbrain">
@@ -227,12 +227,12 @@
<div class="default text" style="color: rgba(0,0,0,.87);"></div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="all">全部</div>
<div class="item" data-value="all">{{$.i18n.Tr "repo.gpu_type_all"}}</div>
<div class="item" data-value="CPU/GPU">CPU/GPU</div>
<div class="item" data-value="NPU">NPU</div>
</div>
</div>
{{if .Permission.CanWrite $.UnitTypeCloudBrain}}
{{if .Permission.CanWrite $.UnitTypeCloudBrain}}
<a class="ui green button" href="{{.RepoLink}}/cloudbrain/create">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a>
{{else}}
<a class="ui disabled button">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a>
@@ -272,15 +272,15 @@
<span>{{$.i18n.Tr "repo.modelarts.createtime"}}</span>
</div>
<div class="two wide column text center">
<span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span>
<span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span>
</div>
<div class="one wide column text center">
<span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span>
<span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span>
</div>
<div class="five wide column text center">
<span>{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
</div>
</div>
</div>
</div>
{{range .Tasks}}
<div class="ui grid stackable item">
@@ -313,7 +313,7 @@
{{end}}
</div>
<div class="five wide column text center">
<div class="ui compact buttons">
<div class="ui compact buttons">
<!-- {{if and (ne .Status "WAITING") (ne .JobType "DEBUG")}}
<a class="ui basic button" href="{{$.Link}}/{{.JobID}}/rate" target="_blank">
评分
@@ -344,7 +344,7 @@
{{end}}
{{end}}
</form>
<!-- 停止 -->
<form id="stopForm-{{.JobID}}" style="margin-left:-1px;">
{{$.CsrfTokenHtml}}
@@ -371,11 +371,11 @@
{{$.i18n.Tr "repo.delete"}}
</a>
{{end}}
</form>
</div>
</form>
</div>
<div class="ui compact buttons" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}">
<div class="ui dropdown" id="model_more" style="padding: .58928571em 1.125em .58928571em;">
<div class="text">更多</div>
<div class="text">{{$.i18n.Tr "repo.more"}}</div>
<i class="dropdown icon"></i>
<div class="menu" style="right: auto;">
<div class="item" style="padding: 0 !important;">
@@ -396,7 +396,7 @@
{{end}}
</div>
{{if and (ne .JobType "DEBUG") (eq .Cloudbrain.Type 0)}}
<div class="item" style="padding: 0 !important;">
<div class="item" style="padding: 0 !important;">
<a class="ui basic blue button" href="{{$.RepoLink}}/cloudbrain/{{.JobID}}/rate" target="_blank">
评分
</a>
@@ -408,7 +408,7 @@
</div>
<!-- 镜像列表弹窗 -->
<div id="imageModal" class="modal" style="display: none;">
<div class="modal-content">
<div class="modal-content">
<!-- 表格 -->
<div class="ui form">
<form id="commitImageForm" action="{{$.RepoLink}}/cloudbrain/{{.JobID}}/commit_image" method="post" target="iframeContent">
@@ -417,19 +417,19 @@
<p style="display: inline;">提交任务镜像</p>
<span class="close">&times;</span>
</div>
<div class="ui divider"></div>
<div class="inline required field dis">
<label>镜像标签:</label>
<label> {{$.i18n.Tr "repo.cloudbrain.mirror_tag"}}:</label>
<input name="tag" id="image_tag" tabindex="3" autofocus required maxlength="255" style="width:75%">
</div>
<div class="inline field">
<label class="label_after">镜像描述:</label>
<label class="label_after">{{$.i18n.Tr "repo.cloudbrain.mirror_description"}}:</label>
<textarea name="description" maxlength="255" rows="8" style="width:75%;margin-left: 0.2em;"></textarea>
</div>
<div class="ui divider"></div>
</div>
<div class="ui divider"></div>
<div class="inline field">
<label></label>
<button class="ui green button" onclick="showmask()">
@@ -438,7 +438,7 @@
</div>
</form>
</div>
</div>
</div>
</div>
@@ -483,8 +483,8 @@
let url={{.RepoLink}}
let redirect_to = {{$.Link}}
let getParam=getQueryVariable('debugListType')
let dropdownValue = ['all','',false].includes(getParam)? '全部' : getParam
let dropdownValue = ['all','',false].includes(getParam)? '{{$.i18n.Tr "repo.gpu_type_all"}}' : getParam
// localStorage.setItem('all',location.href)
function getQueryVariable(variable)
{
@@ -505,7 +505,7 @@
})
$('.ui.selection.dropdown').dropdown({
onChange:function(value){
location.href = `${url}/debugjob?debugListType=${value}`
}
})
@@ -565,5 +565,5 @@
}
})
}
</script>
</script>

Loading…
Cancel
Save