diff --git a/dashboard/src/components/AppInstallDialog.vue b/dashboard/src/components/AppInstallDialog.vue index 164e2d577..a0b679abe 100644 --- a/dashboard/src/components/AppInstallDialog.vue +++ b/dashboard/src/components/AppInstallDialog.vue @@ -32,8 +32,19 @@ const dialog = useTemplateRef('dialogHandle'); const locationInput = useTemplateRef('locationInput'); const description = computed(() => marked.parse(manifest.value.description || '')); const domains = ref([]); + const formValid = computed(() => { if (!domain.value) return false; + + if (location.value) { + // label validation + if (location.value.split('.').some(function (p) { return p.length > 63 || p.length < 1; })) return false; + if (location.value.match(/^[A-Za-z0-9-.]+$/) === null) return false; + if (/^[-.]/.test(location.value)) return false; + } + + if (accessRestrictionOption.value === ACL_OPTIONS.RESTRICTED && (accessRestrictionAcl.value.users.length === 0 && accessRestrictionAcl.value.groups.length === 0)) return false; + if (manifest.value.id === PROXY_APP_ID) { try { new URL(upstreamUri.value);