Skip to content

Commit d015036

Browse files
committed
Updates
1 parent 71b4eaf commit d015036

2 files changed

Lines changed: 181 additions & 14 deletions

File tree

lib/asrfacet_rb/web/web_assets/dashboard.css

Lines changed: 162 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
--sidebar-w: 300px;
2727
--drawer-w: 370px;
2828
--topbar-h: 92px;
29+
--card-pad: 16px;
2930
}
3031

3132
*,
@@ -90,9 +91,9 @@ button {
9091

9192
.app-main {
9293
min-width: 0;
93-
padding: 20px 24px 32px;
94+
padding: 16px 20px 28px;
9495
display: grid;
95-
gap: 18px;
96+
gap: 14px;
9697
}
9798

9899
.shell-card {
@@ -122,7 +123,7 @@ button {
122123
.app-topbar,
123124
.hero-band,
124125
.view-panel .shell-card {
125-
padding: 16px;
126+
padding: var(--card-pad);
126127
}
127128

128129
.sidebar-brand {
@@ -183,6 +184,11 @@ button {
183184
gap: 10px;
184185
}
185186

187+
.link-grid.report-grid {
188+
display: grid;
189+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
190+
}
191+
186192
.button {
187193
border-radius: 12px;
188194
padding: 10px 14px;
@@ -220,6 +226,8 @@ button {
220226
color: var(--txt2);
221227
display: grid;
222228
gap: 4px;
229+
position: relative;
230+
overflow: hidden;
223231
}
224232

225233
.nav-item:hover,
@@ -229,6 +237,22 @@ button {
229237
color: var(--txt);
230238
}
231239

240+
.nav-item::before {
241+
content: "";
242+
position: absolute;
243+
inset: 10px auto 10px 0;
244+
width: 3px;
245+
border-radius: 999px;
246+
background: transparent;
247+
transition: background 0.18s ease, box-shadow 0.18s ease;
248+
}
249+
250+
.nav-item.active::before,
251+
.nav-item:hover::before {
252+
background: linear-gradient(180deg, var(--r0), rgba(255, 26, 26, 0.10));
253+
box-shadow: 0 0 14px rgba(255, 26, 26, 0.30);
254+
}
255+
232256
.nav-label {
233257
font-size: 1rem;
234258
font-weight: 700;
@@ -287,8 +311,9 @@ button {
287311
.session-list {
288312
display: grid;
289313
gap: 10px;
290-
max-height: 46vh;
314+
max-height: 50vh;
291315
overflow-y: auto;
316+
padding-right: 4px;
292317
}
293318

294319
.session-tools,
@@ -320,7 +345,9 @@ button {
320345
background: rgba(255, 26, 26, 0.03);
321346
color: var(--txt2);
322347
display: grid;
323-
gap: 10px;
348+
gap: 8px;
349+
position: relative;
350+
overflow: hidden;
324351
}
325352

326353
.session-card.active,
@@ -329,6 +356,19 @@ button {
329356
background: rgba(255, 26, 26, 0.08);
330357
}
331358

359+
.session-card::before {
360+
content: "";
361+
position: absolute;
362+
inset: 0 auto 0 0;
363+
width: 4px;
364+
background: rgba(255, 26, 26, 0.10);
365+
}
366+
367+
.session-card.active::before,
368+
.session-card:hover::before {
369+
background: linear-gradient(180deg, var(--r0), rgba(255, 26, 26, 0.12));
370+
}
371+
332372
.session-card strong {
333373
color: var(--txt);
334374
font-size: 1rem;
@@ -380,6 +420,9 @@ button {
380420
.app-topbar {
381421
justify-content: space-between;
382422
align-items: stretch;
423+
position: sticky;
424+
top: 16px;
425+
z-index: 20;
383426
}
384427

385428
.topbar-main {
@@ -432,6 +475,10 @@ button {
432475
grid-template-columns: 1.1fr 0.9fr;
433476
gap: 18px;
434477
align-items: stretch;
478+
background:
479+
linear-gradient(90deg, rgba(255, 26, 26, 0.06), transparent 45%),
480+
linear-gradient(180deg, rgba(255, 26, 26, 0.05), rgba(255, 26, 26, 0.02)),
481+
rgba(14, 2, 2, 0.92);
435482
}
436483

437484
.hero-grid,
@@ -462,10 +509,11 @@ button {
462509

463510
.summary-grid {
464511
margin-top: 14px;
512+
grid-template-columns: repeat(5, minmax(0, 1fr));
465513
}
466514

467515
.summary-tile strong {
468-
font-size: 1.4rem;
516+
font-size: 1.28rem;
469517
}
470518

471519
.summary-tile.compact strong {
@@ -545,6 +593,12 @@ button {
545593
word-break: break-word;
546594
}
547595

596+
.docs-grid > .shell-card:first-child {
597+
position: sticky;
598+
top: 124px;
599+
align-self: start;
600+
}
601+
548602
.tab-strip {
549603
margin-top: 14px;
550604
}
@@ -647,6 +701,21 @@ table {
647701
border: 1px solid var(--border2);
648702
}
649703

704+
.table-shell {
705+
margin-top: 14px;
706+
border: 1px solid var(--border2);
707+
border-radius: 14px;
708+
overflow: auto;
709+
background: rgba(10, 3, 3, 0.58);
710+
}
711+
712+
.table-shell table {
713+
margin-top: 0;
714+
border: 0;
715+
border-radius: 0;
716+
min-width: 620px;
717+
}
718+
650719
th,
651720
td {
652721
padding: 12px 14px;
@@ -661,12 +730,91 @@ thead th {
661730
font-size: 0.76rem;
662731
color: var(--txt2);
663732
text-transform: uppercase;
733+
position: sticky;
734+
top: 0;
735+
z-index: 1;
736+
}
737+
738+
tbody tr:nth-child(even) td {
739+
background: rgba(255, 255, 255, 0.01);
740+
}
741+
742+
tbody tr:hover td {
743+
background: rgba(255, 26, 26, 0.06);
664744
}
665745

666746
tbody tr:last-child td {
667747
border-bottom: none;
668748
}
669749

750+
.score-badge,
751+
.severity-badge {
752+
display: inline-flex;
753+
align-items: center;
754+
justify-content: center;
755+
min-width: 70px;
756+
padding: 6px 10px;
757+
border-radius: 999px;
758+
border: 1px solid var(--border2);
759+
font-family: var(--mono);
760+
font-size: 0.78rem;
761+
background: rgba(255, 26, 26, 0.08);
762+
}
763+
764+
.score-badge {
765+
color: var(--txt);
766+
}
767+
768+
.severity-badge.critical,
769+
.severity-badge.high {
770+
color: var(--bad);
771+
border-color: rgba(255, 107, 107, 0.28);
772+
background: rgba(255, 107, 107, 0.10);
773+
}
774+
775+
.severity-badge.medium {
776+
color: var(--warn);
777+
border-color: rgba(246, 193, 79, 0.28);
778+
background: rgba(246, 193, 79, 0.10);
779+
}
780+
781+
.severity-badge.low,
782+
.severity-badge.info {
783+
color: var(--ok);
784+
border-color: rgba(88, 214, 141, 0.22);
785+
background: rgba(88, 214, 141, 0.10);
786+
}
787+
788+
.report-card {
789+
display: grid;
790+
gap: 8px;
791+
align-content: start;
792+
min-height: 116px;
793+
text-decoration: none;
794+
}
795+
796+
.report-card-title {
797+
display: flex;
798+
justify-content: space-between;
799+
gap: 10px;
800+
align-items: center;
801+
font-weight: 700;
802+
}
803+
804+
.report-card-copy {
805+
color: var(--txt3);
806+
line-height: 1.5;
807+
font-size: 0.92rem;
808+
}
809+
810+
.report-card-meta {
811+
color: var(--r0);
812+
font-family: var(--mono);
813+
font-size: 0.72rem;
814+
letter-spacing: 0.04em;
815+
text-transform: uppercase;
816+
}
817+
670818
.notice {
671819
margin-top: 14px;
672820
color: var(--txt2);
@@ -754,6 +902,10 @@ tbody tr:last-child td {
754902
grid-template-columns: 1fr;
755903
}
756904

905+
.docs-grid > .shell-card:first-child {
906+
position: static;
907+
}
908+
757909
.app-topbar {
758910
flex-direction: column;
759911
align-items: stretch;
@@ -782,6 +934,10 @@ tbody tr:last-child td {
782934
padding: 16px;
783935
}
784936

937+
.app-topbar {
938+
top: 12px;
939+
}
940+
785941
.mobile-only {
786942
display: inline-flex;
787943
}

lib/asrfacet_rb/web/web_assets/dashboard.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ function statusClass(status) {
6060
return `status-pill ${String(status || "idle").toLowerCase()}`;
6161
}
6262

63+
function severityClass(value) {
64+
return String(value || "info").toLowerCase();
65+
}
66+
6367
function relativeTime(value) {
6468
if (!value) return "never";
6569
const timestamp = new Date(value).getTime();
@@ -327,14 +331,21 @@ function renderSnapshot(session) {
327331
function renderReports(session) {
328332
const artifacts = session?.artifacts || {};
329333
const links = [
330-
["CLI report", "cli_report"],
331-
["TXT report", "txt_report"],
332-
["HTML report", "html_report"],
333-
["JSON report", "json_report"]
334+
["CLI report", "cli_report", "Fast terminal-friendly summary for quick operator review.", "Readable stream"],
335+
["TXT report", "txt_report", "Plain-text export for notes, tickets, or lightweight sharing.", "Plain export"],
336+
["HTML report", "html_report", "Human-readable report with the richest session context and presentation.", "Primary review"],
337+
["JSON report", "json_report", "Structured export for scripting, pipelines, and downstream tooling.", "Automation ready"]
334338
].filter(([, key]) => Boolean(artifacts[key]));
335339

336-
el("report-links").innerHTML = links.map(([label, key]) => `
337-
<a class="button button-secondary" target="_blank" rel="noopener" href="/reports/${encodeURIComponent(session.id)}/${key}">${escapeHtml(label)}</a>
340+
el("report-links").innerHTML = links.map(([label, key, copy, meta]) => `
341+
<a class="button button-secondary report-card" target="_blank" rel="noopener" href="/reports/${encodeURIComponent(session.id)}/${key}">
342+
<span class="report-card-title">
343+
<span>${escapeHtml(label)}</span>
344+
<span class="status-pill completed">ready</span>
345+
</span>
346+
<span class="report-card-copy">${escapeHtml(copy)}</span>
347+
<span class="report-card-meta">${escapeHtml(meta)}</span>
348+
</a>
338349
`).join("") || '<div class="notice">Reports appear here after the first completed run.</div>';
339350

340351
el("meta-reports").textContent = links.length > 0 ? `${links.length} ready` : "Awaiting";
@@ -382,7 +393,7 @@ function renderTopAssets(session) {
382393
el("top-assets-table").innerHTML = assets.map((asset) => `
383394
<tr>
384395
<td>${escapeHtml(asset.host || "-")}</td>
385-
<td>${escapeHtml(String(asset.total_score || 0))}</td>
396+
<td><span class="score-badge">${escapeHtml(String(asset.total_score || 0))}</span></td>
386397
<td>${escapeHtml(Array(asset.matched_rules || []).join(", ") || "Interesting exposure patterns detected.")}</td>
387398
</tr>
388399
`).join("") || '<tr><td colspan="3">Top assets appear after a completed run.</td></tr>';
@@ -392,7 +403,7 @@ function renderFindings(session) {
392403
const findings = Array.isArray(session?.payload?.store?.findings) ? session.payload.store.findings.slice(0, 8) : [];
393404
el("findings-table").innerHTML = findings.map((finding) => `
394405
<tr>
395-
<td>${escapeHtml(String(finding.severity || "info").toUpperCase())}</td>
406+
<td><span class="severity-badge ${escapeHtml(severityClass(finding.severity))}">${escapeHtml(String(finding.severity || "info").toUpperCase())}</span></td>
396407
<td>${escapeHtml(finding.title || "Untitled finding")}</td>
397408
<td>${escapeHtml(finding.host || "-")}</td>
398409
</tr>

0 commit comments

Comments
 (0)