|
|
|
@@ -1083,20 +1083,9 @@ func ModifyModel(id string, description string) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
func ModifyModelLabel(id string, label string) error { |
|
|
|
err := models.ModifyModelLabel(id, label) |
|
|
|
if err == nil { |
|
|
|
log.Info("modify success.") |
|
|
|
} else { |
|
|
|
log.Info("Failed to modify.id=" + id + " desc=" + label + " error:" + err.Error()) |
|
|
|
} |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
func ModifyModelInfo(ctx *context.Context) { |
|
|
|
log.Info("modify model start.") |
|
|
|
id := ctx.Query("id") |
|
|
|
description := ctx.Query("description") |
|
|
|
re := map[string]string{ |
|
|
|
"code": "-1", |
|
|
|
} |
|
|
|
@@ -1134,12 +1123,11 @@ func ModifyModelInfo(ctx *context.Context) { |
|
|
|
err = models.ModifyLocalModel(id, name, label, description, engine) |
|
|
|
|
|
|
|
} else { |
|
|
|
_, ok := ctx.Req.Form["label"] |
|
|
|
if ok { |
|
|
|
err = ModifyModelLabel(id, ctx.Query("label")) |
|
|
|
} else { |
|
|
|
err = ModifyModel(id, description) |
|
|
|
} |
|
|
|
label := ctx.Query("label") |
|
|
|
description := ctx.Query("description") |
|
|
|
engine := task.Engine |
|
|
|
name := task.Name |
|
|
|
err = models.ModifyLocalModel(id, name, label, description, int(engine)) |
|
|
|
} |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|