Files
homarr/packages/widgets/src/system-resources/index.ts
T
Daniel 003dac4744 feat: add GPU monitoring support via Glances integration (#5255)
* feat: add GPU monitoring support via Glances integration

- Add GPU fields to SystemHealthMonitoring interface (gpuId, name,
  memoryUtilization, processorUtilization, temperature, fanSpeed)
- Extend Glances integration to parse GPU data from /api/4/all endpoint
  (supports NVIDIA, AMD, and Intel GPUs via Glances)
- Add GPU utilization ring to Health Monitoring widget with tooltip
  showing VRAM usage, temperature, and fan speed
- Add GPU time-series chart to System Resources widget (grape color)
- Add GPU toggle option to both widgets
- Add English translations for GPU labels
- Add gpu: [] to all other integrations (dashdot, truenas, unraid,
  openmediavault) for backward compatibility
- Add GPU mock data for development/testing

Closes community request from PR #5102 for GPU monitoring support.

* fix: implement GPU monitoring for dashdot integration and clarify OMV comment

- Add GPU load fetching via dashdot /load/gpu endpoint
- Add GPU info parsing from dashdot /info endpoint
- Add gpuLoadApi and gpu field to internalServerInfoApi schemas
- Add getCurrentGpuLoadAsync method to DashDotIntegration
- Map GPU load data to SystemHealthMonitoring gpu array
- Add explanatory comment for OMV's empty gpu array

Addresses review comments from manuel-rw on PR #5255

* Delete manifest.json
2026-03-27 20:22:41 +01:00

44 lines
1.6 KiB
TypeScript

import { IconAlignLeft, IconEyeOff, IconGraphFilled, IconListDetails, IconPhoto } from "@tabler/icons-react";
import { objectEntries } from "@homarr/common";
import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";
const labelDisplayModeOptions = {
textWithIcon: IconListDetails,
text: IconAlignLeft,
icon: IconPhoto,
hidden: IconEyeOff,
} as const;
export const { definition, componentLoader } = createWidgetDefinition("systemResources", {
icon: IconGraphFilled,
supportedIntegrations: ["dashDot", "openmediavault", "truenas", "unraid", "glances"],
createOptions() {
return optionsBuilder.from((factory) => ({
hasShadow: factory.switch({ defaultValue: true }),
visibleCharts: factory.multiSelect({
options: (["cpu", "memory", "gpu", "network"] as const).map((key) => ({
value: key,
label: (t) => t(`widget.systemResources.option.visibleCharts.option.${key}`),
})),
defaultValue: ["cpu", "memory", "network"],
withDescription: true,
}),
labelDisplayMode: factory.select({
options: objectEntries(labelDisplayModeOptions).map(([key, icon]) => ({
value: key,
label: (t) => t(`widget.systemResources.option.labelDisplayMode.option.${key}`),
icon,
})),
defaultValue: "textWithIcon",
}),
}));
},
}).withDynamicImport(() => import("./component"));
export type LabelDisplayModeOption = ReturnType<
(typeof definition)["createOptions"]
>["labelDisplayMode"]["options"][number]["value"];