Add a score to DNS

This commit is contained in:
nemunaire 2025-10-22 14:06:18 +07:00
commit abfd1f0155
6 changed files with 143 additions and 5 deletions

View file

@ -3,16 +3,24 @@
interface Props {
dnsResults?: DNSResults;
dnsScore?: number;
}
let { dnsResults }: Props = $props();
let { dnsResults, dnsScore }: Props = $props();
</script>
<div class="card shadow-sm">
<div class="card-header bg-white">
<h4 class="mb-0">
<i class="bi bi-diagram-3 me-2"></i>
DNS Records
<h4 class="mb-0 d-flex justify-content-between align-items-center">
<span>
<i class="bi bi-diagram-3 me-2"></i>
DNS Records
</span>
{#if dnsScore !== undefined}
<span class="badge bg-secondary">
{dnsScore}%
</span>
{/if}
</h4>
</div>
<div class="card-body">

View file

@ -36,6 +36,20 @@
{#if summary}
<div class="row g-3 text-start">
<div class="col-md-6 col-lg">
<div class="p-2 bg-light rounded text-center">
<strong
class="fs-2"
class:text-success={summary.dns_score >= 100}
class:text-warning={summary.dns_score < 100 &&
summary.dns_score >= 50}
class:text-danger={summary.dns_score < 50}
>
{summary.dns_score}%
</strong>
<small class="text-muted d-block">DNS</small>
</div>
</div>
<div class="col-md-6 col-lg">
<div class="p-2 bg-light rounded text-center">
<strong

View file

@ -148,7 +148,10 @@
{#if report.dns_results}
<div class="row mb-4" id="dns">
<div class="col-12">
<DnsRecordsCard dnsResults={report.dns_results} />
<DnsRecordsCard
dnsResults={report.dns_results}
dnsScore={report.summary?.dns_score}
/>
</div>
</div>
{/if}