diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 5cd7633d..ebbe7db6 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -26,6 +26,11 @@ sidebar: false - 支持 Service Worker 离线兜底:为启用 HTTPS 的网站下发 Service Worker 并缓存离线联系页,域名无法访问时浏览器展示联系站长页面,减少用户流失。可指定生效域名范围(仅对选中的 HTTPS 域名生效),配置位于「响应页面」-「联系页」,可在版本发布中批量生效。 +### 修复 + +- 修复 `SWOfflineDomains` 校验与版本比对逻辑:校验器严格拒绝 JSON `null` 输入,配置版本 Diff 比对改用 JSON 序列化避免 `strings.Join` 逗号分隔符歧义。 +- 修复 HTML 编辑器预览标题:`HtmlEditorWorkspace` 支持传入 `previewTitle`,离线联系页预览使用「离线联系页实时预览」。 + ### 改进 - 响应页面统一:将源站错误页与 Service Worker 离线兜底联系页整合至统一的「响应页面」(`/responses`)标签页中,移除原 `/error-pages` 独立路由。 diff --git a/frontend/app/(main)/responses/components/contact-page-tab.tsx b/frontend/app/(main)/responses/components/contact-page-tab.tsx index 3f8c09ec..84e67fb8 100644 --- a/frontend/app/(main)/responses/components/contact-page-tab.tsx +++ b/frontend/app/(main)/responses/components/contact-page-tab.tsx @@ -194,6 +194,7 @@ export function ContactPageTab({ preview={(html) => html} footerHint={null} showPreviewLink={false} + previewTitle='离线联系页实时预览' /> diff --git a/frontend/app/(main)/responses/components/error-page-tab.tsx b/frontend/app/(main)/responses/components/error-page-tab.tsx index f376c50c..7a126837 100644 --- a/frontend/app/(main)/responses/components/error-page-tab.tsx +++ b/frontend/app/(main)/responses/components/error-page-tab.tsx @@ -42,9 +42,7 @@ export function ErrorPageTab({ optionMap: Record; }) { const queryClient = useQueryClient(); - const [fields, setFields] = useState( - defaultErrorPageFields, - ); + const [fields, setFields] = useState(defaultErrorPageFields); const [tagError, setTagError] = useState(null); useEffect(() => { diff --git a/frontend/components/common/html-editor-workspace.tsx b/frontend/components/common/html-editor-workspace.tsx index a2369171..cfc061e4 100644 --- a/frontend/components/common/html-editor-workspace.tsx +++ b/frontend/components/common/html-editor-workspace.tsx @@ -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(null); const [editorWidthPercent, setEditorWidthPercent] = useState(48); @@ -145,7 +147,7 @@ export function HtmlEditorWorkspace({