Improve FCrDNS UI: hide non-matching IPs when match exists
Closes: https://github.com/happyDomain/happydeliver/issues/4
This commit is contained in:
parent
e811d02b3b
commit
a146940a65
1 changed files with 29 additions and 8 deletions
|
|
@ -21,6 +21,11 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
const hasForwardRecords = $derived(ptrForwardRecords && ptrForwardRecords.length > 0);
|
const hasForwardRecords = $derived(ptrForwardRecords && ptrForwardRecords.length > 0);
|
||||||
|
|
||||||
|
let showDifferent = $state(false);
|
||||||
|
const differentCount = $derived(
|
||||||
|
ptrForwardRecords ? ptrForwardRecords.filter((ip) => ip !== senderIp).length : 0,
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if ptrRecords && ptrRecords.length > 0}
|
{#if ptrRecords && ptrRecords.length > 0}
|
||||||
|
|
@ -63,15 +68,31 @@
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<strong>Forward Resolution (A/AAAA):</strong>
|
<strong>Forward Resolution (A/AAAA):</strong>
|
||||||
{#each ptrForwardRecords as ip}
|
{#each ptrForwardRecords as ip}
|
||||||
|
{#if ip === senderIp || !fcrDnsIsValid || showDifferent}
|
||||||
<div class="d-flex gap-2 align-items-center mt-1">
|
<div class="d-flex gap-2 align-items-center mt-1">
|
||||||
{#if senderIp && ip === senderIp}
|
{#if senderIp && ip === senderIp}
|
||||||
<span class="badge bg-success">Match</span>
|
<span class="badge bg-success">Match</span>
|
||||||
{:else}
|
{:else}
|
||||||
<span class="badge bg-warning">Different</span>
|
<span class="badge bg-secondary">Different</span>
|
||||||
{/if}
|
{/if}
|
||||||
<code>{ip}</code>
|
<code>{ip}</code>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
{#if fcrDnsIsValid && differentCount > 0}
|
||||||
|
<div class="mt-1">
|
||||||
|
<button
|
||||||
|
class="btn btn-link btn-sm p-0 text-muted"
|
||||||
|
onclick={() => (showDifferent = !showDifferent)}
|
||||||
|
>
|
||||||
|
{#if showDifferent}
|
||||||
|
Hide other IPs
|
||||||
|
{:else}
|
||||||
|
Show {differentCount} other IP{differentCount > 1 ? 's' : ''} (not the sender)
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if fcrDnsIsValid}
|
{#if fcrDnsIsValid}
|
||||||
<div class="alert alert-success mb-0 mt-2">
|
<div class="alert alert-success mb-0 mt-2">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue