Browse Source

fix issue

tags/v1.21.12.1^2
zhoupzh 3 years ago
parent
commit
4e7b2dd50b
4 changed files with 13 additions and 8 deletions
  1. +1
    -1
      templates/repo/header.tmpl
  2. +9
    -5
      templates/repo/modelmanage/index.tmpl
  3. +2
    -2
      templates/repo/settings/options.tmpl
  4. +1
    -0
      web_src/js/components/Model.vue

+ 1
- 1
templates/repo/header.tmpl View File

@@ -137,7 +137,7 @@
{{svg "octicon-inbox" 16}} {{.i18n.Tr "datasets"}}
</a>
{{end}}
{{if .Permission.CanRead $.UnitTypeDatasets}}
{{if .Permission.CanRead $.UnitTypeModelManage}}
<a class="{{if .isModelManage}}active{{end}} item" href="{{.RepoLink}}/modelmanage/show_model">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M3.741 1.408l18.462 10.154a.5.5 0 0 1 0 .876L3.741 22.592A.5.5 0 0 1 3 22.154V1.846a.5.5 0 0 1 .741-.438zM5 13v6.617L18.85 12 5 4.383V11h5v2H5z"/></svg>
{{.i18n.Tr "repo.model_manager"}}


+ 9
- 5
templates/repo/modelmanage/index.tmpl View File

@@ -28,7 +28,7 @@
<div class="repository release dataset-list view">
{{template "repo/header" .}}
<!-- 列表容器 -->
<div class="ui container">
<div class="ui container active loader" id="loadContainer">
{{template "base/alert" .}}
<div class="ui two column stackable grid ">
<div class="column"></div>
@@ -87,7 +87,7 @@
<div class="content content-padding">
<form id="formId" method="POST" class="ui form">
<div class="ui error message">
<p></p>
<!-- <p>asdasdasd</p> -->
</div>
<input type="hidden" name="_csrf" value="">
<div class="two inline fields ">
@@ -117,7 +117,7 @@

<div class="required inline field" id="modelname">
<label>模型名称</label>
<input style="width: 45%;" id="name" name="Name" required maxlength="25">
<input style="width: 45%;" id="name" name="Name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div>
<div class="required inline field" id="verionname">
<label>模型版本</label>
@@ -177,6 +177,8 @@
$('#choice_model').dropdown('clear')
$('#choice_version').dropdown('clear')
$('.ui.dimmer').css({"background-color":""})
$('.ui.error.message').css('display','none')
}
})
.modal('show')
@@ -200,7 +202,6 @@
}else{
versionArray[1]=String(Number(versionArray[1])+1)
}

versionArray[2]='0'
}else{
versionArray[2]=String(Number(versionArray[2])+1)
@@ -264,6 +265,7 @@
return true
}
$('#submitId').click(function(){
let flag=check()
if(flag){
@@ -277,10 +279,12 @@
$('.ui.modal.second').modal('hide')
window.location.href=location.href
},
error: function (xhr) {
error: function(xhr){
// 隐藏 loading
// 只有请求不正常(状态码不为200)才会执行
console.log("-------------",xhr)
$('.ui.error.message').text(xhr.responseText)
$('.ui.error.message').css('display','block')
},
complete:function(xhr){
$("#mask").css({"display":"none","z-index":"1"})


+ 2
- 2
templates/repo/settings/options.tmpl View File

@@ -158,11 +158,11 @@
<label>{{.i18n.Tr "repo.settings.cloudbrain_desc"}}</label>
</div>
</div>
{{$isCloudBrainEnabled := .Repository.UnitEnabled $.UnitTypeCloudBrain }}
{{$isModelMangeEnabled := .Repository.UnitEnabled $.UnitTypeModelManage }}
<div class="inline field">
<label>{{.i18n.Tr "repo.model_manager"}}</label>
<div class="ui checkbox">
<input class="enable-system" name="enable_model_manager" type="checkbox" {{if $isCloudBrainEnabled}}checked{{end}}>
<input class="enable-system" name="enable_model_manager" type="checkbox" {{if $isModelMangeEnabled}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.model_desc"}}</label>
</div>
</div>


+ 1
- 0
web_src/js/components/Model.vue View File

@@ -261,6 +261,7 @@ export default {
this.$axios.get(location.href+'_api',{
params:this.params
}).then((res)=>{
$("#loadContainer").removeClass("loader")
let TrainTaskInfo
this.tableData = res.data.data
for(let i=0;i<this.tableData.length;i++){


Loading…
Cancel
Save