feat: add onboarding with oldmarr import (#1606)

This commit is contained in:
Meier Lukas
2024-12-15 15:40:26 +01:00
committed by GitHub
parent 82ec77d2da
commit 6de74d9525
108 changed files with 6045 additions and 312 deletions

View File

@@ -47,6 +47,8 @@ const integrationSchema = z.enum([
"tdarr",
]);
export type OldmarrIntegrationType = z.infer<typeof integrationSchema>;
const appIntegrationPropertySchema = z.object({
type: z.enum(["private", "public"]),
field: z.enum(["apiKey", "password", "username"]),

View File

@@ -28,3 +28,5 @@ export const oldmarrConfigSchema = z.object({
});
export type OldmarrConfig = z.infer<typeof oldmarrConfigSchema>;
export type OldmarrCategorySection = z.infer<typeof categorySchema>;
export type OldmarrEmptySection = z.infer<typeof wrapperSchema>;

View File

@@ -1,5 +1,7 @@
export type { OldmarrConfig } from "./config";
export type { OldmarrConfig, OldmarrCategorySection, OldmarrEmptySection } from "./config";
export { oldmarrConfigSchema } from "./config";
export type { OldmarrApp } from "./app";
export type { OldmarrApp, OldmarrIntegrationType } from "./app";
export type { OldmarrWidget, OldmarrWidgetKind } from "./widget";
export { oldmarrWidgetKinds } from "./widget";
export { boardSizes } from "./tile";
export type { BoardSize } from "./tile";

View File

@@ -32,11 +32,17 @@ const accessSettingsSchema = z.object({
allowGuests: z.boolean(),
});
const gridstackSettingsSchema = z.object({
columnCountSmall: z.number(),
columnCountMedium: z.number(),
columnCountLarge: z.number(),
});
const gridstackSettingsSchema = z
.object({
columnCountSmall: z.number(),
columnCountMedium: z.number(),
columnCountLarge: z.number(),
})
.catch({
columnCountSmall: 3,
columnCountMedium: 6,
columnCountLarge: 12,
});
const layoutSettingsSchema = z.object({
enabledLeftSidebar: z.boolean(),

View File

@@ -1,5 +1,7 @@
import { z } from "zod";
import { objectKeys } from "@homarr/common";
const createAreaSchema = <TType extends string, TPropertiesSchema extends z.AnyZodObject>(
type: TType,
propertiesSchema: TPropertiesSchema,
@@ -53,3 +55,6 @@ export const tileBaseSchema = z.object({
area: areaSchema,
shape: shapeSchema,
});
export const boardSizes = objectKeys(shapeSchema._def.shape());
export type BoardSize = (typeof boardSizes)[number];