Skip to content

Commit

Permalink
feat: 增加停用图标 (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 authored Jul 20, 2022
1 parent 842f16a commit 76ff132
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions web/writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ <h5 class="portlet__head">备份设置</h5>
{{else}}
{{$v.ProjectName}}
{{end}}
{{if ne $v.Enabled 0}}
<span class="badge badge-pill badge-warning">停用</span>
{{end}}
</a>
{{end}}
</div>
Expand Down Expand Up @@ -86,7 +89,7 @@ <h5 class="portlet__head">备份设置</h5>
<div class="form-group row">
<label for="Enabled_{{$i}}" class="col-sm-2">是否启用</label>
<div class="col-sm-4">
<select class="form-control" name="Enabled" id="Enabled_{{$i}}" value="{{$v.Enabled}}">
<select class="form-control" name="Enabled" id="Enabled_{{$i}}" value="{{$v.Enabled}}" onchange="enabledChange(this)">
<option value="0" {{if eq $v.Enabled 0}}selected{{end}}>启用</option>
<option value="1" {{if eq $v.Enabled 1}}selected{{end}}>停用</option>
</select>
Expand Down Expand Up @@ -298,8 +301,16 @@ <h5 class="portlet__head">对象存储配置</h5>
// projectNameChange
function projectNameChange(that) {
let id = $(that).attr("id").split("_")[1]
console.log($(that).val())
$("#id_"+id).html($(that).val())
let name = $(that).val()
let enabled = $("#Enabled_"+id).val()
$("#id_"+id).html(enabled == 0?name:name+'<span class="badge badge-pill badge-warning">停用</span>')
}
// enabledChange
function enabledChange(that) {
let id = $(that).attr("id").split("_")[1]
let name = $("#ProjectName_"+id).val()
let enabled = $(that).val()
$("#id_"+id).html(enabled == 0?name:name+'<span class="badge badge-pill badge-warning">停用</span>')
}

</script>
Expand Down

0 comments on commit 76ff132

Please sign in to comment.