feat(integrations): add PatchMon integration and widget (#6119)

Co-authored-by: Thomas <thomas@ajnart.fr>
This commit is contained in:
Josh PrestonandThomas authored and GitHub committed 2026-07-10 17:48:43 +02:00
1 parent 174c5f98f8
commit 33395ae226
41 files changed
+2982 -17

No files matched your search

+14 -2
View File
@@ -2,7 +2,7 @@ import type React from "react";
import type { DraggableAttributes, UniqueIdentifier } from "@dnd-kit/core";
import type { ActionIconProps } from "@mantine/core";
import { z } from "zod/v4";
import type { ZodType } from "zod/v4";
import type { RefinementCtx, ZodType } from "zod/v4";
import type { IntegrationKind } from "@homarr/definitions";
@@ -257,9 +257,12 @@ type ConfigurationInput<TOptions extends WidgetOptionsRecord> = Partial<
Record<keyof TOptions, FieldConfiguration<TOptions>>
>;
export const OPTIONS_SUPER_REFINE = Symbol("optionsSuperRefine");
const createOptions = <TOptions extends WidgetOptionsRecord>(
optionsCallback: (factory: WidgetOptionFactory) => TOptions,
configuration?: ConfigurationInput<TOptions>,
optionsSuperRefine?: (data: inferOptionsFromDefinition<TOptions>, ctx: RefinementCtx) => void,
) => {
const obj = {} as Record<keyof TOptions, unknown>;
const options = optionsCallback(optionsFactory);
@@ -271,9 +274,18 @@ const createOptions = <TOptions extends WidgetOptionsRecord>(
};
}
return obj as {
const result = obj as {
[key in keyof TOptions]: TOptions[key] & FieldConfiguration<TOptions>;
};
if (optionsSuperRefine) {
Object.defineProperty(result, OPTIONS_SUPER_REFINE, {
value: optionsSuperRefine,
enumerable: false,
});
}
return result;
};
type OptionsBuilder = typeof createOptions;