Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { IconServerOff, IconTopologyFull } from "@tabler/icons-react";
|
|
|
|
import { getIntegrationKindsByCategory } from "@homarr/definitions";
|
|
|
|
import { createWidgetDefinition } from "../../definition";
|
|
import { optionsBuilder } from "../../options";
|
|
|
|
export const { definition, componentLoader } = createWidgetDefinition("networkControllerStatus", {
|
|
icon: IconTopologyFull,
|
|
queryKey: [["widget", "networkController"]],
|
|
refetchInterval: null,
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
content: factory.select({
|
|
options: (["wifi", "wired"] as const).map((value) => ({
|
|
value,
|
|
label: (t) => t(`widget.networkControllerStatus.option.content.option.${value}.label`),
|
|
})),
|
|
defaultValue: "wifi",
|
|
}),
|
|
}));
|
|
},
|
|
supportedIntegrations: getIntegrationKindsByCategory("networkController"),
|
|
errors: {
|
|
INTERNAL_SERVER_ERROR: {
|
|
icon: IconServerOff,
|
|
message: (t) => t("widget.networkController.error.internalServerError"),
|
|
},
|
|
},
|
|
}).withDynamicImport(() => import("./component"));
|