diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..f4bc7d9 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Deploy script - increments version and relaunches container +# Usage: ./scripts/deploy.sh + +set -e + +cd "$(dirname "$0")/.." + +# Extract current version number from templates.go +CURRENT=$(grep -o '>v[0-9]*<' templates.go | grep -o '[0-9]*' | head -1) + +if [ -z "$CURRENT" ]; then + echo "Could not find version number in templates.go" + exit 1 +fi + +# Increment version +NEW=$((CURRENT + 1)) + +# Update templates.go +sed -i '' "s/>v${CURRENT}v${NEW} v${NEW}" + +# Rebuild and relaunch +docker compose up -d --build + +echo "Deployed v${NEW}" diff --git a/static/dashboard.js b/static/dashboard.js index 8d84036..c37c2b8 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -28,8 +28,8 @@ function initDashboard() { }; // Render status button group - // For domains: pass, hold, skip (+ fail indicator if errors) - // For feeds: pass, hold, skip, drop (+ fail indicator if errors) + // For domains: pass, hold, skip (+ fail indicator or spacer) + // For feeds: pass, hold, skip, drop (+ fail indicator or spacer) function renderStatusBtns(currentStatus, type, id, errorStatus) { const order = type === 'feed' ? ['pass', 'hold', 'skip', 'drop'] : ['pass', 'hold', 'skip']; const showFail = errorStatus === 'error' || errorStatus === 'dead'; @@ -40,24 +40,22 @@ function initDashboard() { const bg = isActive ? cfg.bg : cfg.dimBg; const color = isActive ? cfg.color : cfg.dimColor; const border = isActive ? cfg.border : '#333'; - const isLast = !showFail && i === order.length - 1; - const borderRadius = i === 0 ? '3px 0 0 3px' : (isLast ? '0 3px 3px 0' : '0'); html += ``; + background: ${bg}; border: 1px solid ${border}; border-radius: 3px; + color: ${color}; cursor: pointer; margin-left: ${i > 0 ? '1px' : '0'};">${cfg.label}`; }); // Fail indicator (not clickable, just shows error state) or empty spacer for alignment if (showFail) { const cfg = statusConfig.fail; html += `${cfg.label}`; + background: ${cfg.bg}; border: 1px solid ${cfg.border}; border-radius: 3px; + color: ${cfg.color}; margin-left: 1px;" title="Feed has errors">${cfg.label}`; } else { - // Empty spacer to keep consistent width + // Empty spacer to keep consistent width (invisible but takes space) html += `fail`; + background: #111; border: 1px solid #222; border-radius: 3px; + color: #111; margin-left: 1px;">fail`; } html += ''; return html; diff --git a/templates.go b/templates.go index 9a37853..ab3ccde 100644 --- a/templates.go +++ b/templates.go @@ -533,7 +533,7 @@ const dashboardHTML = `
-
v19
+
v21
Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}