v21: Button spacing and deploy script

- 1px spacing between status buttons
- Rounded corners on all buttons
- Invisible spacer for consistent row alignment
- Added scripts/deploy.sh for auto-incrementing version on deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-01-30 13:39:12 -05:00
parent 36de78bc49
commit 7bd9ee7c78
3 changed files with 38 additions and 12 deletions
+28
View File
@@ -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}</" templates.go
echo "Version: v${CURRENT} -> v${NEW}"
# Rebuild and relaunch
docker compose up -d --build
echo "Deployed v${NEW}"
+9 -11
View File
@@ -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 += `<button class="status-btn" data-type="${type}" data-id="${escapeHtml(id)}" data-status="${s}"
style="padding: 2px 6px; font-size: 10px; font-family: monospace;
background: ${bg}; border: 1px solid ${border}; border-radius: ${borderRadius};
color: ${color}; cursor: pointer; margin-left: ${i > 0 ? '-1px' : '0'};">${cfg.label}</button>`;
background: ${bg}; border: 1px solid ${border}; border-radius: 3px;
color: ${color}; cursor: pointer; margin-left: ${i > 0 ? '1px' : '0'};">${cfg.label}</button>`;
});
// Fail indicator (not clickable, just shows error state) or empty spacer for alignment
if (showFail) {
const cfg = statusConfig.fail;
html += `<span style="padding: 2px 6px; font-size: 10px; font-family: monospace;
background: ${cfg.bg}; border: 1px solid ${cfg.border}; border-radius: 0 3px 3px 0;
color: ${cfg.color}; margin-left: -1px;" title="Feed has errors">${cfg.label}</span>`;
background: ${cfg.bg}; border: 1px solid ${cfg.border}; border-radius: 3px;
color: ${cfg.color}; margin-left: 1px;" title="Feed has errors">${cfg.label}</span>`;
} else {
// Empty spacer to keep consistent width
// Empty spacer to keep consistent width (invisible but takes space)
html += `<span style="padding: 2px 6px; font-size: 10px; font-family: monospace;
background: transparent; border: 1px solid transparent; border-radius: 0 3px 3px 0;
color: transparent; margin-left: -1px;">fail</span>`;
background: #111; border: 1px solid #222; border-radius: 3px;
color: #111; margin-left: 1px;">fail</span>`;
}
html += '</div>';
return html;
+1 -1
View File
@@ -533,7 +533,7 @@ const dashboardHTML = `<!DOCTYPE html>
<div id="output"></div>
</div>
<div style="color: #333; font-size: 11px; margin-top: 10px;">v19</div>
<div style="color: #333; font-size: 11px; margin-top: 10px;">v21</div>
<div class="updated" id="updatedAt">Last updated: {{.UpdatedAt.Format "2006-01-02 15:04:05"}}</div>
</body>