Add container summary on card face, fix df parsing for wrapped lines, collect OS info, faster startup and refresh
This commit is contained in:
@@ -63,6 +63,8 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set containers = d.get('container', []) if d.get('container') else [] %}
|
||||
|
||||
{% if server.is_online %}
|
||||
<div class="usage-bars">
|
||||
<div class="usage-row">
|
||||
@@ -96,6 +98,20 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if containers %}
|
||||
<div class="ct-summary-list">
|
||||
{% for ct in containers %}
|
||||
{% set ct_up = ct.get('status', '')|lower in ['running', 'started'] %}
|
||||
<div class="ct-summary-item">
|
||||
<span class="status-dot-sm {% if ct_up %}online{% else %}offline{% endif %}"></span>
|
||||
<span class="ct-summary-name">{{ ct.get('name', ct.get('id', '?')) }}</span>
|
||||
{% if ct.get('os') %}<span class="ct-summary-os">{{ ct.get('os') }}</span>{% endif %}
|
||||
{% if ct.get('ip') %}<span class="ct-summary-ip">{{ ct.get('ip') }}</span>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<div class="offline-label">Unreachable</div>
|
||||
{% endif %}
|
||||
@@ -254,7 +270,6 @@
|
||||
</div>
|
||||
|
||||
<!-- Containers / VMs -->
|
||||
{% set containers = d.get('container', []) if d.get('container') else [] %}
|
||||
{% if containers %}
|
||||
<div class="detail-section wide">
|
||||
<h4>Containers & VMs</h4>
|
||||
@@ -396,16 +411,10 @@
|
||||
if (card) toggleDetails(card);
|
||||
}
|
||||
|
||||
// Auto-refresh without full page reload if a card is expanded,
|
||||
// otherwise do a simple reload
|
||||
setInterval(function() {
|
||||
if (document.querySelector('.server-card.expanded')) {
|
||||
// A card is open - reload page preserving hash
|
||||
location.reload();
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}, 60000);
|
||||
// If no servers have data yet, refresh quickly; otherwise every 60s
|
||||
const hasData = document.querySelectorAll('.server-card').length > 0;
|
||||
const refreshMs = hasData ? 60000 : 5000;
|
||||
setInterval(function() { location.reload(); }, refreshMs);
|
||||
|
||||
// Restore state on load
|
||||
restoreExpanded();
|
||||
|
||||
Reference in New Issue
Block a user