chore: polish request timeout

This commit is contained in:
Anoop M D 2023-10-16 03:41:47 +05:30
parent 4c8ebe7765
commit cdfa839cf3
3 changed files with 31 additions and 30 deletions

View File

@ -30,7 +30,6 @@ const Font = ({ close }) => {
return (
<StyledWrapper>
<label className="block font-medium">Code Editor Font</label>
<div className="input-container">
<input
type="text"
className="block textbox mt-2 w-full"
@ -41,7 +40,6 @@ const Font = ({ close }) => {
onChange={handleInputChange}
defaultValue={codeFont}
/>
</div>
<div className="mt-10">
<button type="submit" className="submit btn btn-sm btn-secondary" onClick={handleSave}>

View File

@ -32,7 +32,7 @@ const General = ({ close }) => {
return (
<StyledWrapper>
<div className="flex items-center mt-2">
<label className="mr-2" style={{ minWidth: 200 }} htmlFor="ssl-cert-verification">
<label className="mr-2 select-none" style={{ minWidth: 200 }} htmlFor="ssl-cert-verification">
SSL Certificate Verification
</label>
<input
@ -40,18 +40,20 @@ const General = ({ close }) => {
type="checkbox"
checked={sslVerification}
onChange={() => setSslVerification(!sslVerification)}
className="mousetrap h-4 w-4 mr-0"
className="mousetrap mr-0"
/>
</div>
<div className="flex items-center mt-2">
<label className="mr-2" style={{ minWidth: 200 }}>
Request Timeout (in ms)
</label>
<div className="flex flex-col mt-6">
<label className="block font-medium select-none">Request Timeout (in ms)</label>
<input
value={timeout === 0 ? '' : timeout}
onChange={(e) => handleTimeoutChange(e.target.value)}
type="text"
className="block textbox w-1/6"
className="block textbox mt-2 w-1/4"
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
onChange={(e) => handleTimeoutChange(e.target.value)}
defaultValue={timeout === 0 ? '' : timeout}
/>
</div>

View File

@ -155,6 +155,10 @@ const registerNetworkIpc = (mainWindow) => {
}
}
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
// run pre-request script
const requestScript = compact([get(collectionRoot, 'request.script.req'), get(request, 'script.req')]).join(
os.EOL
@ -205,9 +209,6 @@ const registerNetworkIpc = (mainWindow) => {
cancelTokenUid
});
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
const httpsAgentRequestFields = {};
if (!sslVerification) {
@ -222,7 +223,7 @@ const registerNetworkIpc = (mainWindow) => {
};
// client certificate config
const clientCertConfig = get(brunoConfig, 'clientCertificates', []);
const clientCertConfig = get(brunoConfig, 'clientCertificates.certs', []);
for (clientCert of clientCertConfig) {
const domain = interpolateString(clientCert.domain, interpolationOptions);
@ -657,6 +658,11 @@ const registerNetworkIpc = (mainWindow) => {
}
}
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
// run pre-request script
const requestScript = compact([get(collectionRoot, 'request.script.req'), get(request, 'script.req')]).join(
os.EOL
@ -698,11 +704,6 @@ const registerNetworkIpc = (mainWindow) => {
...eventData
});
const preferences = getPreferences();
const timeout = get(preferences, 'request.timeout', 0);
request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
// proxy configuration
const brunoConfig = getBrunoConfig(collectionUid);
const proxyEnabled = get(brunoConfig, 'proxy.enabled', false);