diff --git a/backend/app/dto/request/website.go b/backend/app/dto/request/website.go index 59597e58d..63ad359cb 100644 --- a/backend/app/dto/request/website.go +++ b/backend/app/dto/request/website.go @@ -142,6 +142,7 @@ type WebsitePHPConfigUpdate struct { Params map[string]string `json:"params"` Scope string `json:"scope" validate:"required"` DisableFunctions []string `json:"disableFunctions"` + UploadMaxSize string `json:"uploadMaxSize"` } type WebsitePHPFileUpdate struct { diff --git a/backend/app/dto/response/website.go b/backend/app/dto/response/website.go index 313fb7d77..e8284980f 100644 --- a/backend/app/dto/response/website.go +++ b/backend/app/dto/response/website.go @@ -47,6 +47,7 @@ type WebsiteLog struct { type PHPConfig struct { Params map[string]string `json:"params"` DisableFunctions []string `json:"disableFunctions"` + UploadMaxSize string `json:"uploadMaxSize"` } type NginxRewriteRes struct { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 1c43c9df3..9544faf57 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -1026,6 +1026,10 @@ func (w WebsiteService) GetPHPConfig(id uint) (*response.PHPConfig, error) { res.DisableFunctions = disableFunctions } } + uploadMaxSize := phpConfig.Key("upload_max_filesize").Value() + if uploadMaxSize != "" { + res.UploadMaxSize = uploadMaxSize + } return res, nil } @@ -1089,9 +1093,14 @@ func (w WebsiteService) UpdatePHPConfig(req request.WebsitePHPConfigUpdate) (err return err } } - if req.Scope == "uploadSize" { + if req.Scope == "upload_max_filesize" { postMaxSize := phpConfig.Key("post_max_size") - postMaxSize.SetValue("") + postMaxSize.SetValue(req.UploadMaxSize) + uploadMaxFileSize := phpConfig.Key("upload_max_filesize") + uploadMaxFileSize.SetValue(req.UploadMaxSize) + if err = cfg.SaveTo(phpConfigPath); err != nil { + return err + } } appInstallReq := request.AppInstalledOperate{ diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts index 8932168bd..78a19db1f 100644 --- a/frontend/src/api/interface/website.ts +++ b/frontend/src/api/interface/website.ts @@ -270,6 +270,7 @@ export namespace Website { export interface PHPConfig { params: any; disableFunctions: string[]; + uploadMaxSize: string; } export interface PHPConfigUpdate { @@ -277,6 +278,7 @@ export namespace Website { params?: any; disableFunctions?: string[]; scope: string; + uploadMaxSize?: string; } export interface PHPUpdate { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 38ffe9e06..804dda0e1 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1390,6 +1390,7 @@ const message = { second: 'Second', disableFunction: 'Disable function', disableFunctionHelper: 'Enter the function to be disabled, such as exec, please use multiple, split', + uploadMaxSize: 'Upload limit', }, nginx: { serverNamesHashBucketSizeHelper: 'The hash table size of the server name', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 3a2f3609f..be223e66b 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1371,6 +1371,7 @@ const message = { second: '秒', disableFunction: '禁用函数', disableFunctionHelper: '输入要禁用的函数,例如exec,多个请用,分割', + uploadMaxSize: '上传限制', }, nginx: { serverNamesHashBucketSizeHelper: '服务器名字的hash表大小', diff --git a/frontend/src/views/website/website/config/php/index.vue b/frontend/src/views/website/website/config/php/index.vue index 9f637acbd..6e793f057 100644 --- a/frontend/src/views/website/website/config/php/index.vue +++ b/frontend/src/views/website/website/config/php/index.vue @@ -1,10 +1,13 @@ - + - + + + + @@ -15,6 +18,7 @@ import { GetWebsite } from '@/api/modules/website'; import { computed, onMounted, ref } from 'vue'; import Config from './config/index.vue'; import Function from './function/index.vue'; +import Upload from './upload/index.vue'; const props = defineProps({ id: { diff --git a/frontend/src/views/website/website/config/php/upload/index.vue b/frontend/src/views/website/website/config/php/upload/index.vue new file mode 100644 index 000000000..e829037a6 --- /dev/null +++ b/frontend/src/views/website/website/config/php/upload/index.vue @@ -0,0 +1,89 @@ + + + + + + + + M + + + + + {{ $t('commons.button.save') }} + + + + + + +