mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-23 04:04:35 +02:00
update proxy section in resource
This commit is contained in:
parent
0ae5ac9947
commit
d66739f69e
2 changed files with 14 additions and 129 deletions
|
@ -482,8 +482,8 @@
|
||||||
"targetAddr": "IP / Hostname",
|
"targetAddr": "IP / Hostname",
|
||||||
"targetPort": "Port",
|
"targetPort": "Port",
|
||||||
"targetProtocol": "Protocol",
|
"targetProtocol": "Protocol",
|
||||||
"targetTlsSettings": "HTTPS & TLS Settings",
|
"targetTlsSettings": "Secure Connection Configuration",
|
||||||
"targetTlsSettingsDescription": "Configure TLS settings for your resource",
|
"targetTlsSettingsDescription": "Configure SSL/TLS settings for your resource",
|
||||||
"targetTlsSettingsAdvanced": "Advanced TLS Settings",
|
"targetTlsSettingsAdvanced": "Advanced TLS Settings",
|
||||||
"targetTlsSni": "TLS Server Name (SNI)",
|
"targetTlsSni": "TLS Server Name (SNI)",
|
||||||
"targetTlsSniDescription": "The TLS Server Name to use for SNI. Leave empty to use the default.",
|
"targetTlsSniDescription": "The TLS Server Name to use for SNI. Leave empty to use the default.",
|
||||||
|
|
|
@ -560,111 +560,6 @@ export default function ReverseProxyTargets(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsContainer>
|
<SettingsContainer>
|
||||||
{resource.http && (
|
|
||||||
<SettingsSection>
|
|
||||||
<SettingsSectionHeader>
|
|
||||||
<SettingsSectionTitle>
|
|
||||||
{t('targetTlsSettings')}
|
|
||||||
</SettingsSectionTitle>
|
|
||||||
<SettingsSectionDescription>
|
|
||||||
{t('targetTlsSettingsDescription')}
|
|
||||||
</SettingsSectionDescription>
|
|
||||||
</SettingsSectionHeader>
|
|
||||||
<SettingsSectionBody>
|
|
||||||
<SettingsSectionForm>
|
|
||||||
<Form {...tlsSettingsForm}>
|
|
||||||
<form
|
|
||||||
onSubmit={tlsSettingsForm.handleSubmit(
|
|
||||||
saveTlsSettings
|
|
||||||
)}
|
|
||||||
className="space-y-4"
|
|
||||||
id="tls-settings-form"
|
|
||||||
>
|
|
||||||
<FormField
|
|
||||||
control={tlsSettingsForm.control}
|
|
||||||
name="ssl"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormControl>
|
|
||||||
<SwitchInput
|
|
||||||
id="ssl-toggle"
|
|
||||||
label={t('proxyEnableSSL')}
|
|
||||||
defaultChecked={
|
|
||||||
field.value
|
|
||||||
}
|
|
||||||
onCheckedChange={(
|
|
||||||
val
|
|
||||||
) => {
|
|
||||||
field.onChange(val);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Collapsible
|
|
||||||
open={isAdvancedOpen}
|
|
||||||
onOpenChange={setIsAdvancedOpen}
|
|
||||||
className="space-y-2"
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between space-x-4">
|
|
||||||
<CollapsibleTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
size="sm"
|
|
||||||
className="p-0 flex items-center justify-start gap-2 w-full"
|
|
||||||
>
|
|
||||||
<h4 className="text-sm font-semibold">
|
|
||||||
{t('targetTlsSettingsAdvanced')}
|
|
||||||
</h4>
|
|
||||||
<div>
|
|
||||||
<ChevronsUpDown className="h-4 w-4" />
|
|
||||||
<span className="sr-only">
|
|
||||||
{t('toggle')}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</Button>
|
|
||||||
</CollapsibleTrigger>
|
|
||||||
</div>
|
|
||||||
<CollapsibleContent className="space-y-2">
|
|
||||||
<FormField
|
|
||||||
control={
|
|
||||||
tlsSettingsForm.control
|
|
||||||
}
|
|
||||||
name="tlsServerName"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>
|
|
||||||
{t('targetTlsSni')}
|
|
||||||
</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input {...field} />
|
|
||||||
</FormControl>
|
|
||||||
<FormDescription>
|
|
||||||
{t('targetTlsSniDescription')}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</CollapsibleContent>
|
|
||||||
</Collapsible>
|
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
</SettingsSectionForm>
|
|
||||||
</SettingsSectionBody>
|
|
||||||
<SettingsSectionFooter>
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
loading={httpsTlsLoading}
|
|
||||||
form="tls-settings-form"
|
|
||||||
>
|
|
||||||
{t('targetTlsSubmit')}
|
|
||||||
</Button>
|
|
||||||
</SettingsSectionFooter>
|
|
||||||
</SettingsSection>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<SettingsSection>
|
<SettingsSection>
|
||||||
<SettingsSectionHeader>
|
<SettingsSectionHeader>
|
||||||
<SettingsSectionTitle>
|
<SettingsSectionTitle>
|
||||||
|
@ -891,10 +786,10 @@ export default function ReverseProxyTargets(props: {
|
||||||
<SettingsSection>
|
<SettingsSection>
|
||||||
<SettingsSectionHeader>
|
<SettingsSectionHeader>
|
||||||
<SettingsSectionTitle>
|
<SettingsSectionTitle>
|
||||||
Secure Connection Configuration
|
{t('targetTlsSettings')}
|
||||||
</SettingsSectionTitle>
|
</SettingsSectionTitle>
|
||||||
<SettingsSectionDescription>
|
<SettingsSectionDescription>
|
||||||
Configure SSL/TLS settings for your resource
|
{t('targetTlsSettingsDescription')}
|
||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
|
@ -915,7 +810,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SwitchInput
|
<SwitchInput
|
||||||
id="ssl-toggle"
|
id="ssl-toggle"
|
||||||
label="Enable SSL (https)"
|
label={t('proxyEnableSSL')}
|
||||||
defaultChecked={
|
defaultChecked={
|
||||||
field.value
|
field.value
|
||||||
}
|
}
|
||||||
|
@ -944,8 +839,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
className="p-0 flex items-center justify-start gap-2 w-full"
|
className="p-0 flex items-center justify-start gap-2 w-full"
|
||||||
>
|
>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Advanced TLS
|
{t('targetTlsSettingsAdvanced')}
|
||||||
Settings
|
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<ChevronsUpDown className="h-4 w-4" />
|
<ChevronsUpDown className="h-4 w-4" />
|
||||||
|
@ -965,8 +859,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>
|
<FormLabel>
|
||||||
TLS Server Name
|
{t('targetTlsSni')}
|
||||||
(SNI)
|
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
|
@ -974,11 +867,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
The TLS Server
|
{t('targetTlsSniDescription')}
|
||||||
Name to use for
|
|
||||||
SNI. Leave empty
|
|
||||||
to use the
|
|
||||||
default.
|
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
@ -996,18 +885,17 @@ export default function ReverseProxyTargets(props: {
|
||||||
loading={httpsTlsLoading}
|
loading={httpsTlsLoading}
|
||||||
form="tls-settings-form"
|
form="tls-settings-form"
|
||||||
>
|
>
|
||||||
Save Settings
|
{t('targetTlsSubmit')}
|
||||||
</Button>
|
</Button>
|
||||||
</SettingsSectionFooter>
|
</SettingsSectionFooter>
|
||||||
</SettingsSection>
|
</SettingsSection>
|
||||||
<SettingsSection>
|
<SettingsSection>
|
||||||
<SettingsSectionHeader>
|
<SettingsSectionHeader>
|
||||||
<SettingsSectionTitle>
|
<SettingsSectionTitle>
|
||||||
Additional Proxy Settings
|
{t('proxyAdditional')}
|
||||||
</SettingsSectionTitle>
|
</SettingsSectionTitle>
|
||||||
<SettingsSectionDescription>
|
<SettingsSectionDescription>
|
||||||
Configure how your resource handles proxy
|
{t('proxyAdditionalDescription')}
|
||||||
settings
|
|
||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
|
@ -1026,16 +914,13 @@ export default function ReverseProxyTargets(props: {
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>
|
<FormLabel>
|
||||||
Custom Host Header
|
{t('proxyCustomHeader')}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} />
|
<Input {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
The host header to set
|
{t('proxyCustomHeaderDescription')}
|
||||||
when proxying requests.
|
|
||||||
Leave empty to use the
|
|
||||||
default.
|
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
@ -1051,7 +936,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
loading={proxySettingsLoading}
|
loading={proxySettingsLoading}
|
||||||
form="proxy-settings-form"
|
form="proxy-settings-form"
|
||||||
>
|
>
|
||||||
Save Settings
|
{t('targetTlsSubmit')}
|
||||||
</Button>
|
</Button>
|
||||||
</SettingsSectionFooter>
|
</SettingsSectionFooter>
|
||||||
</SettingsSection>
|
</SettingsSection>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue