web: Format code files

This commit is contained in:
nemunaire 2026-01-24 19:18:26 +08:00
commit ac9b567025
22 changed files with 964 additions and 459 deletions

View file

@ -15,8 +15,10 @@
}
// Basic IPv4/IPv6 validation
const ipv4Pattern = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
const ipv6Pattern = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
const ipv4Pattern =
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
const ipv6Pattern =
/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
if (!ipv4Pattern.test(ip.trim()) && !ipv6Pattern.test(ip.trim())) {
error = "Please enter a valid IPv4 or IPv6 address (e.g., 192.0.2.1)";
@ -48,7 +50,8 @@
Check IP Blacklist Status
</h1>
<p class="lead text-muted">
Test an IP address against multiple DNS-based blacklists (RBLs) to check its reputation.
Test an IP address against multiple DNS-based blacklists (RBLs) to check its
reputation.
</p>
</div>
@ -103,7 +106,9 @@
</h3>
<ul class="list-unstyled mb-0 small">
{#each $appConfig.rbls as rbl}
<li class="mb-2"><i class="bi bi-arrow-right me-2"></i>{rbl}</li>
<li class="mb-2">
<i class="bi bi-arrow-right me-2"></i>{rbl}
</li>
{/each}
</ul>
</div>
@ -118,7 +123,9 @@
Why Check Blacklists?
</h3>
<p class="small mb-2">
DNS-based blacklists (RBLs) are used by email servers to identify and block spam sources. Being listed can severely impact email deliverability.
DNS-based blacklists (RBLs) are used by email servers to identify
and block spam sources. Being listed can severely impact email
deliverability.
</p>
<p class="small mb-3">
This tool checks your IP against multiple popular RBLs to help you:
@ -128,7 +135,8 @@
<i class="bi bi-arrow-right me-2"></i>Monitor IP reputation
</li>
<li class="mb-1">
<i class="bi bi-arrow-right me-2"></i>Identify deliverability issues
<i class="bi bi-arrow-right me-2"></i>Identify deliverability
issues
</li>
<li class="mb-1">
<i class="bi bi-arrow-right me-2"></i>Take corrective action
@ -146,7 +154,8 @@
Need Complete Email Analysis?
</h3>
<p class="small mb-2">
For comprehensive deliverability testing including DKIM verification, content analysis, spam scoring, and more:
For comprehensive deliverability testing including DKIM verification, content
analysis, spam scoring, and more:
</p>
<a href="/" class="btn btn-sm btn-outline-primary">
<i class="bi bi-envelope-plus me-1"></i>
@ -159,7 +168,9 @@
<style>
.card {
transition: transform 0.2s ease, box-shadow 0.2s ease;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
}
.card:hover {

View file

@ -80,7 +80,8 @@
<!-- Error State -->
<div class="card shadow-sm">
<div class="card-body text-center py-5">
<i class="bi bi-exclamation-triangle text-danger" style="font-size: 4rem;"></i>
<i class="bi bi-exclamation-triangle text-danger" style="font-size: 4rem;"
></i>
<h3 class="h4 mt-4">Check Failed</h3>
<p class="text-muted mb-4">{error}</p>
<button class="btn btn-primary" onclick={analyzeIP}>
@ -98,22 +99,33 @@
<div class="row align-items-center">
<div class="col-md-6 text-center text-md-start mb-3 mb-md-0">
<h2 class="h2 mb-2">
<span class="font-monospace text-truncate">{result.ip}</span>
<span class="font-monospace text-truncate">{result.ip}</span
>
</h2>
{#if result.listed_count === 0}
<div class="alert alert-success mb-0 d-inline-block">
<i class="bi bi-check-circle me-2"></i>
<strong>Not Listed</strong>
<p class="d-inline mb-0 mt-1 small">
This IP address is not listed on any checked blacklists.
This IP address is not listed on any checked
blacklists.
</p>
</div>
{:else}
<div class="alert alert-danger mb-0 d-inline-block">
<i class="bi bi-exclamation-triangle me-2"></i>
<strong>Listed on {result.listed_count} blacklist{result.listed_count > 1 ? "s" : ""}</strong>
<strong
>Listed on {result.listed_count} blacklist{result.listed_count >
1
? "s"
: ""}</strong
>
<p class="mb-0 mt-1 small">
This IP address is listed on {result.listed_count} of {result.checks.length} checked blacklist{result.checks.length > 1 ? "s" : ""}.
This IP address is listed on {result.listed_count} of
{result.checks.length} checked blacklist{result
.checks.length > 1
? "s"
: ""}.
</p>
</div>
{/if}
@ -121,8 +133,8 @@
<div class="offset-md-3 col-md-3 text-center">
<div
class="p-2 rounded text-center summary-card"
class:bg-light={$theme === 'light'}
class:bg-secondary={$theme !== 'light'}
class:bg-light={$theme === "light"}
class:bg-secondary={$theme !== "light"}
>
<GradeDisplay score={result.score} grade={result.grade} />
<small class="text-muted d-block">Blacklist Score</small>
@ -154,23 +166,36 @@
</h3>
{#if result.listed_count === 0}
<p class="mb-3">
<strong>Good news!</strong> This IP address is not currently listed on any of the
checked DNS-based blacklists (RBLs). This indicates a good sender reputation
and should not negatively impact email deliverability.
<strong>Good news!</strong> This IP address is not currently listed
on any of the checked DNS-based blacklists (RBLs). This indicates
a good sender reputation and should not negatively impact email deliverability.
</p>
{:else}
<p class="mb-3">
<strong>Warning:</strong> This IP address is listed on {result.listed_count} blacklist{result.listed_count > 1 ? "s" : ""}.
Being listed can significantly impact email deliverability as many mail servers
<strong>Warning:</strong> This IP address is listed on {result.listed_count}
blacklist{result.listed_count > 1 ? "s" : ""}. Being listed can
significantly impact email deliverability as many mail servers
use these blacklists to filter incoming mail.
</p>
<div class="alert alert-warning">
<h4 class="h6 mb-2">Recommended Actions:</h4>
<ul class="mb-0 small">
<li>Investigate the cause of the listing (compromised system, spam complaints, etc.)</li>
<li>Fix any security issues or stop sending practices that led to the listing</li>
<li>Request delisting from each RBL (check their websites for removal procedures)</li>
<li>Monitor your IP reputation regularly to prevent future listings</li>
<li>
Investigate the cause of the listing (compromised
system, spam complaints, etc.)
</li>
<li>
Fix any security issues or stop sending practices that
led to the listing
</li>
<li>
Request delisting from each RBL (check their websites
for removal procedures)
</li>
<li>
Monitor your IP reputation regularly to prevent future
listings
</li>
</ul>
</div>
{/if}
@ -186,8 +211,8 @@
</h3>
<p class="mb-3">
This blacklist check tests IP reputation only. For comprehensive
deliverability testing including DKIM verification, content analysis,
spam scoring, and DNS configuration:
deliverability testing including DKIM verification, content
analysis, spam scoring, and DNS configuration:
</p>
<a href="/" class="btn btn-primary">
<i class="bi bi-envelope-plus me-2"></i>