Fix director connectivity, dynamic firewall port resolution, and map banner readability

- DirectorService now connects via 127.0.0.1 SSH tunnel instead of external IP
- Launcher auto-scales BGD deployment before starting port-forward
- SSH tunnel forwards both DB and Director ports
- Firewall toggle resolves BGD NodePort dynamically from K8s
- Map experimental banner uses theme-aware text color for readability
- Frontend gracefully handles director not running (shows N/A)
This commit is contained in:
Reditus committed 2026-05-15 15:23:21 +01:00
1 parent 1959a013ab
commit 6efce4dbcb
5 files changed
+132 -25

No files matched your search

+4 -4
View File
@@ -329,8 +329,8 @@
}
.experimental-banner {
background: rgba(220, 38, 38, 0.15);
border: 1px solid rgba(220, 38, 38, 0.4);
background: rgba(220, 38, 38, 0.12);
border: 1px solid rgba(220, 38, 38, 0.5);
border-left: 4px solid #dc2626;
border-radius: 6px;
padding: 10px 14px;
@@ -339,14 +339,14 @@
gap: 10px;
font-size: 13px;
line-height: 1.5;
color: #fca5a5;
color: var(--text);
}
.experimental-banner .banner-icon {
font-size: 18px;
flex-shrink: 0;
}
.experimental-banner strong {
color: #fbbf24;
color: #ef4444;
}
</style>
+11 -7
View File
@@ -406,13 +406,17 @@ async function loadFwStatus() {
const allPorts = [...(data.blocked || []), ...(data.available || [])];
let html = '<table style="width:100%;font-size:13px;"><thead><tr><th>Service</th><th>Port</th><th>Status</th><th>Action</th></tr></thead><tbody>';
for (const p of allPorts) {
const isBlocked = (data.blocked || []).some(b => b.port === p.port);
const rules = Object.values(data.iptables_rules || {}).filter(r => r.includes('dpt:' + p.port));
const statusText = isBlocked ? '<span style="color:#4ade80;font-weight:600;">Blocked</span>' : '<span style="color:#e74c3c;font-weight:600;">Open</span>';
const actionBtn = isBlocked
? `<button class="fw-btn" data-port="${p.port}" data-action="unblock" style="padding:4px 12px;background:#e74c3c;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:12px;">Unblock</button>`
: `<button class="fw-btn" data-port="${p.port}" data-action="block" style="padding:4px 12px;background:#27ae60;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:12px;">Block</button>`;
html += `<tr><td style="padding:6px 0;">${p.name}</td><td style="font-family:monospace;">${p.port}</td><td>${statusText}</td><td>${actionBtn}</td></tr>`;
const portDisplay = p.port !== null && p.port !== undefined ? p.port : 'N/A';
const hasPort = p.port !== null && p.port !== undefined;
const isBlocked = hasPort && (data.blocked || []).some(b => b.port === p.port);
const rules = hasPort ? Object.values(data.iptables_rules || {}).filter(r => r.includes('dpt:' + p.port)) : [];
const statusText = !hasPort ? '<span style="color:var(--text-muted);font-style:italic;">Not running</span>' : (isBlocked ? '<span style="color:#4ade80;font-weight:600;">Blocked</span>' : '<span style="color:#e74c3c;font-weight:600;">Open</span>');
const actionBtn = !hasPort
? '<span style="color:var(--text-muted);font-size:11px;">Start battlegroup to enable</span>'
: (isBlocked
? `<button class="fw-btn" data-port="${p.port}" data-action="unblock" style="padding:4px 12px;background:#e74c3c;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:12px;">Unblock</button>`
: `<button class="fw-btn" data-port="${p.port}" data-action="block" style="padding:4px 12px;background:#27ae60;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:12px;">Block</button>`);
html += `<tr><td style="padding:6px 0;">${p.name}</td><td style="font-family:monospace;">${portDisplay}</td><td>${statusText}</td><td>${actionBtn}</td></tr>`;
}
html += '</tbody></table>';
list.innerHTML = html;