mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
refactor(settings): move app settings to panel [EE-5503] (#9043)
This commit is contained in:
parent
4f04fe54a7
commit
c7756f3018
19 changed files with 477 additions and 201 deletions
15
app/react/components/form-components/validate-url.ts
Normal file
15
app/react/components/form-components/validate-url.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
export function isValidUrl(
|
||||
value: string | undefined,
|
||||
additionalCheck: (url: URL) => boolean = () => true
|
||||
) {
|
||||
if (!value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
const url = new URL(value);
|
||||
return additionalCheck(url);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue