Browse Source

add judge.

tags/v1.21.12.1
Gitea 5 years ago
parent
commit
631eedf7d4
1 changed files with 32 additions and 10 deletions
  1. +32
    -10
      templates/repo/cloudbrain/new.tmpl

+ 32
- 10
templates/repo/cloudbrain/new.tmpl View File

@@ -80,6 +80,10 @@
-webkit-transform: scaleY(1.0);
}
}
.inline.required.field.cloudbrain_benchmark {
display: none;
}
</style>

<div id="mask">
@@ -110,25 +114,30 @@

<div class="inline required field" style="{{if .is_benchmark_enabled}}display:block;{{else}}display:none;{{end}}">
<label>任务类型</label>
<input name="job_type" id="cloudbrain_job_type" placeholder="任务类型" value="{{.JobType}}" tabindex="3" autofocus required maxlength="255">
<select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type">
<option name="job_type" value="DEBUG">DEBUG</option>
<option name="job_type" value="BENCHMARK">BENCHMARK</option>
</select>
</div>

<div class="inline required field">
<label>镜像</label>
<select class="ui search dropdown" id="cloudbrain_image" placeholder="选择镜像" style='width:385px' name="image">
{{range .images}}
<option name="image" value="{{.Place}}">{{.PlaceView}}</option>
{{end}}
</select>
{{range .images}}
<option name="image" value="{{.Place}}">{{.PlaceView}}</option>
{{end}}
</select>
</div>

<div class="inline required field">
<label>数据集(只有zip格式的数据集才能发起云脑任务)</label>
<select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment">
{{range .attachments}}
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
{{end}}
</select>
{{range .attachments}}
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
{{end}}
</select>
</div>

<div class="inline required field">
<label>数据集存放路径</label>
<input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
@@ -141,7 +150,7 @@
<label>代码存放路径</label>
<input name="code_path" id="cloudbrain_code_path" value="{{.code_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
</div>
<div class="inline required field" style="{{if .is_benchmark_enabled}}display:block;{{else}}display:none;{{end}}">
<div class="inline required field cloudbrain_benchmark">
<label>benchmark脚本存放路径</label>
<input name="benchmark_path" id="cloudbrain_benchmark_path" value="{{.benchmark_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly">
</div>
@@ -175,4 +184,17 @@
document.getElementById("mask").style.display = "none"
}
}

$('select.dropdown')
.dropdown();

$(function() {
$("#cloudbrain_job_type").change(function() {
if ($(this).val() == 'BENCHMARK') {
$(".cloudbrain_benchmark").show();
} else {
$(".cloudbrain_benchmark").hide();
}
})
})
</script>

Loading…
Cancel
Save