updated layout of stats widget
This commit is contained in:
@@ -196,31 +196,33 @@ data:
|
||||
template: |
|
||||
<style>
|
||||
.sys-stats { font-size: 0.9em; }
|
||||
.top-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; justify-content: space-around; }
|
||||
.top-item { text-align: center; padding: 8px 12px; background: rgba(255,255,255,0.05); border-radius: 8px; min-width: 70px; }
|
||||
.top-label { font-size: 0.7em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; }
|
||||
.top-value { font-size: 1.1em; font-weight: 600; margin-top: 2px; }
|
||||
.section-title { font-size: 0.75em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 8px 0; }
|
||||
.disk-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
|
||||
.top-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
|
||||
.top-item { text-align: center; padding: 6px 8px; background: rgba(255,255,255,0.05); border-radius: 8px; }
|
||||
.top-item.wide { grid-column: span 2; }
|
||||
.top-label { font-size: 0.65em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; }
|
||||
.top-value { font-size: 1.05em; font-weight: 600; margin-top: 2px; }
|
||||
.section-title { font-size: 0.75em; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; margin: 10px 0 6px 0; }
|
||||
.disk-row { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
|
||||
.disk-row:last-child { border-bottom: none; }
|
||||
.disk-name { font-weight: 500; min-width: 55px; font-size: 0.9em; }
|
||||
.disk-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 0 12px; overflow: hidden; }
|
||||
.disk-fill { height: 100%; border-radius: 3px; }
|
||||
.disk-name { font-weight: 500; width: 42px; font-size: 0.95em; flex-shrink: 0; }
|
||||
.disk-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 0 10px; overflow: hidden; min-width: 0; }
|
||||
.disk-fill { height: 100%; border-radius: 4px; }
|
||||
.fill-ok { background: linear-gradient(90deg, #4ade80, #22c55e); }
|
||||
.fill-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
|
||||
.fill-crit { background: linear-gradient(90deg, #f87171, #ef4444); }
|
||||
.disk-info { font-size: 0.8em; opacity: 0.8; text-align: right; min-width: 150px; }
|
||||
.disk-info { font-size: 0.9em; opacity: 0.85; text-align: right; white-space: nowrap; flex-shrink: 0; }
|
||||
</style>
|
||||
|
||||
{{ $hostname := .JSON.String "data.result.0.metric.nodename" }}
|
||||
{{ $uptimeDays := (.Subrequest "uptime_days").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $uptimeHours := (.Subrequest "uptime_hours").JSON.Float "data.result.0.value.1" }} {{ $cpu := (.Subrequest "cpu").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $uptimeHours := (.Subrequest "uptime_hours").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $cpu := (.Subrequest "cpu").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $mem := (.Subrequest "memory").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $temp := (.Subrequest "cpu_temp").JSON.Float "data.result.0.value.1" }}
|
||||
{{ $fans := (.Subrequest "fans").JSON.Array "data.result" }}
|
||||
|
||||
<div class="sys-stats">
|
||||
<div class="top-row">
|
||||
<div class="top-grid">
|
||||
<div class="top-item">
|
||||
<div class="top-label">Host</div>
|
||||
<div class="top-value">{{ $hostname }}</div>
|
||||
@@ -327,7 +329,6 @@ data:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
# Weather Widget
|
||||
- type: weather
|
||||
location: Budapest, Hungary
|
||||
|
||||
Reference in New Issue
Block a user