Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
23 lines
893 B
TypeScript
23 lines
893 B
TypeScript
import { IconServer2 } from "@tabler/icons-react";
|
|
|
|
import { createWidgetDefinition } from "../definition";
|
|
import { optionsBuilder } from "../options";
|
|
|
|
export const { definition, componentLoader } = createWidgetDefinition("systemDisks", {
|
|
icon: IconServer2,
|
|
supportedIntegrations: ["dashDot", "openmediavault", "truenas", "unraid"],
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
showTemperatureIfAvailable: factory.switch({ defaultValue: true }),
|
|
displayMode: factory.select({
|
|
options: (["percentage", "absolute", "free"] as const).map((value) => ({
|
|
value,
|
|
label: (t) => t(`widget.systemDisks.option.displayMode.option.${value}.label`),
|
|
})),
|
|
defaultValue: "percentage",
|
|
}),
|
|
showBackgroundBar: factory.switch({ defaultValue: true }),
|
|
}));
|
|
},
|
|
}).withDynamicImport(() => import("./component"));
|