fix(frontend): optimization

This commit is contained in:
ryan
2026-08-09 09:14:54 +08:00
parent bd2183c8bb
commit 0c22e76f4b
8 changed files with 25 additions and 21 deletions
@@ -94,7 +94,7 @@ export function ErrorPageTab({
<div className='space-y-1.5'>
<CardTitle className='text-base'>触发策略</CardTitle>
<CardDescription>
配置源站错误页的启用条件与触发状态码。修改后需点击保存。
配置源站错误页的启用条件与触发状态码。
</CardDescription>
</div>
<Button
@@ -133,8 +133,7 @@ export function ErrorPageTab({
<div className='space-y-1'>
<Label className='text-sm font-medium'>仅针对 GET 请求</Label>
<p className='text-sm text-muted-foreground'>
开启后仅对 GET 请求的匹配错误状态码返回自定义错误页;POST/PUT
等其它方法直接透传源站响应。
开启后仅对 GET 请求的匹配错误状态码返回自定义错误页。
</p>
</div>
<Switch
@@ -157,8 +156,7 @@ export function ErrorPageTab({
触发状态码
</Label>
<p className='text-sm text-muted-foreground'>
支持单码(如 502)或闭区间(如 500-599),范围 400–599。默认
500-599。
支持单码(如 502)或闭区间(如 500-599)。
</p>
</div>
<TagsInput
@@ -189,7 +187,7 @@ export function ErrorPageTab({
<Button variant='outline' size='sm' asChild>
<Link href='/responses/error-page/preview'>
<Expand className='size-3.5' />
真实预览
预览
</Link>
</Button>
<Button size='sm' asChild>
@@ -91,10 +91,10 @@ export function OfflinePageTab({
<Card className='border-dashed shadow-none'>
<CardHeader className='flex flex-row items-start justify-between gap-4 space-y-0'>
<div className='space-y-1.5'>
<CardTitle className='text-base'>离线兜底</CardTitle>
<CardTitle className='text-base'>离线页</CardTitle>
<CardDescription>
启用后给启用 HTTPS 的网站下发 Service
Worker,域名被墙时浏览器从缓存展示此离线页。
Worker,域名无法访问时浏览器从缓存展示此离线页。
</CardDescription>
</div>
<Button
@@ -115,10 +115,10 @@ export function OfflinePageTab({
<div className='flex items-start justify-between gap-6'>
<div className='space-y-1'>
<Label className='text-sm font-medium'>
启用 Service Worker 离线兜底
启用 Service Worker 离线页
</Label>
<p className='text-sm text-muted-foreground'>
仅对 HTTPS 网站生效;未启用的站点不受影响。
仅对 HTTPS 网站生效。
</p>
</div>
<Switch
@@ -126,7 +126,7 @@ export function OfflinePageTab({
onCheckedChange={(enabled) =>
setFields((prev) => ({ ...prev, enabled }))
}
aria-label='启用离线兜底'
aria-label='启用离线页'
className='mt-0.5 shrink-0'
/>
</div>
@@ -194,7 +194,7 @@ export function OfflinePageTab({
<Button variant='outline' size='sm' asChild>
<Link href='/responses/offline/preview'>
<Expand className='size-3.5' />
真实预览
预览
</Link>
</Button>
<Button size='sm' asChild>
@@ -87,7 +87,7 @@ export default function ErrorPagePreviewPage() {
</Link>
</Button>
<div className='min-w-0'>
<p className='text-sm font-semibold truncate'>错误页真实预览</p>
<p className='text-sm font-semibold truncate'>错误页预览</p>
<p className='text-[11px] text-muted-foreground font-mono truncate'>
{'{{status}}'}→502 · {'{{host}}'}→example.com · 全屏展示
</p>
@@ -108,7 +108,7 @@ export default function ErrorPagePreviewPage() {
</div>
</div>
<iframe
title='源站错误页真实预览'
title='源站错误页预览'
sandbox=''
srcDoc={previewSrcDoc}
className='flex-1 w-full border-0 bg-background min-h-0'
@@ -88,7 +88,7 @@ export default function OfflinePagePreviewPage() {
</Link>
</Button>
<div className='min-w-0'>
<p className='text-sm font-semibold truncate'>离线页真实预览</p>
<p className='text-sm font-semibold truncate'>离线页预览</p>
<p className='text-[11px] text-muted-foreground font-mono truncate'>
全屏展示
</p>
@@ -109,7 +109,7 @@ export default function OfflinePagePreviewPage() {
</div>
</div>
<iframe
title='离线页真实预览'
title='离线页预览'
sandbox=''
srcDoc={html}
className='flex-1 w-full border-0 bg-background min-h-0'
+1 -1
View File
@@ -115,7 +115,7 @@ function ResponsesPageContent() {
<div>
<h1 className='text-2xl font-semibold tracking-tight'>响应页面</h1>
<p className='text-sm text-muted-foreground'>
配置源站错误页与离线页。保存后需发布配置版本后生效。
配置源站错误页与离线页。
</p>
</div>
</div>
@@ -139,7 +139,7 @@ export function HtmlEditorWorkspace({
>
<Link href='/error-pages/preview'>
<Expand className='size-3' />
真实预览
预览
</Link>
</Button>
) : null}