Skip to content

Commit ef0cccb

Browse files
committed
feat: glances
1 parent ffff49e commit ef0cccb

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

custom_modules/core_services.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ in
9393
reverse_proxy 127.0.0.1:19999
9494
}
9595
96+
redir /glances /glances/
97+
handle_path /glances* {
98+
reverse_proxy 127.0.0.1:5124
99+
}
100+
96101
handle {
97102
reverse_proxy 127.0.0.1:8082
98103
}
@@ -143,6 +148,32 @@ in
143148
};
144149
};
145150
}
151+
{
152+
"Glances" = {
153+
icon = "glances";
154+
href = "/glances/"; # Matches the Caddy path
155+
description = "Real-time Monitor";
156+
widget = {
157+
type = "customapi";
158+
url = "http://127.0.0.1:5124/api/4/all";
159+
refreshInterval = 3000; # Refresh every 3 seconds
160+
161+
# We map the JSON data manually to avoid the parsing bug
162+
mappings = [
163+
{
164+
field = "cpu.total";
165+
label = "CPU";
166+
format = "percent";
167+
}
168+
{
169+
field = "mem.percent";
170+
label = "RAM";
171+
format = "percent";
172+
}
173+
];
174+
};
175+
};
176+
}
146177
];
147178
}
148179
];

0 commit comments

Comments
 (0)