feat(ui): different provider range of accesses in AccessList

This commit is contained in:
Fu Diwei
2025-03-30 21:04:17 +08:00
parent 4ab6b72e6f
commit a72737fdd5
5 changed files with 65 additions and 15 deletions

View File

@@ -292,6 +292,7 @@ const AccessForm = forwardRef<AccessFormInstance, AccessFormProps>(({ className,
}}
disabled={scene !== "add"}
placeholder={providerPlaceholder}
showOptionTags={range == null || range === "both-dns-hosting"}
showSearch={!disabled}
/>
</Form.Item>

View File

@@ -40,7 +40,7 @@ const AccessProviderSelect = ({ filter, showOptionTags, ...props }: AccessProvid
{t(provider?.name ?? "")}
</Typography.Text>
</Space>
{!showOptionTags && (
{showOptionTags && (
<div>
{provider?.usages?.includes(ACCESS_USAGES.DNS) && <Tag color="peru">{t("access.props.provider.usage.dns")}</Tag>}
{provider?.usages?.includes(ACCESS_USAGES.HOSTING) && <Tag color="royalblue">{t("access.props.provider.usage.hosting")}</Tag>}