mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-07 16:30:52 +08:00
name or id
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user