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

pull/1173/head
zhengkunwang223 2 years ago committed by GitHub
parent ebb9e7a2a0
commit 7cbaa4f63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,',
},

@ -161,7 +161,7 @@ const message = {
paramUrlAndPort: ' http(s)://(域名/ip):(端口)',
nginxDoc: '.',
appName: '-_,2-30,-_',
conatinerName: '线,-.',
conatinerName: '线,-.,1-127',
disableFunction: ',',
leechExts: ',',
},

@ -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(() => {

Loading…
Cancel
Save