clean up providers ui

This commit is contained in:
miloschwartz
2026-08-03 16:06:28 -04:00
committed by Owen
parent b0edc6302e
commit 33b775e263
17 changed files with 1412 additions and 962 deletions
@@ -133,12 +133,14 @@ export type ResourceTargetAddressItemProps = {
updateTarget: (targetId: number, data: Partial<LocalTarget>) => void;
proxyTarget: LocalTarget;
isHttp: boolean;
allowedMethods?: ("http" | "https" | "h2c")[];
};
export function ResourceTargetAddressItem({
updateTarget,
proxyTarget,
isHttp
isHttp,
allowedMethods = ["http", "https", "h2c"]
}: ResourceTargetAddressItemProps) {
return (
<div className="flex items-center w-full" key={proxyTarget.targetId}>
@@ -157,9 +159,15 @@ export function ResourceTargetAddressItem({
{proxyTarget.method || "http"}
</SelectTrigger>
<SelectContent>
<SelectItem value="http">http</SelectItem>
<SelectItem value="https">https</SelectItem>
<SelectItem value="h2c">h2c</SelectItem>
{allowedMethods.includes("http") && (
<SelectItem value="http">http</SelectItem>
)}
{allowedMethods.includes("https") && (
<SelectItem value="https">https</SelectItem>
)}
{allowedMethods.includes("h2c") && (
<SelectItem value="h2c">h2c</SelectItem>
)}
</SelectContent>
</Select>
)}