fix(openflare): improve SWOfflineDomains validation and snapshot diff logic

This commit is contained in:
ryan
2026-08-08 20:52:07 +08:00
parent 6882481a56
commit 9797fcdb2f
8 changed files with 42 additions and 6 deletions
@@ -194,6 +194,7 @@ export function ContactPageTab({
preview={(html) => html}
footerHint={null}
showPreviewLink={false}
previewTitle='离线联系页实时预览'
/>
</CardContent>
</Card>
@@ -42,9 +42,7 @@ export function ErrorPageTab({
optionMap: Record<string, string>;
}) {
const queryClient = useQueryClient();
const [fields, setFields] = useState<ErrorPageFields>(
defaultErrorPageFields,
);
const [fields, setFields] = useState<ErrorPageFields>(defaultErrorPageFields);
const [tagError, setTagError] = useState<string | null>(null);
useEffect(() => {
@@ -21,6 +21,7 @@ type HtmlEditorWorkspaceProps = {
preview?: (html: string) => string;
footerHint?: React.ReactNode;
showPreviewLink?: boolean;
previewTitle?: string;
};
/**
@@ -38,6 +39,7 @@ export function HtmlEditorWorkspace({
</>
),
showPreviewLink = true,
previewTitle = '源站错误页实时预览',
}: HtmlEditorWorkspaceProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [editorWidthPercent, setEditorWidthPercent] = useState(48);
@@ -145,7 +147,7 @@ export function HtmlEditorWorkspace({
</div>
<div className='flex-1 min-h-0 overflow-hidden bg-background'>
<iframe
title='源站错误页实时预览'
title={previewTitle}
sandbox=''
srcDoc={previewSrcDoc}
className='h-full w-full border-0 bg-background'