mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +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
|
<NumberSetting
|
||||||
label="Autocomplete popup delay"
|
label="Autocomplete popup delay (ms)"
|
||||||
setting="autocompleteDelay"
|
setting="autocompleteDelay"
|
||||||
help="Delay the autocomplete popup by milliseconds. Enter 0 to disable the autocomplete delay."
|
help="Delay the autocomplete popup by milliseconds. Enter 0 to disable the autocomplete delay."
|
||||||
min={0}
|
min={0}
|
||||||
max={3000}
|
max={3000}
|
||||||
|
step={100}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -286,10 +287,11 @@ export const General: FC = () => {
|
|||||||
min={-1}
|
min={-1}
|
||||||
/>
|
/>
|
||||||
<NumberSetting
|
<NumberSetting
|
||||||
label="Request timeout"
|
label="Request timeout (ms)"
|
||||||
setting="timeout"
|
setting="timeout"
|
||||||
help="Enter the maximum seconds allotted before a request will timeout. Enter -1 to disable timeouts. "
|
help="Enter the maximum milliseconds allotted before a request will timeout. Enter 0 to disable timeouts. "
|
||||||
min={-1}
|
min={0}
|
||||||
|
step={100}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ interface Props {
|
|||||||
max?: InputHTMLAttributes<HTMLInputElement>['max'];
|
max?: InputHTMLAttributes<HTMLInputElement>['max'];
|
||||||
min: InputHTMLAttributes<HTMLInputElement>['min'];
|
min: InputHTMLAttributes<HTMLInputElement>['min'];
|
||||||
setting: SettingsOfType<number>;
|
setting: SettingsOfType<number>;
|
||||||
|
step?: InputHTMLAttributes<HTMLInputElement>['step'];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NumberSetting: FC<Props> = ({
|
export const NumberSetting: FC<Props> = ({
|
||||||
@ -21,6 +22,7 @@ export const NumberSetting: FC<Props> = ({
|
|||||||
max,
|
max,
|
||||||
min,
|
min,
|
||||||
setting,
|
setting,
|
||||||
|
step = 1,
|
||||||
}) => {
|
}) => {
|
||||||
const settings = useSelector(selectSettings);
|
const settings = useSelector(selectSettings);
|
||||||
|
|
||||||
@ -54,6 +56,7 @@ export const NumberSetting: FC<Props> = ({
|
|||||||
name={setting}
|
name={setting}
|
||||||
onChange={handleOnChange}
|
onChange={handleOnChange}
|
||||||
type={'number'}
|
type={'number'}
|
||||||
|
step={step}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user