mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Fix timeout setting in milliseconds (#4881)
* feat: make NumberSetting support step * fix: correct request timeout help message * make default step 1 for NumberInput * Provide similar experience for other inputs with ms Co-authored-by: tangweikun <tangweikun@corp.netease.com> Co-authored-by: gatzjames <jamesgatzos@gmail.com>
This commit is contained in:
parent
00a383690e
commit
1aca90a810
@ -138,11 +138,12 @@ export const General: FC = () => {
|
||||
/>
|
||||
|
||||
<NumberSetting
|
||||
label="Autocomplete popup delay"
|
||||
label="Autocomplete popup delay (ms)"
|
||||
setting="autocompleteDelay"
|
||||
help="Delay the autocomplete popup by milliseconds. Enter 0 to disable the autocomplete delay."
|
||||
min={0}
|
||||
max={3000}
|
||||
step={100}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -286,10 +287,11 @@ export const General: FC = () => {
|
||||
min={-1}
|
||||
/>
|
||||
<NumberSetting
|
||||
label="Request timeout"
|
||||
label="Request timeout (ms)"
|
||||
setting="timeout"
|
||||
help="Enter the maximum seconds allotted before a request will timeout. Enter -1 to disable timeouts. "
|
||||
min={-1}
|
||||
help="Enter the maximum milliseconds allotted before a request will timeout. Enter 0 to disable timeouts. "
|
||||
min={0}
|
||||
step={100}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -13,6 +13,7 @@ interface Props {
|
||||
max?: InputHTMLAttributes<HTMLInputElement>['max'];
|
||||
min: InputHTMLAttributes<HTMLInputElement>['min'];
|
||||
setting: SettingsOfType<number>;
|
||||
step?: InputHTMLAttributes<HTMLInputElement>['step'];
|
||||
}
|
||||
|
||||
export const NumberSetting: FC<Props> = ({
|
||||
@ -21,6 +22,7 @@ export const NumberSetting: FC<Props> = ({
|
||||
max,
|
||||
min,
|
||||
setting,
|
||||
step = 1,
|
||||
}) => {
|
||||
const settings = useSelector(selectSettings);
|
||||
|
||||
@ -54,6 +56,7 @@ export const NumberSetting: FC<Props> = ({
|
||||
name={setting}
|
||||
onChange={handleOnChange}
|
||||
type={'number'}
|
||||
step={step}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user