polish: refine admin ui controls

This commit is contained in:
JetSprow
2026-05-01 00:58:46 +10:00
parent b8a7cab1af
commit 4dd2f9280f
30 changed files with 651 additions and 307 deletions

View File

@@ -43,7 +43,7 @@ export function ProxyNodeFields({
}) {
return (
<>
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("nodeId")}></Label>
<Select
value={nodeId}
@@ -71,7 +71,7 @@ export function ProxyNodeFields({
</Select>
</div>
<div>
<div className="space-y-1.5">
<Label id={fieldId("inboundIds-label")}></Label>
<input type="hidden" name="inboundIds" value={selectedInboundIds.join(",")} />
<div className="grid gap-2 sm:grid-cols-2" role="group" aria-labelledby={fieldId("inboundIds-label")}>
@@ -82,17 +82,17 @@ export function ProxyNodeFields({
key={inbound.id}
type="button"
className={cn(
"choice-card text-left px-3 py-2.5 text-sm",
"choice-card flex min-h-8 items-center justify-between gap-2 px-2.5 py-1.5 text-left text-xs leading-4",
selected
? "border-primary/30 bg-primary/10 text-primary"
: "hover:bg-muted/45",
)}
onClick={() => toggleInbound(inbound.id)}
>
<p className="font-medium">
<span className="shrink-0 font-medium leading-4">
{inbound.protocol} · {inbound.port}
</p>
<p className="text-xs text-muted-foreground">{inbound.tag}</p>
</span>
<span className="min-w-0 truncate text-[11px] leading-4 text-muted-foreground">{inbound.tag}</span>
</button>
);
})}
@@ -123,7 +123,7 @@ export function ProxyPricingFields({
return (
<>
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("pricingMode")}></Label>
<Select value={pricingMode} onValueChange={(value) => setPricingMode(value as PlanPricingMode)}>
<SelectTrigger id={fieldId("pricingMode")}>
@@ -139,8 +139,8 @@ export function ProxyPricingFields({
</div>
{pricingMode === "TRAFFIC_SLIDER" ? (
<div className="grid gap-4 sm:grid-cols-3">
<div>
<div className="grid gap-3 sm:grid-cols-3">
<div className="space-y-1.5">
<Label htmlFor={fieldId("pricePerGb")}>¥/GB</Label>
<Input
id={fieldId("pricePerGb")}
@@ -151,7 +151,7 @@ export function ProxyPricingFields({
placeholder="0.5"
/>
</div>
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("minTrafficGb")}> GB</Label>
<Input
id={fieldId("minTrafficGb")}
@@ -161,7 +161,7 @@ export function ProxyPricingFields({
placeholder="10"
/>
</div>
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("maxTrafficGb")}> GB</Label>
<Input
id={fieldId("maxTrafficGb")}
@@ -173,8 +173,8 @@ export function ProxyPricingFields({
</div>
</div>
) : (
<div className="grid gap-4 sm:grid-cols-2">
<div>
<div className="grid gap-3 sm:grid-cols-2">
<div className="space-y-1.5">
<Label htmlFor={fieldId("fixedTrafficGb")}>GB</Label>
<Input
id={fieldId("fixedTrafficGb")}
@@ -185,7 +185,7 @@ export function ProxyPricingFields({
placeholder="200"
/>
</div>
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("fixedPrice")}>¥</Label>
<Input
id={fieldId("fixedPrice")}
@@ -200,7 +200,7 @@ export function ProxyPricingFields({
</div>
)}
<div>
<div className="space-y-1.5">
<Label htmlFor={fieldId("totalTrafficGb")}>GB</Label>
<Input
id={fieldId("totalTrafficGb")}