2016-11-07 20:24:38 +00:00
|
|
|
import React, {PropTypes} from 'react';
|
|
|
|
|
|
|
|
const SettingsGeneral = ({settings, updateSetting}) => (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<input
|
2016-11-16 17:18:39 +00:00
|
|
|
id="setting-follow-redirects"
|
2016-11-07 20:24:38 +00:00
|
|
|
type="checkbox"
|
2016-11-16 17:18:39 +00:00
|
|
|
checked={settings.followRedirects}
|
|
|
|
onChange={e => updateSetting('followRedirects', e.target.checked)}
|
2016-11-07 20:24:38 +00:00
|
|
|
/>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<label htmlFor="setting-follow-redirects">
|
|
|
|
Follow redirects automatically
|
2016-11-07 20:24:38 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<div>
|
2016-11-07 20:24:38 +00:00
|
|
|
<input
|
2016-11-16 17:18:39 +00:00
|
|
|
id="setting-validate-ssl"
|
2016-11-07 20:24:38 +00:00
|
|
|
type="checkbox"
|
2016-11-16 17:18:39 +00:00
|
|
|
checked={settings.validateSSL}
|
|
|
|
onChange={e => updateSetting('validateSSL', e.target.checked)}
|
2016-11-07 20:24:38 +00:00
|
|
|
/>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<label htmlFor="setting-validate-ssl">
|
|
|
|
Validate SSL Certificates
|
2016-11-07 20:24:38 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<div>
|
2016-11-07 20:24:38 +00:00
|
|
|
<input
|
2016-11-16 17:18:39 +00:00
|
|
|
id="setting-show-passwords"
|
2016-11-07 20:24:38 +00:00
|
|
|
type="checkbox"
|
2016-11-16 17:18:39 +00:00
|
|
|
checked={settings.showPasswords}
|
|
|
|
onChange={e => updateSetting('showPasswords', e.target.checked)}
|
2016-11-07 20:24:38 +00:00
|
|
|
/>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<label htmlFor="setting-show-passwords">
|
|
|
|
Show passwords in plain-text
|
2016-11-07 20:24:38 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<div>
|
2016-11-07 20:24:38 +00:00
|
|
|
<input
|
2016-11-16 17:18:39 +00:00
|
|
|
id="setting-bulk-header-editor"
|
2016-11-07 20:24:38 +00:00
|
|
|
type="checkbox"
|
2016-11-16 17:18:39 +00:00
|
|
|
checked={settings.useBulkHeaderEditor}
|
|
|
|
onChange={e => updateSetting('useBulkHeaderEditor', e.target.checked)}
|
2016-11-07 20:24:38 +00:00
|
|
|
/>
|
|
|
|
|
2016-11-16 17:18:39 +00:00
|
|
|
<label htmlFor="setting-bulk-header-editor">
|
|
|
|
Use bulk header editor by default
|
2016-11-07 20:24:38 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2016-11-16 17:18:39 +00:00
|
|
|
<input
|
|
|
|
id="setting-stacked-layout"
|
|
|
|
type="checkbox"
|
|
|
|
checked={settings.forceVerticalLayout}
|
|
|
|
onChange={e => updateSetting('forceVerticalLayout', e.target.checked)}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<label htmlFor="setting-stacked-layout">
|
|
|
|
Always use vertical layout
|
2016-11-07 20:24:38 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<input
|
|
|
|
id="setting-editor-line-wrapping"
|
|
|
|
type="checkbox"
|
|
|
|
checked={settings.editorLineWrapping}
|
|
|
|
onChange={e => updateSetting('editorLineWrapping', e.target.checked)}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<label htmlFor="setting-editor-line-wrapping">
|
|
|
|
Wrap Long Lines
|
|
|
|
</label>
|
|
|
|
</div>
|
2016-11-16 17:18:39 +00:00
|
|
|
|
2016-11-29 01:47:04 +00:00
|
|
|
<div className="form-control form-control--outlined">
|
|
|
|
<label>Request/Response Font Size (px)
|
2016-11-07 20:24:38 +00:00
|
|
|
<input
|
|
|
|
type="number"
|
|
|
|
min={8}
|
|
|
|
max={20}
|
|
|
|
value={settings.editorFontSize}
|
|
|
|
onChange={e => updateSetting('editorFontSize', parseInt(e.target.value, 10))}
|
|
|
|
/>
|
2016-11-29 01:47:04 +00:00
|
|
|
</label>
|
2016-11-07 20:24:38 +00:00
|
|
|
</div>
|
|
|
|
|
2016-11-29 01:47:04 +00:00
|
|
|
<div className="form-control form-control--outlined">
|
|
|
|
<label>Request Timeout (ms) (0 for no timeout)
|
|
|
|
<input
|
|
|
|
type="number"
|
|
|
|
min={0}
|
|
|
|
value={settings.timeout}
|
|
|
|
onChange={e => updateSetting('timeout', parseInt(e.target.value, 10))}
|
|
|
|
/>
|
|
|
|
</label>
|
2016-11-16 17:18:39 +00:00
|
|
|
<div className="inline-block" style={{width: '50%'}}>
|
2016-11-29 01:47:04 +00:00
|
|
|
<div className="form-control form-control--outlined">
|
|
|
|
<label>HTTP Proxy
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
placeholder="localhost:8005"
|
|
|
|
defaultValue={settings.httpProxy}
|
|
|
|
onChange={e => updateSetting('httpProxy', e.target.value)}
|
|
|
|
/>
|
|
|
|
</label>
|
2016-11-16 17:18:39 +00:00
|
|
|
</div>
|
2016-11-07 20:24:38 +00:00
|
|
|
</div>
|
2016-11-16 17:18:39 +00:00
|
|
|
<div className="inline-block" style={{width: '50%'}}>
|
2016-11-27 21:42:38 +00:00
|
|
|
<div className="pad-left-sm">
|
2016-11-29 01:47:04 +00:00
|
|
|
<div className="form-control form-control--outlined">
|
|
|
|
<label>HTTPS Proxy
|
|
|
|
<input
|
|
|
|
placeholder="localhost:8005"
|
|
|
|
type="text"
|
|
|
|
defaultValue={settings.httpsProxy}
|
|
|
|
onChange={e => updateSetting('httpsProxy', e.target.value)}
|
|
|
|
/>
|
|
|
|
</label>
|
2016-11-16 17:18:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-11-07 20:24:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
SettingsGeneral.propTypes = {
|
|
|
|
settings: PropTypes.object.isRequired,
|
|
|
|
updateSetting: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SettingsGeneral;
|