fix: use --red instead of --danger-soft-text for metric bars

This commit is contained in:
tian 2026-05-08 20:16:22 +08:00
parent f0465049f2
commit 7ece6a04fb

View File

@ -34,11 +34,11 @@
<div style="font-weight:500;font-size:12px;margin-bottom:8px">{{.Name}}</div>
<div style="display:flex;flex-direction:column;gap:4px;font-size:11px">
<div><span style="display:inline-block;width:32px">CPU</span> {{printf "%.0f%%" .CPU}}</div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px;margin-bottom:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .CPU}};background:{{if gt .CPU 80.0}}var(--danger-soft-text){{else if gt .CPU 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px;margin-bottom:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .CPU}};background:{{if gt .CPU 80.0}}var(--red){{else if gt .CPU 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
<div><span style="display:inline-block;width:32px">内存</span> {{printf "%.0f%%" .Mem}}</div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px;margin-bottom:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .Mem}};background:{{if gt .Mem 80.0}}var(--danger-soft-text){{else if gt .Mem 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px;margin-bottom:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .Mem}};background:{{if gt .Mem 80.0}}var(--red){{else if gt .Mem 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
<div><span style="display:inline-block;width:32px">NPU</span> {{printf "%.0f%%" .NPU}}</div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .NPU}};background:{{if gt .NPU 80.0}}var(--danger-soft-text){{else if gt .NPU 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
<div style="height:4px;background:var(--surface-soft);border-radius:2px"><div style="height:100%;border-radius:2px;width:{{printf "%.0f%%" .NPU}};background:{{if gt .NPU 80.0}}var(--red){{else if gt .NPU 50.0}}var(--amber){{else}}var(--green){{end}}"></div></div>
</div>
</div>
{{else}}