name or id

This commit is contained in:
shamoon
2026-01-23 12:47:42 -08:00
parent b3f65fb541
commit eca75b083b

View File

@@ -31,8 +31,9 @@ export default function Component({ service }) {
let memoryPercent; let memoryPercent;
if (widget?.environment) { if (widget?.environment) {
// Filter by environment if set const environment = stats.find(
const environment = stats.find((env) => env.name === widget.environment); (env) => env?.name === widget.environment || env?.id?.toString() === widget.environment.toString(),
);
if (environment) { if (environment) {
running = environment?.containers?.running; running = environment?.containers?.running;
stopped = environment?.containers?.stopped ?? (environment?.containers?.total ?? 0) - (running ?? 0); stopped = environment?.containers?.stopped ?? (environment?.containers?.total ?? 0) - (running ?? 0);