Initial commit: Homelab Dashboard with YAML configuration
Features: - Service health monitoring with response times - Proxmox cluster integration (nodes, VMs, containers) - PBS backup server monitoring - Camera viewer with WebRTC (go2rtc) - Docker container monitoring - Uptime Kuma integration - Mobile-friendly responsive design - YAML-based configuration for easy setup
This commit is contained in:
45
app/templates/partials/uptime.html
Normal file
45
app/templates/partials/uptime.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<div class="card rounded-lg p-3">
|
||||
{% if uptime.monitors %}
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<span class="text-xs text-gray-400">{{ uptime.summary.up }}/{{ uptime.summary.total }} up</span>
|
||||
{% if uptime.summary.down > 0 %}
|
||||
<span class="text-xs text-red-400">{{ uptime.summary.down }} down</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
{% for monitor in uptime.monitors[:8] %}
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="w-1.5 h-1.5 rounded-full flex-shrink-0 {% if monitor.status == 1 %}bg-emerald-500{% else %}bg-red-500{% endif %}"></span>
|
||||
<span class="text-xs text-gray-300 truncate flex-1">{{ monitor.name }}</span>
|
||||
<!-- Sparkline -->
|
||||
{% if monitor.heartbeats %}
|
||||
<div class="flex items-end gap-px h-3">
|
||||
{% for hb in monitor.heartbeats[-12:] %}
|
||||
{% set ping_height = ((hb.ping or 50) / 5) %}
|
||||
{% if ping_height > 100 %}{% set ping_height = 100 %}{% endif %}
|
||||
{% if ping_height < 20 %}{% set ping_height = 20 %}{% endif %}
|
||||
<div class="w-1 {% if hb.status == 1 %}bg-emerald-500/60{% else %}bg-red-500/60{% endif %}"
|
||||
style="height: {{ ping_height }}%"></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if monitor.ping %}
|
||||
<span class="text-[10px] text-gray-500 w-8 text-right">{{ monitor.ping }}ms</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if uptime.monitors | length > 8 %}
|
||||
<div class="text-xs text-gray-500 mt-2">+{{ uptime.monitors | length - 8 }} more</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="flex items-center gap-2 text-gray-500 text-xs">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
||||
<span>No uptime data</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ uptime_kuma_url }}" target="_blank" class="block text-center text-xs text-gray-500 hover:text-amber-400 mt-2">
|
||||
Open Uptime Kuma
|
||||
</a>
|
||||
</div>
|
||||
Reference in New Issue
Block a user