diff --git a/frontend/src/app/json-editor/page.tsx b/frontend/src/app/json-editor/page.tsx index 18aa5aa4..8e740975 100644 --- a/frontend/src/app/json-editor/page.tsx +++ b/frontend/src/app/json-editor/page.tsx @@ -23,6 +23,7 @@ import { toast } from "sonner"; import { z } from "zod"; import { format } from "date-fns"; import { Label } from "@/components/ui/label"; +import { AlertColors } from "@/config/siteConfig"; const scriptSchema = z.object({ name: z.string().min(1), @@ -78,31 +79,14 @@ export default function JSONGenerator() { website: null, logo: null, description: "", - install_methods: [ - { - type: "default", - script: "", - resources: { - cpu: null, - ram: null, - hdd: null, - os: null, - version: null, - }, - }, - ], + install_methods: [], default_credentials: { username: null, password: null, }, - notes: [ - { - text: "", - type: "", - }, - ], + notes: [], }); - const [isCopied, setIsCopied] = useState(false) + const [isCopied, setIsCopied] = useState(false); const [isValid, setIsValid] = useState(false); const [categories, setCategories] = useState([]); @@ -138,9 +122,19 @@ export default function JSONGenerator() { const addInstallMethod = () => { setScript((prev) => { - const method = { - type: "default" as "default", // Ensure type matches the union type - script: `/${prev.type}/${prev.slug}.sh`, // Default script path + const method: { + type: "default" | "alpine"; + script: string; + resources: { + cpu: number | null; + ram: number | null; + hdd: number | null; + os: string | null; + version: number | null; + }; + } = { + type: "default", + script: `/${prev.type}/${prev.slug}.sh`, resources: { cpu: null, ram: null, @@ -497,13 +491,20 @@ export default function JSONGenerator() { ))} -

Default Credentials

@@ -535,17 +536,32 @@ export default function JSONGenerator() { value={note.text} onChange={(e) => updateNote(index, "text", e.target.value)} /> - updateNote(index, "type", e.target.value)} - /> - ))} -