Add version UI to server matrix cards (both TX1 and NC1 loops)
Adds installed version display, edit form, save/cancel buttons, and version history viewer to each server card. Uses var assignment pattern to avoid single quotes inside EJS attribute tags. EJS validates clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
34aca32835
commit
ccc7568c06
@@ -194,6 +194,41 @@
|
||||
title="Restart">🔄</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Installed Version -->
|
||||
<% var currentVersion = config && config.current_version ? config.current_version : null; %>
|
||||
<div class="px-4 pb-4" style="border-top:1px solid #333;padding-top:10px;margin-top:4px;">
|
||||
<div style="font-size:10px;color:#666;text-transform:uppercase;letter-spacing:0.1em;margin-bottom:6px;">📦 Installed Version</div>
|
||||
<div style="display:flex;gap:6px;align-items:center;" id="version-display-<%= server.identifier %>">
|
||||
<span style="font-size:13px;font-weight:600;color:<%= currentVersion ? '#4ade80' : '#555' %>;" id="version-text-<%= server.identifier %>">
|
||||
<%= currentVersion || 'Not set' %>
|
||||
</span>
|
||||
<button id="version-edit-btn-<%= server.identifier %>"
|
||||
onclick="toggleVersionForm('<%= server.identifier %>')"
|
||||
style="font-size:10px;background:#333;border:1px solid #555;color:#aaa;padding:2px 8px;border-radius:4px;cursor:pointer;">
|
||||
✏️ Edit
|
||||
</button>
|
||||
</div>
|
||||
<div id="version-form-<%= server.identifier %>" style="display:none;margin-top:6px;">
|
||||
<div style="display:flex;gap:6px;align-items:center;">
|
||||
<input type="text" id="version-input-<%= server.identifier %>"
|
||||
placeholder="e.g. 1.4.2"
|
||||
style="font-size:12px;background:#1a1a1a;border:1px solid #555;color:#e0e0e0;padding:4px 8px;border-radius:4px;width:140px;" />
|
||||
<button onclick="saveVersion('<%= server.identifier %>')"
|
||||
style="font-size:11px;background:#2563eb;color:#fff;border:none;padding:4px 10px;border-radius:4px;cursor:pointer;">Save</button>
|
||||
<button onclick="hideVersionForm('<%= server.identifier %>')"
|
||||
style="font-size:11px;background:#333;border:1px solid #555;color:#aaa;padding:4px 8px;border-radius:4px;cursor:pointer;">Cancel</button>
|
||||
</div>
|
||||
<div id="version-result-<%= server.identifier %>" style="margin-top:4px;font-size:11px;"></div>
|
||||
<div style="margin-top:6px;">
|
||||
<button hx-get="/admin/servers/<%= server.identifier %>/version-history"
|
||||
hx-target="#version-history-<%= server.identifier %>"
|
||||
hx-swap="innerHTML"
|
||||
style="font-size:10px;background:transparent;border:none;color:#555;cursor:pointer;padding:0;text-decoration:underline;">View history</button>
|
||||
</div>
|
||||
<div id="version-history-<%= server.identifier %>" style="margin-top:4px;background:#1a1a1a;border-radius:4px;padding:4px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% }) %>
|
||||
@@ -395,6 +430,41 @@
|
||||
title="Restart">🔄</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Installed Version -->
|
||||
<% var currentVersion = config && config.current_version ? config.current_version : null; %>
|
||||
<div class="px-4 pb-4" style="border-top:1px solid #333;padding-top:10px;margin-top:4px;">
|
||||
<div style="font-size:10px;color:#666;text-transform:uppercase;letter-spacing:0.1em;margin-bottom:6px;">📦 Installed Version</div>
|
||||
<div style="display:flex;gap:6px;align-items:center;" id="version-display-<%= server.identifier %>">
|
||||
<span style="font-size:13px;font-weight:600;color:<%= currentVersion ? '#4ade80' : '#555' %>;" id="version-text-<%= server.identifier %>">
|
||||
<%= currentVersion || 'Not set' %>
|
||||
</span>
|
||||
<button id="version-edit-btn-<%= server.identifier %>"
|
||||
onclick="toggleVersionForm('<%= server.identifier %>')"
|
||||
style="font-size:10px;background:#333;border:1px solid #555;color:#aaa;padding:2px 8px;border-radius:4px;cursor:pointer;">
|
||||
✏️ Edit
|
||||
</button>
|
||||
</div>
|
||||
<div id="version-form-<%= server.identifier %>" style="display:none;margin-top:6px;">
|
||||
<div style="display:flex;gap:6px;align-items:center;">
|
||||
<input type="text" id="version-input-<%= server.identifier %>"
|
||||
placeholder="e.g. 1.4.2"
|
||||
style="font-size:12px;background:#1a1a1a;border:1px solid #555;color:#e0e0e0;padding:4px 8px;border-radius:4px;width:140px;" />
|
||||
<button onclick="saveVersion('<%= server.identifier %>')"
|
||||
style="font-size:11px;background:#2563eb;color:#fff;border:none;padding:4px 10px;border-radius:4px;cursor:pointer;">Save</button>
|
||||
<button onclick="hideVersionForm('<%= server.identifier %>')"
|
||||
style="font-size:11px;background:#333;border:1px solid #555;color:#aaa;padding:4px 8px;border-radius:4px;cursor:pointer;">Cancel</button>
|
||||
</div>
|
||||
<div id="version-result-<%= server.identifier %>" style="margin-top:4px;font-size:11px;"></div>
|
||||
<div style="margin-top:6px;">
|
||||
<button hx-get="/admin/servers/<%= server.identifier %>/version-history"
|
||||
hx-target="#version-history-<%= server.identifier %>"
|
||||
hx-swap="innerHTML"
|
||||
style="font-size:10px;background:transparent;border:none;color:#555;cursor:pointer;padding:0;text-decoration:underline;">View history</button>
|
||||
</div>
|
||||
<div id="version-history-<%= server.identifier %>" style="margin-top:4px;background:#1a1a1a;border-radius:4px;padding:4px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% }) %>
|
||||
|
||||
Reference in New Issue
Block a user