Browse Source

fix issue

tags/v1.22.9.2^2
zhoupzh 3 years ago
parent
commit
928a7b8d21
3 changed files with 56 additions and 13 deletions
  1. +2
    -2
      templates/repo/modelmanage/index.tmpl
  2. +46
    -11
      web_src/js/components/Model.vue
  3. +8
    -0
      web_src/js/features/i18nVue.js

+ 2
- 2
templates/repo/modelmanage/index.tmpl View File

@@ -46,9 +46,9 @@
<div class="repository release dataset-list view">
{{template "repo/header" .}}
<!-- 列表容器 -->
<div class="ui container {{if ne $.MODEL_COUNT 0}}active loader {{end}}" id="loadContainer">
<div class="ui container {{if ne $.MODEL_COUNT 0}}active loader {{end}}" id="loadContainer" >
{{template "base/alert" .}}
<div class="ui two column stackable grid">
<div class="ui two column stackable grid" style="display: none;">
<div class="column">
<div class="ui blue small menu compact selectcloudbrain">
<a class="active item" href="{{.RepoLink}}/modelmanage/show_model">{{$.i18n.Tr "repo.model.list"}}</a>


+ 46
- 11
web_src/js/components/Model.vue View File

@@ -16,7 +16,7 @@
prop="Name"
:label="i18n.model_name"
align="left"
min-width="18%"
min-width="17%"
>
<template slot-scope="scope">
<div class="expand-icon" v-if="scope.row.hasChildren===false">
@@ -26,22 +26,31 @@
<a class="text-over" :href="showinfoHref+scope.row.Name" :title="scope.row.Name">{{ scope.row.Name }}</a>
</template>
</el-table-column>
<el-table-column
prop="Status"
:label="i18n.model_status"
align="center"
min-width="6.5%"
>
<template slot-scope="scope">
<span class="text-over" :title="scope.row.Status_title"> <i style="vertical-align: middle;" :class="scope.row.Status"></i></span>
</template>
</el-table-column>
<el-table-column
prop="Version"
:label="i18n.model_version"
align="center"
min-width="6.5%"
min-width="6%"
>
<template slot-scope="scope">
<span class="text-over" :title="scope.row.Version">{{ scope.row.Version}}</span>
</template>
</el-table-column>
<el-table-column
prop="VersionCount"
:label="i18n.model_version_num"
align="center"
min-width="7.5%"
min-width="7%"
>
<template slot-scope="scope">
<span class="text-over" :title="scope.row.VersionCount">{{ scope.row.VersionCount}}</span>
@@ -52,7 +61,7 @@
prop="Size"
:label="i18n.model_size"
align="center"
min-width="10.5%"
min-width="10%"
>
<template slot-scope="scope">
<span class="text-over">{{ renderSize(scope.row.Size)}}</span>
@@ -62,7 +71,7 @@
prop="EngineName"
:label="i18n.model_egine"
align="center"
min-width="8.5%"
min-width="8%"
>
<template slot-scope="scope">
<span class="text-over" :title="scope.row.EngineName">{{ scope.row.EngineName}}</span>
@@ -72,7 +81,7 @@
prop="ComputeResource"
:label="i18n.model_compute_resource"
align="center"
min-width="10.5%"
min-width="8%"
>
<template slot-scope="scope">
<span class="text-over">{{ scope.row.ComputeResource}}</span>
@@ -101,7 +110,7 @@
</template>
</el-table-column>

<el-table-column :label="i18n.model_operation" min-width="18%" align="center">
<el-table-column :label="i18n.model_operation" min-width="17%" align="center">
<template slot-scope="scope">
<div class="space-around">
<a :style="{visibility:!scope.row.Children ? 'visible':'hidden'}" :class="{'disabled':!scope.row.IsCanOper}" @click="showcreateVue(scope.row.Name,scope.row.Version,scope.row.Label)">{{i18n.model_create_new_ver}}</a>
@@ -153,7 +162,8 @@ export default {
submitId:{},
defaultAvatar:'/user/avatar/Ghost/-1',
defaultAvatarName:'Ghost',
data:''
data:'',
timer:null,
};
},
methods: {
@@ -381,6 +391,7 @@ export default {
}
},
getModelList(){
let countStatus = 0
try {
this.loadNodeMap.clear();
this.$axios.get(location.href+'_api',{
@@ -397,12 +408,33 @@ export default {
this.tableData[i].EngineName = this.getEngineName(this.tableData[i])
this.tableData[i].ComputeResource = TrainTaskInfo.ComputeResource
this.tableData[i].hasChildren = res.data.data[i].VersionCount===1 ? false : true
if(this.tableData[i].Status!==1){
countStatus++
}

switch(this.tableData[i].Status){
case 1:
this.tableData[i].Status = "WAITING"
this.tableData[i].Status_title = this.i18n.model_wait
break
case 2:
this.tableData[i].Status = "FAILED"
this.tableData[i].Status_title = this.i18n.model_failed
break
default:
this.tableData[i].Status = "SUCCEEDED"
this.tableData[i].Status_title = this.i18n.model_success
break
}
}
this.totalNum = res.data.count
if(countStatus===this.tableData.length){
clearInterval(this.timer);
}
// if(res.data.count===1 && res.data.data[0].VersionCount===1){
// location.reload()
// }
})
}).catch((err)=>{console.log(err)})
}catch (e) {
console.log(e)
}
@@ -446,7 +478,9 @@ export default {
},
mounted() {
this.submitId = document.getElementById("submitId")
this.getModelList()
this.timer = setInterval(()=>{
this.getModelList()
}, 3000);
this.url = location.href.split('show_model')[0]
this.submitId.addEventListener("click", this.submit)
this.url_create_newVersion = this.url + 'create_model'
@@ -461,6 +495,7 @@ export default {
},
beforeDestroy() { // 实例销毁之前对点击事件进行解绑
this.submitId.removeEventListener('click', this.submit);
clearInterval(this.timer);
}
};
</script>


+ 8
- 0
web_src/js/features/i18nVue.js View File

@@ -97,6 +97,10 @@ export const i18nVue = {
model_delete: "删除",
model_create_title: "导入新模型",
model_create_version_title: "创建模型新版本",
model_status:"状态",
model_wait:"模型加载中",
model_success:"模型加载成功",
model_failed:"模型加载失败",
},
US: {
computer_vision: "computer vision",
@@ -200,5 +204,9 @@ export const i18nVue = {
model_delete: "Delete",
model_create_title: "Import new model",
model_create_version_title: "Create a new version of the model",
model_status: "Status",
model_wait:"Loading",
model_success:"Success",
model_failed:"Failed",
},
};

Loading…
Cancel
Save