Skip to content

Commit baa38f2

Browse files
committed
Fix the dashboard hanging after a scan
A card renderer was missing, so rendering threw and the page stayed on "scanning". Restore it and show a message if rendering ever fails again.
1 parent 12811a1 commit baa38f2

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project are documented here. The format is loosely
44
based on [Keep a Changelog](https://keepachangelog.com/), and the project aims
55
to follow semantic versioning once it reaches 1.0.
66

7+
## [1.2.1] - 2026-06-29
8+
9+
### Fixed
10+
11+
- The dashboard could hang on "scanning" after a scan finished because the
12+
threat-reputation card renderer was missing. Restored it, and a render error
13+
now shows a message instead of leaving the page stuck.
14+
715
## [1.2.0] - 2026-06-29
816

917
### Changed

src/sentineldeck/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""SentinelDeck: passive attack-surface visibility for small businesses."""
22

3-
__version__ = "1.2.0"
3+
__version__ = "1.2.1"

src/sentineldeck/webui/app.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ function startScan(domain) {
4343
li.textContent = JSON.parse(ev.data).label;
4444
$("#progress-steps").appendChild(li);
4545
});
46-
source.addEventListener("done", (ev) => { source.close(); source = null; render(JSON.parse(ev.data)); finish(); });
46+
source.addEventListener("done", (ev) => {
47+
source.close(); source = null;
48+
try {
49+
render(JSON.parse(ev.data));
50+
} catch (err) {
51+
hide(results);
52+
errBox.textContent = "RENDER ERROR // " + (err && err.message ? err.message : err);
53+
show(errBox);
54+
}
55+
finish();
56+
});
4757
source.addEventListener("failed", (ev) => {
4858
source.close(); source = null;
4959
let msg = "SCAN FAILED.";
@@ -438,6 +448,16 @@ function cardSecurityTxt(http) {
438448
`<div class="row"><span class="k">Present</span>${st.present ? `<span class="v ok">yes</span>` : `<span class="v warn">no</span>`}</div>`);
439449
}
440450

451+
function cardReputation(r) {
452+
if (!r || r.status !== "ok") return "";
453+
const listed = r.listed
454+
? `<span class="v bad">listed (${esc((r.sources || []).join(", "))})</span>`
455+
: `<span class="v ok">clean</span>`;
456+
return card("Threat reputation",
457+
`<div class="row"><span class="k">Status</span>${listed}</div>` +
458+
(r.listed ? row("Malicious URLs", esc(r.url_count)) : ""));
459+
}
460+
441461
function cardBlocklists(b) {
442462
if (!b || b.status !== "ok" || !(b.results || []).length) return "";
443463
const rows = b.results.map((r) => {

0 commit comments

Comments
 (0)