Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

1.1 KB
Raw Blame
import { IconLayoutGrid, IconServerOff } from "@tabler/icons-react";

import { getWidgetIntegrationConfig } from "@homarr/definitions";

import { createWidgetDefinition } from "../definition";
import { createBeszelMetricOptions, statusOptions } from "../beszel/_shared/options";
import { optionsBuilder } from "../options";

export const { definition, componentLoader } = createWidgetDefinition("beszelSystemGrid", {
  icon: IconLayoutGrid,
  queryKey: [["widget", "beszel", "getSystems"]],
  ...getWidgetIntegrationConfig("beszelSystemGrid"),
  createOptions() {
    return optionsBuilder.from((factory) => ({
      statusFilter: factory.select({
        defaultValue: "all",
        options: statusOptions,
      }),
      fahrenheit: factory.switch({
        defaultValue: false,
      }),
      ...createBeszelMetricOptions(() => factory.switch({ defaultValue: true })),
    }));
  },
  errors: {
    INTERNAL_SERVER_ERROR: {
      icon: IconServerOff,
      message: (t) => t("widget.beszel.error.internalServerError"),
    },
  },
}).withDynamicImport(() => import("./component"));