mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:18:31 +02:00
Clarify proxy HTTP/HTTPS setting
This commit is contained in:
@@ -2,6 +2,7 @@ import { patchModel, settingsAtom } from '@yaakapp-internal/models';
|
|||||||
import { useAtomValue } from 'jotai';
|
import { useAtomValue } from 'jotai';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Checkbox } from '../core/Checkbox';
|
import { Checkbox } from '../core/Checkbox';
|
||||||
|
import { InlineCode } from '../core/InlineCode';
|
||||||
import { PlainInput } from '../core/PlainInput';
|
import { PlainInput } from '../core/PlainInput';
|
||||||
import { Select } from '../core/Select';
|
import { Select } from '../core/Select';
|
||||||
import { Separator } from '../core/Separator';
|
import { Separator } from '../core/Separator';
|
||||||
@@ -62,7 +63,11 @@ export function SettingsProxy() {
|
|||||||
<HStack space={1.5}>
|
<HStack space={1.5}>
|
||||||
<PlainInput
|
<PlainInput
|
||||||
size="sm"
|
size="sm"
|
||||||
label="HTTP"
|
label={
|
||||||
|
<>
|
||||||
|
Proxy for <InlineCode>http://</InlineCode> traffic
|
||||||
|
</>
|
||||||
|
}
|
||||||
placeholder="localhost:9090"
|
placeholder="localhost:9090"
|
||||||
defaultValue={settings.proxy?.http}
|
defaultValue={settings.proxy?.http}
|
||||||
onChange={async (http) => {
|
onChange={async (http) => {
|
||||||
@@ -83,7 +88,11 @@ export function SettingsProxy() {
|
|||||||
/>
|
/>
|
||||||
<PlainInput
|
<PlainInput
|
||||||
size="sm"
|
size="sm"
|
||||||
label="HTTPS"
|
label={
|
||||||
|
<>
|
||||||
|
Proxy for <InlineCode>https://</InlineCode> traffic
|
||||||
|
</>
|
||||||
|
}
|
||||||
placeholder="localhost:9090"
|
placeholder="localhost:9090"
|
||||||
defaultValue={settings.proxy?.https}
|
defaultValue={settings.proxy?.https}
|
||||||
onChange={async (https) => {
|
onChange={async (https) => {
|
||||||
|
|||||||
@@ -16,11 +16,15 @@ export type PlainInputProps = Omit<InputProps, 'wrapLines' | 'onKeyDown' | 'type
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function PlainInput({
|
export function PlainInput({
|
||||||
|
autoFocus,
|
||||||
|
autoSelect,
|
||||||
className,
|
className,
|
||||||
containerClassName,
|
containerClassName,
|
||||||
defaultValue,
|
defaultValue,
|
||||||
forceUpdateKey,
|
forceUpdateKey,
|
||||||
|
help,
|
||||||
hideLabel,
|
hideLabel,
|
||||||
|
hideObscureToggle,
|
||||||
label,
|
label,
|
||||||
labelClassName,
|
labelClassName,
|
||||||
labelPosition = 'top',
|
labelPosition = 'top',
|
||||||
@@ -29,19 +33,16 @@ export function PlainInput({
|
|||||||
onBlur,
|
onBlur,
|
||||||
onChange,
|
onChange,
|
||||||
onFocus,
|
onFocus,
|
||||||
|
onFocusRaw,
|
||||||
|
onKeyDownCapture,
|
||||||
onPaste,
|
onPaste,
|
||||||
|
placeholder,
|
||||||
required,
|
required,
|
||||||
rightSlot,
|
rightSlot,
|
||||||
hideObscureToggle,
|
|
||||||
size = 'md',
|
size = 'md',
|
||||||
type = 'text',
|
|
||||||
tint,
|
tint,
|
||||||
|
type = 'text',
|
||||||
validate,
|
validate,
|
||||||
autoSelect,
|
|
||||||
placeholder,
|
|
||||||
autoFocus,
|
|
||||||
onKeyDownCapture,
|
|
||||||
onFocusRaw,
|
|
||||||
}: PlainInputProps) {
|
}: PlainInputProps) {
|
||||||
const [obscured, setObscured] = useStateWithDeps(type === 'password', [type]);
|
const [obscured, setObscured] = useStateWithDeps(type === 'password', [type]);
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
@@ -101,7 +102,7 @@ export function PlainInput({
|
|||||||
labelPosition === 'top' && 'flex-row gap-0.5',
|
labelPosition === 'top' && 'flex-row gap-0.5',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Label htmlFor={id} className={labelClassName} visuallyHidden={hideLabel} required={required}>
|
<Label htmlFor={id} className={labelClassName} visuallyHidden={hideLabel} required={required} help={help}>
|
||||||
{label}
|
{label}
|
||||||
</Label>
|
</Label>
|
||||||
<HStack
|
<HStack
|
||||||
|
|||||||
Reference in New Issue
Block a user