mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 21:50:28 +08:00 
			
		
		
		
	开源版本默认每次只能上传20个证书文件
This commit is contained in:
		@@ -24,6 +24,8 @@ func (this *UploadBatchPopupAction) Init() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (this *UploadBatchPopupAction) RunGet(params struct{}) {
 | 
					func (this *UploadBatchPopupAction) RunGet(params struct{}) {
 | 
				
			||||||
 | 
						this.Data["maxFiles"] = this.maxFiles()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.Show()
 | 
						this.Show()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,7 +44,7 @@ func (this *UploadBatchPopupAction) RunPost(params struct {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 限制每次上传的文件数量
 | 
						// 限制每次上传的文件数量
 | 
				
			||||||
	const maxFiles = 10_000
 | 
						var maxFiles = this.maxFiles()
 | 
				
			||||||
	if len(files) > maxFiles {
 | 
						if len(files) > maxFiles {
 | 
				
			||||||
		this.Fail("每次上传最多不能超过" + types.String(maxFiles) + "个文件")
 | 
							this.Fail("每次上传最多不能超过" + types.String(maxFiles) + "个文件")
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -9,7 +9,7 @@
 | 
				
			|||||||
            <td class="title">选择要上传的证书和私钥文件 *</td>
 | 
					            <td class="title">选择要上传的证书和私钥文件 *</td>
 | 
				
			||||||
            <td>
 | 
					            <td>
 | 
				
			||||||
                <input type="file" name="certFiles" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert, application/pkcs8, .key, .pem" multiple="multiple"/>
 | 
					                <input type="file" name="certFiles" accept="application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert, application/pkcs8, .key, .pem" multiple="multiple"/>
 | 
				
			||||||
                <p class="comment">点击后在弹出的文件选择框中支持多选;不用担心文件名和顺序问题,系统会自动匹配。</p>
 | 
					                <p class="comment">点击后在弹出的文件选择框中支持多选;不用担心文件名和顺序问题,系统会自动匹配<span v-if="!teaIsPlus">;免费版本限制每次最多上传{{maxFiles}}个文件</span>。</p>
 | 
				
			||||||
            </td>
 | 
					            </td>
 | 
				
			||||||
        </tr>
 | 
					        </tr>
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user