mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-09 14:08:16 +02:00
clean up providers ui
This commit is contained in:
@@ -83,20 +83,14 @@ export function AiProviderTypeSelect({
|
||||
aria-expanded={open}
|
||||
disabled={disabled}
|
||||
className={cn(
|
||||
"w-full justify-between font-normal h-auto min-h-10 py-2",
|
||||
"w-full justify-between",
|
||||
!selected && "text-muted-foreground",
|
||||
className
|
||||
)}
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 flex-col items-start gap-0.5 text-left">
|
||||
<span className="truncate">
|
||||
{selected?.title ?? t("noneSelected")}
|
||||
</span>
|
||||
{selected?.description && (
|
||||
<span className="text-muted-foreground text-xs leading-snug truncate w-full">
|
||||
{selected.description}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span className="truncate text-left">
|
||||
{selected?.title ?? t("noneSelected")}
|
||||
</span>
|
||||
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user