Browse Source

提交代码,修改权限控制。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.12.1^2
zouap 3 years ago
parent
commit
5c13e2354a
2 changed files with 24 additions and 2 deletions
  1. +5
    -0
      routers/repo/ai_model_manage.go
  2. +19
    -2
      web_src/js/components/Model.vue

+ 5
- 0
routers/repo/ai_model_manage.go View File

@@ -1129,10 +1129,15 @@ func ModifyModelPrivate(ctx *context.Context) {
}
err = models.ModifyModelPrivate(id, isPrivate)
if err == nil {
re["code"] = "0"
ctx.JSON(200, re)
log.Info("modify success.")
} else {
re["msg"] = err.Error()
ctx.JSON(200, re)
log.Info("Failed to modify.id=" + id + " isprivate=" + fmt.Sprint(isPrivate) + " error:" + err.Error())
}

}

func ModifyModelInfo(ctx *context.Context) {


+ 19
- 2
web_src/js/components/Model.vue View File

@@ -407,8 +407,25 @@ export default {
},
modifyModelStatus(id, name, rowKey,isPrivate) {
let data = {'id':id,'isPrivate':isPrivate,'repo':this.repo};
modifyModelStatus(data);
this.getModelList();
modifyModelStatus(data).then(res => {
res = res.data;
if (res && res.code == '0') {
this.getModelList();
} else {
this.$message({
type: 'error',
message: this.$t('modelManage.infoModificationFailed'),
});
}
}).catch(err => {
console.log(err);
this.$message({
type: 'error',
message: this.$t('modelManage.infoModificationFailed'),
});
});
},
},
deleteModel(id, name, rowKey) {
let row = { cName: name, id: id, rowKey: rowKey };


Loading…
Cancel
Save