mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-01 05:10:06 +00:00
feat(frontend): preview tab (#11475)
This commit is contained in:
parent
b0d9864ebd
commit
4e27213df1
7 changed files with 79 additions and 51 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { z } from "zod";
|
||||
import { AlertColors } from "@/config/site-config";
|
||||
|
||||
export const InstallMethodSchema = z.object({
|
||||
type: z.enum(["default", "alpine"], {
|
||||
|
|
@ -16,7 +17,9 @@ export const InstallMethodSchema = z.object({
|
|||
|
||||
const NoteSchema = z.object({
|
||||
text: z.string().min(1, "Note text cannot be empty"),
|
||||
type: z.string().min(1, "Note type cannot be empty"),
|
||||
type: z.enum(Object.keys(AlertColors) as [keyof typeof AlertColors, ...(keyof typeof AlertColors)[]], {
|
||||
message: `Type must be one of: ${Object.keys(AlertColors).join(", ")}`,
|
||||
}),
|
||||
});
|
||||
|
||||
export const ScriptSchema = z.object({
|
||||
|
|
@ -42,7 +45,7 @@ export const ScriptSchema = z.object({
|
|||
username: z.string().nullable(),
|
||||
password: z.string().nullable(),
|
||||
}),
|
||||
notes: z.array(NoteSchema),
|
||||
notes: z.array(NoteSchema).optional().default([]),
|
||||
}).refine((data) => {
|
||||
if (data.disable === true && !data.disable_description) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue