From c56b5ec87bf43245cba94dc92c00b4cba448a74f Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 8 Nov 2021 16:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 8 +++-- templates/repo/modelmanage/download.tmpl | 59 ++++++++++++++++++++++++++++++++ templates/repo/modelmanage/index.tmpl | 2 +- 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 templates/repo/modelmanage/download.tmpl 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 @@