25 lines
909 B
TypeScript
25 lines
909 B
TypeScript
import { IconBrandDocker } from "@tabler/icons-react";
|
|
|
|
import { createWidgetDefinition } from "../definition";
|
|
import { optionsBuilder } from "../options";
|
|
|
|
export const { definition, componentLoader } = createWidgetDefinition("wud", {
|
|
icon: IconBrandDocker,
|
|
refetchInterval: null,
|
|
supportedIntegrations: ["wud"],
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
showTitle: factory.switch({ defaultValue: true }),
|
|
showRing: factory.switch({ defaultValue: true }),
|
|
layout: factory.select({
|
|
options: (["horizontal", "vertical"] as const).map((value) => ({
|
|
value,
|
|
label: (t) => t(`widget.wud.option.layout.option.${value}.label`),
|
|
})),
|
|
defaultValue: "horizontal",
|
|
}),
|
|
showUpdateList: factory.switch({ defaultValue: false, withDescription: true }),
|
|
}));
|
|
},
|
|
}).withDynamicImport(() => import("./component"));
|