diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index 6a252502a..e3d41542a 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -108,11 +108,11 @@ const checkVolumeName = (rule: any, value: any, callback: any) => { const checkLinuxName = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { - callback(new Error(i18n.global.t('commons.rule.linuxName', ['/\\:*?"<>|']))); + callback(new Error(i18n.global.t('commons.rule.linuxName', ['/\\:*?\'"<>|']))); } else { - const reg = /^((?!\\|\/|:|\*|\?|<|>|\||'|%).){1,30}$/; + const reg = /^[^/\\\"'|<>?*]{1,30}$/; if (!reg.test(value) && value !== '') { - callback(new Error(i18n.global.t('commons.rule.linuxName', ['/\\:*?"<>|']))); + callback(new Error(i18n.global.t('commons.rule.linuxName', ['/\\:*?\'"<>|']))); } else { callback(); } @@ -186,6 +186,19 @@ const checkParamUrlAndPort = (rule: any, value: any, callback: any) => { } }; +const checkPort = (rule: any, value: any, callback: any) => { + if (value === '' || typeof value === 'undefined' || value == null) { + callback(new Error(i18n.global.t('commons.rule.port'))); + } else { + const reg = /^([1-9](\d{0,3}))$|^([1-5]\d{4})$|^(6[0-4]\d{3})$|^(65[0-4]\d{2})$|^(655[0-2]\d)$|^(6553[0-5])$/; + if (!reg.test(value) && value !== '') { + callback(new Error(i18n.global.t('commons.rule.port'))); + } else { + callback(); + } + } +}; + const checkDoc = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { callback(new Error(i18n.global.t('commons.rule.nginxDoc'))); @@ -343,10 +356,7 @@ export const Rules: CommonRule = { paramPort: { required: true, trigger: 'blur', - min: 1, - max: 65535, - type: 'number', - message: i18n.global.t('commons.rule.port'), + validator: checkPort, }, paramExtUrl: { required: true, diff --git a/frontend/src/views/app-store/detail/params/index.vue b/frontend/src/views/app-store/detail/params/index.vue index b112bd947..b1fe98281 100644 --- a/frontend/src/views/app-store/detail/params/index.vue +++ b/frontend/src/views/app-store/detail/params/index.vue @@ -9,7 +9,7 @@ :disabled="p.disabled" > { em('close', false); }; +const changeType = (type: string) => { + if (type == 'deployemnt') { + if (appInstalles.value && appInstalles.value.length > 0) { + website.value.appInstallId = appInstalles.value[0].id; + console.log(website.value); + } + } else { + website.value.appInstallId = undefined; + } + website.value.type = type; +}; + const searchAppInstalled = () => { GetAppInstalled({ type: 'website', unused: true }).then((res) => { appInstalles.value = res.data;