hide method selector on raw resources

This commit is contained in:
miloschwartz
2025-10-20 17:15:35 -07:00
parent ae902da913
commit 08ddba25d0
2 changed files with 50 additions and 42 deletions

View File

@@ -1118,28 +1118,32 @@ export default function ReverseProxyTargets(props: {
</PopoverContent> </PopoverContent>
</Popover> </Popover>
<Select {resource.http && (
defaultValue={row.original.method ?? "http"} <Select
onValueChange={(value) => defaultValue={row.original.method ?? "http"}
updateTarget(row.original.targetId, { onValueChange={(value) =>
...row.original, updateTarget(row.original.targetId, {
method: value ...row.original,
}) method: value
} })
> }
<SelectTrigger className="h-8 px-2 w-[70px] text-sm font-normal border-none bg-transparent shadow-none focus:ring-0 focus:outline-none focus-visible:ring-0 data-[state=open]:bg-transparent"> >
{row.original.method || "http"} <SelectTrigger className="h-8 px-2 w-[70px] text-sm font-normal border-none bg-transparent shadow-none focus:ring-0 focus:outline-none focus-visible:ring-0 data-[state=open]:bg-transparent">
</SelectTrigger> {row.original.method || "http"}
<SelectContent> </SelectTrigger>
<SelectItem value="http">http</SelectItem> <SelectContent>
<SelectItem value="https">https</SelectItem> <SelectItem value="http">http</SelectItem>
<SelectItem value="h2c">h2c</SelectItem> <SelectItem value="https">https</SelectItem>
</SelectContent> <SelectItem value="h2c">h2c</SelectItem>
</Select> </SelectContent>
</Select>
)}
<div className="flex items-center justify-center bg-muted px-2 h-9"> {resource.http && (
{"://"} <div className="flex items-center justify-center bg-muted px-2 h-9">
</div> {"://"}
</div>
)}
<Input <Input
defaultValue={row.original.ip} defaultValue={row.original.ip}

View File

@@ -1034,28 +1034,32 @@ export default function Page() {
</PopoverContent> </PopoverContent>
</Popover> </Popover>
<Select {isHttp && (
defaultValue={row.original.method ?? "http"} <Select
onValueChange={(value) => defaultValue={row.original.method ?? "http"}
updateTarget(row.original.targetId, { onValueChange={(value) =>
...row.original, updateTarget(row.original.targetId, {
method: value ...row.original,
}) method: value
} })
> }
<SelectTrigger className="h-8 px-2 w-[70px] border-none bg-transparent shadow-none focus:ring-0 focus:outline-none focus-visible:ring-0 data-[state=open]:bg-transparent"> >
{row.original.method || "http"} <SelectTrigger className="h-8 px-2 w-[70px] border-none bg-transparent shadow-none focus:ring-0 focus:outline-none focus-visible:ring-0 data-[state=open]:bg-transparent">
</SelectTrigger> {row.original.method || "http"}
<SelectContent> </SelectTrigger>
<SelectItem value="http">http</SelectItem> <SelectContent>
<SelectItem value="https">https</SelectItem> <SelectItem value="http">http</SelectItem>
<SelectItem value="h2c">h2c</SelectItem> <SelectItem value="https">https</SelectItem>
</SelectContent> <SelectItem value="h2c">h2c</SelectItem>
</Select> </SelectContent>
</Select>
)}
<div className="flex items-center justify-center bg-muted px-2 h-9"> {isHttp && (
{"://"} <div className="flex items-center justify-center bg-muted px-2 h-9">
</div> {"://"}
</div>
)}
<Input <Input
defaultValue={row.original.ip} defaultValue={row.original.ip}