Show errored A/AAAA input

This commit is contained in:
Melon 2024-11-19 10:44:23 +00:00
parent 88f2158115
commit 1616ea8be2
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,6 @@
} }
} catch { } catch {
editItem.type = 0; editItem.type = 0;
console.error("Invalid IP address:", value);
} }
} }
</script> </script>
@ -37,4 +36,6 @@
<div>IP address is IPv4</div> <div>IP address is IPv4</div>
{:else if editItem.type === DnsTypeAAAA} {:else if editItem.type === DnsTypeAAAA}
<div>IP address is IPv6</div> <div>IP address is IPv6</div>
{:else}
<div>Invalid IP address</div>
{/if} {/if}

View File

@ -8,7 +8,6 @@ export function dnsFqdn(domain: string): string {
export function dnsSubdomain(value: string): string { export function dnsSubdomain(value: string): string {
let baseDomain = dnsFqdn(get(domainOption)); let baseDomain = dnsFqdn(get(domainOption));
console.log(value, baseDomain, value == baseDomain);
if (value == baseDomain) value = ""; if (value == baseDomain) value = "";
else if (value.endsWith("." + baseDomain)) value = value.substring(0, value.length - baseDomain.length - 1); else if (value.endsWith("." + baseDomain)) value = value.substring(0, value.length - baseDomain.length - 1);

View File

@ -50,7 +50,7 @@
{/if} {/if}
</div> </div>
<PromiseTable value={$table}> <PromiseTable value={table}>
<slot name="headers" slot="headers" /> <slot name="headers" slot="headers" />
<svelte:fragment slot="rows" let:value> <svelte:fragment slot="rows" let:value>