diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index b1ebe9478..2139df236 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -16,8 +16,9 @@ import ( ) const ( - Model_prefix = "aimodels/" - tplModelManageIndex = "repo/modelmanage/index" + Model_prefix = "aimodels/" + tplModelManageIndex = "repo/modelmanage/index" + tplModelManageDownload = "repo/modelmanage/download" ) func SaveModelByParameters(jobId string, name string, version string, label string, description string, userId int64) error { @@ -210,6 +211,7 @@ func ShowSingleModel(ctx *context.Context) { ctx.Data["Dirs"] = models ctx.Data["task"] = task ctx.Data["ID"] = id + ctx.HTML(200, tplModelManageDownload) } @@ -240,7 +242,7 @@ func ShowModelPageInfo(ctx *context.Context) { ctx.Data["Page"] = pager ctx.Data["PageIsCloudBrain"] = true ctx.Data["Tasks"] = modelResult - ctx.HTML(200, tplModelManageIndex) + } func ModifyModel(id string, description string) error { diff --git a/templates/repo/modelmanage/download.tmpl b/templates/repo/modelmanage/download.tmpl new file mode 100644 index 000000000..495e2e371 --- /dev/null +++ b/templates/repo/modelmanage/download.tmpl @@ -0,0 +1,59 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+
+
+

+ {{ range $index, $item := .Path }}{{ $item }}/{{ end }} +

+
+
+
+ +
+
+
+
+ + 下载所有 + + {{if .Dirs}} + + + {{range .Dirs}} + + + + + + {{end}} + +
+ + + + {{if .IsDir}} {{svg "octicon-file-directory" 16}}{{else}}{{svg "octicon-file" 16}}{{end}} {{.FileName}} + + + + + {{.Size | FileSize}} + + + {{.ModTime}} +
+ + {{end}} + +
+
+
+
+
+
+ + + +{{template "base/footer" .}} diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index a60c8fda3..3be22ca9e 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -308,7 +308,7 @@
- + {{$.i18n.Tr "repo.model_download"}}