From 48e2907426291c03d81542f5a6000d97b4719b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 24 Mar 2023 15:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=BA=90=E7=89=88=E6=9C=AC=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=AF=8F=E6=AC=A1=E5=8F=AA=E8=83=BD=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?20=E4=B8=AA=E8=AF=81=E4=B9=A6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/actions/default/servers/certs/uploadBatchPopup.go | 4 +++- .../actions/default/servers/certs/uploadBatchPopup_ext.go | 8 ++++++++ web/views/@default/servers/certs/uploadBatchPopup.html | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 internal/web/actions/default/servers/certs/uploadBatchPopup_ext.go diff --git a/internal/web/actions/default/servers/certs/uploadBatchPopup.go b/internal/web/actions/default/servers/certs/uploadBatchPopup.go index 9d4eb7ef..68350b5f 100644 --- a/internal/web/actions/default/servers/certs/uploadBatchPopup.go +++ b/internal/web/actions/default/servers/certs/uploadBatchPopup.go @@ -24,6 +24,8 @@ func (this *UploadBatchPopupAction) Init() { } func (this *UploadBatchPopupAction) RunGet(params struct{}) { + this.Data["maxFiles"] = this.maxFiles() + this.Show() } @@ -42,7 +44,7 @@ func (this *UploadBatchPopupAction) RunPost(params struct { } // 限制每次上传的文件数量 - const maxFiles = 10_000 + var maxFiles = this.maxFiles() if len(files) > maxFiles { this.Fail("每次上传最多不能超过" + types.String(maxFiles) + "个文件") return diff --git a/internal/web/actions/default/servers/certs/uploadBatchPopup_ext.go b/internal/web/actions/default/servers/certs/uploadBatchPopup_ext.go new file mode 100644 index 00000000..ba9849e2 --- /dev/null +++ b/internal/web/actions/default/servers/certs/uploadBatchPopup_ext.go @@ -0,0 +1,8 @@ +// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . +//go:build !plus + +package certs + +func (this *UploadBatchPopupAction) maxFiles() int { + return 20 +} diff --git a/web/views/@default/servers/certs/uploadBatchPopup.html b/web/views/@default/servers/certs/uploadBatchPopup.html index 807fce39..154772bf 100644 --- a/web/views/@default/servers/certs/uploadBatchPopup.html +++ b/web/views/@default/servers/certs/uploadBatchPopup.html @@ -9,7 +9,7 @@ 选择要上传的证书和私钥文件 * -

点击后在弹出的文件选择框中支持多选;不用担心文件名和顺序问题,系统会自动匹配。

+

点击后在弹出的文件选择框中支持多选;不用担心文件名和顺序问题,系统会自动匹配;免费版本限制每次最多上传{{maxFiles}}个文件