1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 限制应用失败情况下启动应用 (#1020)

This commit is contained in:
zhengkunwang223 2023-05-12 22:30:02 +08:00 committed by GitHub
parent 7d08875f95
commit 0157326d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -859,8 +859,8 @@ func (w WebsiteService) OpWebsiteLog(req request.WebsiteLogReq) (*response.Websi
if err != nil {
return nil, err
}
if fileInfo.Size() > 10*1024*1024 {
return nil, buserr.New(constant.ErrFileTooLarge)
if fileInfo.Size() > 10<<20 {
return nil, buserr.New(constant.ErrFileToLarge)
}
fileInfo.Size()
content, err := os.ReadFile(filePath)

View File

@ -89,7 +89,6 @@ var (
ErrLinkPathNotFound = "ErrLinkPathNotFound"
ErrFileIsExit = "ErrFileIsExit"
ErrFileUpload = "ErrFileUpload"
ErrFileTooLarge = "ErrFileTooLarge"
)
// mysql

View File

@ -347,7 +347,7 @@ const buttons = [
openOperate(row, 'start');
},
disabled: (row: any) => {
return row.status === 'Running';
return row.status === 'Running' || row.status === 'Error';
},
},
{