Skip to content

Commit c8fe34a

Browse files
feat: improve target table layout and styling for better readability
1 parent 1b183f0 commit c8fe34a

File tree

1 file changed

+23
-37
lines changed

1 file changed

+23
-37
lines changed

web/index.html

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -176,38 +176,31 @@
176176

177177
.target-table {
178178
width: 100%; border-collapse: collapse; font-size: 0.8125rem;
179-
table-layout: fixed;
179+
table-layout: auto;
180180
}
181-
.target-table col.col-host { width: auto; }
182-
.target-table col.col-latency { width: 72px; }
183-
.target-table col.col-loss { width: 52px; }
184181
.target-table th {
185182
text-align: left; font-size: 0.6875rem; font-weight: 600;
186183
text-transform: uppercase; letter-spacing: 0.05em;
187-
color: var(--muted); padding: 0.5rem 0.625rem;
188-
border-bottom: 1px solid var(--border);
189-
white-space: nowrap; overflow: hidden;
184+
color: var(--muted); padding: 0.4rem 0.5rem;
185+
border-bottom: 1px solid var(--border); white-space: nowrap;
190186
}
191187
.target-table th:not(:first-child) { text-align: right; }
192188
.target-table td {
193-
padding: 0.5rem 0.625rem;
189+
padding: 0.45rem 0.5rem;
194190
border-bottom: 1px solid var(--border);
195-
color: var(--fg); overflow: hidden;
191+
color: var(--fg);
196192
}
197-
.target-table td:not(:first-child) { text-align: right; white-space: nowrap; }
193+
/* Number columns: shrink to content, never wrap */
194+
.target-table td:not(:first-child),
195+
.target-table th:not(:first-child) { width: 1%; white-space: nowrap; text-align: right; }
198196
.target-table tr:last-child td { border-bottom: none; }
199197
.target-table tr:nth-child(even) td { background: var(--table-stripe); }
200198
.target-table .host-cell {
201-
font-weight: 600; display: flex; align-items: center; gap: 0.5rem;
202-
overflow: hidden;
203-
}
204-
.target-table .host-cell span:last-child {
205-
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
199+
font-weight: 600; display: flex; align-items: center; gap: 0.4rem;
206200
}
207201
.target-table .ip-cell {
208202
font-family: 'SF Mono', 'Fira Code', monospace;
209203
font-size: 0.6875rem; color: var(--muted);
210-
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
211204
}
212205
.inline-dot {
213206
width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
@@ -531,7 +524,7 @@ <h2 id="modalTitle">
531524
</div>
532525

533526
<!-- Main grid -->
534-
<div class="flex-1 grid grid-cols-1 lg:grid-cols-[1fr_280px] gap-4 min-h-0 pb-4 lg:pb-0">
527+
<div class="flex-1 grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-4 min-h-0 pb-4 lg:pb-0">
535528

536529
<!-- Left column: metrics + charts -->
537530
<div class="flex flex-col gap-4 min-h-0">
@@ -616,11 +609,6 @@ <h3><span class="chart-dot" style="background:var(--purple)"></span> DNS Resolut
616609
</div>
617610
<div class="overflow-y-auto flex-1">
618611
<table class="target-table" id="targetTable">
619-
<colgroup>
620-
<col class="col-host" />
621-
<col class="col-latency" />
622-
<col class="col-loss" />
623-
</colgroup>
624612
<thead>
625613
<tr>
626614
<th>Host</th>
@@ -640,10 +628,6 @@ <h3><span class="chart-dot" style="background:var(--purple)"></span> DNS Resolut
640628
DNS Lookups
641629
</div>
642630
<table class="target-table" id="dnsTable">
643-
<colgroup>
644-
<col class="col-host" />
645-
<col class="col-latency" />
646-
</colgroup>
647631
<thead>
648632
<tr>
649633
<th>Host</th>
@@ -656,32 +640,33 @@ <h3><span class="chart-dot" style="background:var(--purple)"></span> DNS Resolut
656640

657641
<!-- Quick stats footer -->
658642
<div class="card p-3 flex-shrink-0">
659-
<div class="section-label mb-2">
643+
<div class="section-label mb-3">
660644
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>
661645
24h Summary
662646
</div>
663-
<div class="grid grid-cols-2 gap-y-2 gap-x-4 text-xs">
664-
<div class="flex justify-between">
647+
<div class="flex flex-col gap-1.5 text-xs">
648+
<div class="flex justify-between items-center">
665649
<span style="color:var(--muted)">Uptime</span>
666650
<span class="font-bold" id="qs-uptime"></span>
667651
</div>
668-
<div class="flex justify-between">
652+
<div class="flex justify-between items-center">
669653
<span style="color:var(--muted)">Outages</span>
670654
<span class="font-bold" id="qs-outages"></span>
671655
</div>
672-
<div class="flex justify-between">
673-
<span style="color:var(--muted)">Peak DL</span>
656+
<div style="height:1px;background:var(--border);margin:0.25rem 0"></div>
657+
<div class="flex justify-between items-center">
658+
<span style="color:var(--muted)">Peak Download</span>
674659
<span class="font-bold" id="qs-peak-dl"></span>
675660
</div>
676-
<div class="flex justify-between">
661+
<div class="flex justify-between items-center">
677662
<span style="color:var(--muted)">Min Latency</span>
678663
<span class="font-bold" id="qs-min-lat"></span>
679664
</div>
680-
<div class="flex justify-between">
665+
<div class="flex justify-between items-center">
681666
<span style="color:var(--muted)">Max Latency</span>
682667
<span class="font-bold" id="qs-max-lat"></span>
683668
</div>
684-
<div class="flex justify-between">
669+
<div class="flex justify-between items-center">
685670
<span style="color:var(--muted)">Avg Jitter</span>
686671
<span class="font-bold" id="qs-jitter"></span>
687672
</div>
@@ -741,9 +726,10 @@ <h3><span class="chart-dot" style="background:var(--purple)"></span> DNS Resolut
741726

742727
lastUpdateTime = Date.now();
743728

744-
// Filter to current config only
729+
// Filter to current config only — gateway is excluded from the table
730+
// (it's a local router probe, not an internet connectivity target)
745731
if (cfg) {
746-
const allowedPing = new Set([...cfg.ping_targets.map(h => h.toLowerCase()), "gateway"]);
732+
const allowedPing = new Set(cfg.ping_targets.map(h => h.toLowerCase()));
747733
data.targets = (data.targets || []).filter(t => allowedPing.has(t.host.toLowerCase()));
748734
const allowedDns = new Set(cfg.dns_targets.map(h => h.toLowerCase()));
749735
data.dns = (data.dns || []).filter(d => allowedDns.has(d.host.toLowerCase()));

0 commit comments

Comments
 (0)