Skip to content

Commit 53856fa

Browse files
committed
Replace 'Active' status with power state (Running/Offline) in server table
1 parent a896b22 commit 53856fa

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

public/css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,11 @@ cap-widget {
771771
color: var(--accent-orange);
772772
}
773773

774+
.status-offline {
775+
background: rgba(107, 114, 128, 0.12);
776+
color: #9ca3af;
777+
}
778+
774779
.server-card-details {
775780
display: flex;
776781
flex-wrap: wrap;

public/js/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,9 @@ function renderServerRow(s) {
875875
const alloc = s.allocationDetails;
876876
const isInstalling = s.status === 'installing' || s.installed === 0 || s.installed === '0' || s.installed === false;
877877
const isSuspended = s.status === 'suspended';
878-
const statusClass = isSuspended ? 'status-suspended' : (isInstalling ? 'status-installing' : 'status-active');
879-
const statusLabel = isSuspended ? 'Suspended' : (isInstalling ? 'Installing' : 'Active');
878+
const powerState = s.currentState ? s.currentState.charAt(0).toUpperCase() + s.currentState.slice(1) : null;
879+
const statusClass = isSuspended ? 'status-suspended' : (isInstalling ? 'status-installing' : (powerState === 'Offline' ? 'status-offline' : 'status-active'));
880+
const statusLabel = isSuspended ? 'Suspended' : (isInstalling ? 'Installing' : (powerState || 'Active'));
880881
const allocStr = alloc ? `${alloc.alias || alloc.nodeFqdn || alloc.ip}:${alloc.port}` : (s.nodeFqdn || `Node #${s.node}`);
881882
const meta = s.serverMeta;
882883
const days = meta ? daysRemaining(meta.expires_at) : null;
@@ -888,7 +889,6 @@ function renderServerRow(s) {
888889
<td><span class="server-detail-tag">${allocStr}</span></td>
889890
<td>
890891
<span class="server-card-status ${statusClass}">${statusLabel}</span>
891-
${s.currentState ? html`<span class="power-state-dot ${s.currentState}">${s.currentState.charAt(0).toUpperCase() + s.currentState.slice(1)}</span>` : ''}
892892
</td>
893893
<td>
894894
<div style="display:flex;gap:6px">

0 commit comments

Comments
 (0)