gitscope
← marzneshin / Diff · 7683c69 → 7683c69
Changes 7683c69..7683c69
Patch commit
diff --git a/dashboard/src/features/hosts/dialogs/mutation/fields/remark.tsx b/dashboard/src/features/hosts/dialogs/mutation/fields/remark.tsx
index 60a2aaf..46a317c 100644
--- a/dashboard/src/features/hosts/dialogs/mutation/fields/remark.tsx
+++ b/dashboard/src/features/hosts/dialogs/mutation/fields/remark.tsx
@@ -9,7 +9,7 @@ import {
PopoverTrigger,
PopoverContent,
} from "@marzneshin/components";
-import { PopoverGuide } from './popover-guide'
+import { PopoverGuide } from './popover-guide';
import { useFormContext } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { InfoIcon } from 'lucide-react';
diff --git a/dashboard/src/features/hosts/schema/hosts-schema.ts b/dashboard/src/features/hosts/schema/hosts-schema.ts
index 3be5a57..afbe0eb 100644
--- a/dashboard/src/features/hosts/schema/hosts-schema.ts
+++ b/dashboard/src/features/hosts/schema/hosts-schema.ts
@@ -6,10 +6,10 @@ export const HostSchema = z.object({
port: z.coerce.number()
.gte(1, 'Port must be more than 1')
.lte(65535, 'Port can not be more than 65535')
- .or(z.string()).optional(),
- path: z.string().optional(),
- sni: z.string().optional(),
- host: z.string().optional(),
+ .or(z.string()).nullable().optional(),
+ path: z.string().nullable().optional(),
+ sni: z.string().nullable().optional(),
+ host: z.string().nullable().optional(),
security: z.enum(['inbound_default', 'none', 'tls']).default("inbound_default"),
alpn: z.enum(['h2', 'http/1.1', 'h2,http/1.1', 'none', '']).optional().default("none"),
allowinsecure: z.boolean().default(false).optional(),
diff --git a/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx b/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx
index 88fb34e..f37b0ca 100644
--- a/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx
+++ b/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx
@@ -15,7 +15,7 @@ import { InboundNotSelectedAlertDialog } from './inbound-not-selected-alert-dial
export const InboundHostsTable = () => {
const { data: inbounds } = useInboundsQuery()
- const [selectedInbound, setSelectedInbound] = useState<string>(String(inbounds[0]?.id))
+ const [selectedInbound, setSelectedInbound] = useState<string | undefined>(inbounds[0]?.id !== undefined ? String(inbounds[0].id) : undefined)
const { data } = useHostsQuery(Number(selectedInbound))
const [mutationDialogOpen, setMutationDialogOpen] = useDialog();