diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 80fe34ee2..55451be16 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -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) { diff --git a/web_src/js/components/Model.vue b/web_src/js/components/Model.vue index c291c5ffa..b4c61db0f 100644 --- a/web_src/js/components/Model.vue +++ b/web_src/js/components/Model.vue @@ -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 };