-
setKeyword(event.target.value)}
- placeholder="搜索域名或 Zone…"
- disabled={disabled}
- />
+
+
setKeyword(event.target.value)}
+ placeholder="搜索域名或 Zone…"
+ disabled={disabled}
+ className="sm:flex-1"
+ />
+
setCreateOpen(true)}
+ >
+
+ 快捷新增域名
+
+
{filtered.length === 0 ? (
@@ -88,8 +121,10 @@ export function ZoneDomainSelector({
网站管理
{' '}
- 中添加 FQDN。
+ 中添加 FQDN,或使用「快捷新增域名」。
>
+ ) : availableDomains.length === 0 ? (
+ '没有可绑定的域名(其余域名已绑定其他路由)。可用「快捷新增域名」创建。'
) : (
'没有匹配的域名'
)}
@@ -97,9 +132,6 @@ export function ZoneDomainSelector({
) : (
{filtered.map((domain) => {
- const boundElsewhere =
- domain.proxy_route_id != null &&
- domain.proxy_route_id !== currentRouteId;
const checked = selected.has(domain.id);
const zoneRoot = zoneMap.get(domain.zone_id);
@@ -108,13 +140,12 @@ export function ZoneDomainSelector({
key={domain.id}
className={cn(
'flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted/60',
- boundElsewhere && 'cursor-not-allowed opacity-60',
- checked && !boundElsewhere && 'bg-muted/40',
+ checked && 'bg-muted/40',
)}
>
toggle(domain)}
className="mt-0.5"
/>
@@ -130,11 +161,6 @@ export function ZoneDomainSelector({
无证书
)}
- {boundElsewhere ? (
-
- 路由 #{domain.proxy_route_id}
-
- ) : null}
{zoneRoot ? (
@@ -156,6 +182,19 @@ export function ZoneDomainSelector({
})}
)}
+
+
{
+ // Auto-select the new domain for this route binding.
+ if (!value.includes(domain.id)) {
+ onChange([...value, domain.id].sort((a, b) => a - b));
+ }
+ await onDomainCreated?.(domain);
+ }}
+ />
);
}
diff --git a/frontend/app/(main)/proxy-routes/detail/components/domain-section.tsx b/frontend/app/(main)/proxy-routes/detail/components/domain-section.tsx
index 590ba675..5f49b217 100644
--- a/frontend/app/(main)/proxy-routes/detail/components/domain-section.tsx
+++ b/frontend/app/(main)/proxy-routes/detail/components/domain-section.tsx
@@ -91,7 +91,6 @@ export function DomainSection({ route, onRouteUpdate, onSavingChange }: DomainSe
proxy_route_id: route.id,
domain: bound.domain,
cert_id: bound.cert_id,
- remark: '',
created_at: '',
updated_at: '',
};
@@ -177,10 +176,14 @@ export function DomainSection({ route, onRouteUpdate, onSavingChange }: DomainSe
zones={zonesQuery.data ?? []}
currentRouteId={route.id}
disabled={domainsQuery.isLoading}
+ onDomainCreated={async () => {
+ await domainsQuery.refetch();
+ }}
/>
- 仅选择绑定关系;证书与 FQDN 请到对应 Zone 详情页管理。
+ 从已登记域名中勾选绑定;可用「快捷新增域名」在 Zone 下创建 FQDN
+ 并自动勾选。
diff --git a/frontend/app/(main)/proxy-routes/detail/components/proxy-section.tsx b/frontend/app/(main)/proxy-routes/detail/components/proxy-section.tsx
index 72401a90..5652c34d 100644
--- a/frontend/app/(main)/proxy-routes/detail/components/proxy-section.tsx
+++ b/frontend/app/(main)/proxy-routes/detail/components/proxy-section.tsx
@@ -35,7 +35,6 @@ const reverseProxySchema = z
tunnel_target_protocol: z.enum(['http', 'https']).optional(),
pages_project_id: z.string().optional(),
custom_headers_text: z.string(),
- remark: z.string().max(255, '备注不能超过 255 个字符'),
})
.superRefine((value, context) => {
if (value.upstream_type === 'direct') {
@@ -137,7 +136,6 @@ export function ProxySection({ route, onRouteUpdate, onSavingChange }: ProxySect
(route.tunnel_target_protocol as 'http' | 'https') || 'http',
pages_project_id: route.pages_project_id ? String(route.pages_project_id) : '',
custom_headers_text: customHeadersToText(route.custom_header_list),
- remark: route.remark || '',
},
});
@@ -152,7 +150,6 @@ export function ProxySection({ route, onRouteUpdate, onSavingChange }: ProxySect
(route.tunnel_target_protocol as 'http' | 'https') || 'http',
pages_project_id: route.pages_project_id ? String(route.pages_project_id) : '',
custom_headers_text: customHeadersToText(route.custom_header_list),
- remark: route.remark || '',
});
}, [form, route]);
@@ -210,7 +207,6 @@ export function ProxySection({ route, onRouteUpdate, onSavingChange }: ProxySect
origin_host: values.origin_host.trim(),
upstreams,
custom_headers: headers,
- remark: values.remark.trim(),
upstream_type: values.upstream_type,
tunnel_node_id:
values.upstream_type === 'tunnel' && values.tunnel_id
@@ -417,20 +413,6 @@ export function ProxySection({ route, onRouteUpdate, onSavingChange }: ProxySect
)}
/>
-
-
(
-
- 备注
-
-
-
-
-
- )}
- />
diff --git a/frontend/app/(main)/proxy-routes/page-client.tsx b/frontend/app/(main)/proxy-routes/page-client.tsx
index cac921e5..f6764a37 100644
--- a/frontend/app/(main)/proxy-routes/page-client.tsx
+++ b/frontend/app/(main)/proxy-routes/page-client.tsx
@@ -72,7 +72,6 @@ export function ProxyRoutesPageClient() {
getRoutePrimaryDomain(route),
...getRouteDomainNames(route),
route.origin_url,
- route.remark,
]
.join(' ')
.toLowerCase();
diff --git a/frontend/app/(main)/waf/components/helpers.ts b/frontend/app/(main)/waf/components/helpers.ts
index f8a8ebe8..a59a1859 100644
--- a/frontend/app/(main)/waf/components/helpers.ts
+++ b/frontend/app/(main)/waf/components/helpers.ts
@@ -81,7 +81,6 @@ export const emptyRuleGroupDraft: WAFRuleGroupPayload = {
region_blacklist: [],
pow_enabled: false,
pow_config: defaultPowConfig,
- remark: '',
};
export const defaultRuleModalState: RuleModalState = {
@@ -147,7 +146,6 @@ export function buildRuleGroupDraft(group: WAFRuleGroup | null): WAFRuleGroupPay
region_blacklist: group.region_blacklist ?? [],
pow_enabled: group.pow_enabled ?? false,
pow_config: group.pow_config ?? defaultPowConfig,
- remark: group.remark ?? '',
};
}
@@ -293,7 +291,6 @@ export function buildIPGroupPayloadFromGroup(
subscription_format: group.subscription_format ?? 'text',
subscription_mapping_rule: group.subscription_mapping_rule ?? '',
sync_interval_minutes: group.sync_interval_minutes || 1440,
- remark: group.remark ?? '',
};
}
diff --git a/frontend/app/(main)/waf/components/ip-group-dialog.tsx b/frontend/app/(main)/waf/components/ip-group-dialog.tsx
index 72c8dda5..06db4bc2 100644
--- a/frontend/app/(main)/waf/components/ip-group-dialog.tsx
+++ b/frontend/app/(main)/waf/components/ip-group-dialog.tsx
@@ -40,7 +40,6 @@ const ipGroupSchema = z
subscription_format: z.enum(['text', 'json']),
subscription_mapping_rule: z.string(),
sync_interval_minutes: z.number().int().min(5),
- remark: z.string().max(500),
})
.superRefine((value, context) => {
if (value.type === 'subscription' && !value.subscription_url.trim()) {
@@ -75,7 +74,6 @@ const defaultValues: IPGroupFormValues = {
subscription_format: 'text',
subscription_mapping_rule: '',
sync_interval_minutes: 1440,
- remark: '',
};
function buildFormValues(group: WAFIPGroup | null): IPGroupFormValues {
@@ -90,7 +88,6 @@ function buildFormValues(group: WAFIPGroup | null): IPGroupFormValues {
subscription_format: group.subscription_format ?? 'text',
subscription_mapping_rule: group.subscription_mapping_rule ?? '',
sync_interval_minutes: group.sync_interval_minutes || 1440,
- remark: group.remark ?? '',
};
}
@@ -109,7 +106,6 @@ function buildPayload(values: IPGroupFormValues): WAFIPGroupPayload {
subscription_format: values.subscription_format,
subscription_mapping_rule: values.subscription_mapping_rule.trim(),
sync_interval_minutes: values.sync_interval_minutes,
- remark: values.remark.trim(),
};
}
@@ -247,19 +243,6 @@ export function IPGroupDialog({
)}
/>
- (
-
- 备注
-
-
-
-
-
- )}
- />
{type === 'subscription' ? (
diff --git a/frontend/app/(main)/waf/components/rule-group-sheet.tsx b/frontend/app/(main)/waf/components/rule-group-sheet.tsx
index 3ef32696..18be615e 100644
--- a/frontend/app/(main)/waf/components/rule-group-sheet.tsx
+++ b/frontend/app/(main)/waf/components/rule-group-sheet.tsx
@@ -43,7 +43,6 @@ const ruleGroupSchema = z.object({
enabled: z.boolean(),
block_status_code: z.number().int().min(400).max(599),
block_response_body: z.string(),
- remark: z.string().max(500, '备注不能超过 500 个字符'),
pow_enabled: z.boolean(),
});
@@ -82,7 +81,6 @@ export function RuleGroupSheet({
enabled: true,
block_status_code: 418,
block_response_body: '',
- remark: '',
pow_enabled: false,
},
});
@@ -96,7 +94,6 @@ export function RuleGroupSheet({
enabled: draft.enabled,
block_status_code: draft.block_status_code,
block_response_body: draft.block_response_body,
- remark: draft.remark,
pow_enabled: draft.pow_enabled,
});
setRuleEntryOpen(false);
@@ -148,7 +145,6 @@ export function RuleGroupSheet({
enabled: values.enabled,
block_status_code: values.block_status_code,
block_response_body: values.block_response_body,
- remark: values.remark,
pow_enabled: values.pow_enabled,
};
try {
@@ -220,19 +216,6 @@ export function RuleGroupSheet({
)}
/>
-