Spaces:
Paused

yaz / src /apps /admin /templates /performance.html
anaselamr's picture
refactor: consolidate directory structure
dfe4f9f
Raw History Blame Contribute Delete
4.19 kB
<!-- System Performance Metrics -->
<div class="metrics-grid">
<div class="metric-card">
<div class="metric-icon">💻</div>
<div class="metric-value">{{ system.cpu_percent | round(1) }}%</div>
<div class="metric-label">CPU Usage</div>
<div class="metric-change {% if system.cpu_percent < 70 %}positive{% else %}negative{% endif %}">
{% if system.cpu_percent < 70 %}Normal{% else %}High{% endif %} </div>
</div>
<div class="metric-card">
<div class="metric-icon">🧠</div>
<div class="metric-value">{{ system.memory_percent | round(1) }}%</div>
<div class="metric-label">Memory Usage</div>
<div class="metric-change {% if system.memory_percent < 80 %}positive{% else %}negative{% endif %}">
{{ (system.memory_used_gb | round(1)) }} / {{ (system.memory_total_gb | round(1)) }} GB
</div>
</div>
<div class="metric-card">
<div class="metric-icon">💾</div>
<div class="metric-value">{{ system.disk_percent | round(1) }}%</div>
<div class="metric-label">Disk Usage</div>
<div class="metric-change {% if system.disk_percent < 85 %}positive{% else %}negative{% endif %}">
{{ (system.disk_used_gb | round(1)) }} / {{ (system.disk_total_gb | round(1)) }} GB
</div>
</div>
<div class="metric-card">
<div class="metric-icon">🌐</div>
<div class="metric-value">{{ ((system.network_io.bytes_sent / 1024 / 1024) | round(2)) }}</div>
<div class="metric-label">Network Sent (MB)</div>
<div class="metric-change positive">
Recv: {{ ((system.network_io.bytes_recv / 1024 / 1024) | round(2)) }} MB
</div>
</div>
</div>
<!-- Process Information -->
<div style="margin-top: 2rem;">
<h3 style="font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem;">System Information</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem;">
<div style="padding: 1rem; background: var(--surface); border-radius: 8px;">
<div style="color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem;">Boot Time</div>
<div style="font-weight: 600;">{{ system.boot_time.strftime('%Y-%m-%d %H:%M:%S') }}</div>
</div>
<div style="padding: 1rem; background: var(--surface); border-radius: 8px;">
<div style="color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem;">Active Connections
</div>
<div style="font-weight: 600;">{{ system.active_connections }}</div>
</div>
<div style="padding: 1rem; background: var(--surface); border-radius: 8px;">
<div style="color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem;">CPU Cores</div>
<div style="font-weight: 600;">{{ system.cpu_count }}</div>
</div>
</div>
</div>
<!-- Health Status -->
<div
style="margin-top: 2rem; padding: 1.5rem; background: {% if system.status == 'healthy' %}#d1fae5{% else %}#fee2e2{% endif %}; border-radius: 8px;">
<div style="display: flex; align-items: center; gap: 1rem;">
<div style="font-size: 2rem;">
{% if system.status == 'healthy' %}✅{% else %}⚠️{% endif %}
</div>
<div>
<div style="font-weight: 600; font-size: 1.125rem;">
System Status: <span style="text-transform: uppercase;">{{ system.status }}</span>
</div>
<div
style="color: {% if system.status == 'healthy' %}#065f46{% else %}#991b1b{% endif %}; font-size: 0.875rem; margin-top: 0.25rem;">
{% if system.status == 'healthy' %}
All systems operating normally
{% else %}
Some metrics require attention
{% endif %}
</div>
</div>
</div>
</div>