mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 10:16:37 +08:00
fix(frontend): serve zone detail static export fallback
This commit is contained in:
@@ -56,7 +56,7 @@ export function ZoneEditorDialog({
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{zone ? '编辑 Zone' : '新增 Zone'}</DialogTitle>
|
||||
<DialogDescription>Zone 仅接受可注册根域,例如 arctel.de。</DialogDescription>
|
||||
<DialogDescription>Zone 仅接受可注册根域,例如 example.com。</DialogDescription>
|
||||
</DialogHeader>
|
||||
<form
|
||||
id="zone-editor"
|
||||
@@ -67,7 +67,7 @@ export function ZoneEditorDialog({
|
||||
>
|
||||
<div className="space-y-1.5">
|
||||
<Label htmlFor="zone-domain">根域</Label>
|
||||
<Input id="zone-domain" placeholder="arctel.de" {...form.register('domain')} />
|
||||
<Input id="zone-domain" placeholder="example.com" {...form.register('domain')} />
|
||||
{form.formState.errors.domain && (
|
||||
<p className="text-xs text-destructive">{form.formState.errors.domain.message}</p>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import {useParams, usePathname, useRouter, useSearchParams} from 'next/navigation';
|
||||
import {usePathname, useRouter, useSearchParams} from 'next/navigation';
|
||||
import {useCallback, useEffect, useMemo, useState} from 'react';
|
||||
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query';
|
||||
import {ArrowLeft, Globe, Pencil, Trash2} from 'lucide-react';
|
||||
@@ -40,10 +40,12 @@ function getZonePageTab(value: string | null | undefined): ZonePageTab {
|
||||
return zoneTabs.includes(value as ZonePageTab) ? (value as ZonePageTab) : 'overview';
|
||||
}
|
||||
|
||||
export function ZonePageClient() {
|
||||
const params = useParams();
|
||||
const zoneId = Number(params?.zoneId);
|
||||
function getZoneIdFromPathname(pathname: string | null): number {
|
||||
const match = pathname?.match(/^\/websites\/([^/]+)$/);
|
||||
return Number(match?.[1]);
|
||||
}
|
||||
|
||||
export function ZonePageClient() {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
@@ -51,6 +53,7 @@ export function ZonePageClient() {
|
||||
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const zoneId = useMemo(() => getZoneIdFromPathname(pathname), [pathname]);
|
||||
const searchParams = useSearchParams();
|
||||
const queryClient = useQueryClient();
|
||||
const activeTab = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user