v48: domain name links to site, spacer toggles feeds

This commit is contained in:
primal
2026-01-30 16:36:14 -05:00
parent 5b3330ba07
commit 57801d0946
2 changed files with 10 additions and 13 deletions
+9 -12
View File
@@ -97,19 +97,16 @@ function initDashboard() {
// Status buttons (pass/hold/skip + fail indicator if error) // Status buttons (pass/hold/skip + fail indicator if error)
html += renderStatusBtns(status, 'domain', d.host, hasError ? 'error' : null); html += renderStatusBtns(status, 'domain', d.host, hasError ? 'error' : null);
// Domain name (clickable to show feeds) // Domain name (links to site)
html += `<span class="domain-name" style="color: #0af; cursor: pointer;">${escapeHtml(d.host)}</span>`; html += `<a class="domain-name" href="https://${escapeHtml(d.host)}" target="_blank" style="color: #0af; text-decoration: none;">${escapeHtml(d.host)}</a>`;
// Error message // Spacer (clickable to toggle feeds)
if (d.last_error) { if (d.last_error) {
html += `<span style="color: #f66; margin-left: 10px; font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="${escapeHtml(d.last_error)}">${escapeHtml(d.last_error)}</span>`; html += `<span class="domain-spacer" style="color: #f66; margin-left: 10px; font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;" title="${escapeHtml(d.last_error)}">${escapeHtml(d.last_error)}</span>`;
} else { } else {
html += '<span style="flex: 1;"></span>'; html += '<span class="domain-spacer" style="flex: 1; cursor: pointer;"></span>';
} }
// External link
html += `<a href="https://${escapeHtml(d.host)}" target="_blank" style="color: #666; margin-left: 8px; text-decoration: none;" title="Visit site">↗</a>`;
// Drop button (only for skipped domains) // Drop button (only for skipped domains)
if (status === 'skip') { if (status === 'skip') {
html += `<button class="drop-btn" data-host="${escapeHtml(d.host)}" html += `<button class="drop-btn" data-host="${escapeHtml(d.host)}"
@@ -276,11 +273,11 @@ function initDashboard() {
const row = block.querySelector('.domain-row'); const row = block.querySelector('.domain-row');
const host = block.dataset.host; const host = block.dataset.host;
// Click domain name to toggle inline feeds // Click spacer area to toggle inline feeds
const domainName = row.querySelector('.domain-name'); const domainSpacer = row.querySelector('.domain-spacer');
const feedsDiv = block.querySelector('.domain-feeds'); const feedsDiv = block.querySelector('.domain-feeds');
if (domainName && feedsDiv) { if (domainSpacer && feedsDiv) {
domainName.addEventListener('click', () => { domainSpacer.addEventListener('click', () => {
const isVisible = feedsDiv.style.display !== 'none'; const isVisible = feedsDiv.style.display !== 'none';
feedsDiv.style.display = isVisible ? 'none' : 'block'; feedsDiv.style.display = isVisible ? 'none' : 'block';
}); });
+1 -1
View File
@@ -534,7 +534,7 @@ const dashboardHTML = `<!DOCTYPE html>
<div id="output"></div> <div id="output"></div>
</div> </div>
<div style="color: #333; font-size: 11px; margin-top: 10px;">v47</div> <div style="color: #333; font-size: 11px; margin-top: 10px;">v48</div>
<div class="updated" id="updatedAt">Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}</div> <div class="updated" id="updatedAt">Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}</div>
</body> </body>