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

fix: 解决高级设置CPU和内存限制删除之后安装报错的问题 (#1167)

This commit is contained in:
zhengkunwang223 2023-05-27 23:13:47 +08:00 committed by GitHub
parent ebb9e7a2a0
commit 7cbaa4f63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -158,7 +158,8 @@ const message = {
paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)',
nginxDoc: 'Only supports English case, numbers, and .',
appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_',
conatinerName: 'Supports letters, numbers, underscores, hyphens and dots, cannot end with hyphen- or dot.',
conatinerName:
'Supports letters, numbers, underscores, hyphens and dots, cannot end with hyphen- or dot.1-127',
disableFunction: 'Only support letters and,',
leechExts: 'Only support letters, numbers and,',
},

View File

@ -161,7 +161,7 @@ const message = {
paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)',
nginxDoc: '仅支持英文大小写数字.',
appName: '支持英文数字-和_,长度2-30,并且不能以-_开头和结尾',
conatinerName: '支持字母数字下划线连字符和点,不能以连字符-或点.结尾',
conatinerName: '支持字母数字下划线连字符和点,不能以连字符-或点.结尾,长度1-127',
disableFunction: '仅支持字母和,',
leechExts: '件支持字母数字和,',
},

View File

@ -136,8 +136,8 @@ const rules = ref<FormRules>({
name: [Rules.appName],
params: [],
containerName: [Rules.containerName],
cpuQuota: [checkNumberRange(0, 99999)],
memoryLimit: [checkNumberRange(0, 9999999999)],
cpuQuota: [Rules.requiredInput, checkNumberRange(0, 99999)],
memoryLimit: [Rules.requiredInput, checkNumberRange(0, 9999999999)],
});
const loading = ref(false);
const paramForm = ref<FormInstance>();
@ -188,6 +188,12 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
req.appDetailId = installData.value.appDetailId;
if (req.cpuQuota < 0) {
req.cpuQuota = 0;
}
if (req.memoryLimit < 0) {
req.memoryLimit = 0;
}
loading.value = true;
InstallApp(req)
.then(() => {