mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Adds helper in dev-only settings for launch counter (#4350)
This commit is contained in:
parent
0ae0dd4944
commit
42046206d9
@ -13,7 +13,7 @@ import { Modal } from '../base/modal';
|
|||||||
import { ModalBody } from '../base/modal-body';
|
import { ModalBody } from '../base/modal-body';
|
||||||
import { ModalHeader } from '../base/modal-header';
|
import { ModalHeader } from '../base/modal-header';
|
||||||
import { Account } from '../settings/account';
|
import { Account } from '../settings/account';
|
||||||
import General from '../settings/general';
|
import { General } from '../settings/general';
|
||||||
import { ImportExport } from '../settings/import-export';
|
import { ImportExport } from '../settings/import-export';
|
||||||
import { Plugins } from '../settings/plugins';
|
import { Plugins } from '../settings/plugins';
|
||||||
import { Shortcuts } from '../settings/shortcuts';
|
import { Shortcuts } from '../settings/shortcuts';
|
||||||
@ -106,10 +106,7 @@ export class SettingsModal extends PureComponent<Props, State> {
|
|||||||
</Tab>
|
</Tab>
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanel className="react-tabs__tab-panel pad scrollable">
|
<TabPanel className="react-tabs__tab-panel pad scrollable">
|
||||||
<General
|
<General hideModal={this.hide} />
|
||||||
settings={settings}
|
|
||||||
hideModal={this.hide}
|
|
||||||
/>
|
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel className="react-tabs__tab-panel pad scrollable">
|
<TabPanel className="react-tabs__tab-panel pad scrollable">
|
||||||
<ImportExport
|
<ImportExport
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { autoBindMethodsForReact } from 'class-autobind-decorator';
|
|
||||||
import { EnvironmentHighlightColorStyle, HttpVersion, HttpVersions, UpdateChannel } from 'insomnia-common';
|
import { EnvironmentHighlightColorStyle, HttpVersion, HttpVersions, UpdateChannel } from 'insomnia-common';
|
||||||
import { Tooltip } from 'insomnia-components';
|
import { Tooltip } from 'insomnia-components';
|
||||||
import React, { FC, Fragment, PureComponent } from 'react';
|
import React, { FC, Fragment, useCallback } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
|
||||||
|
|
||||||
import { trackEvent } from '../../../common/analytics';
|
import { trackEvent } from '../../../common/analytics';
|
||||||
import type { GlobalActivity } from '../../../common/constants';
|
|
||||||
import {
|
import {
|
||||||
ACTIVITY_MIGRATION,
|
ACTIVITY_MIGRATION,
|
||||||
AUTOBIND_CFG,
|
|
||||||
EditorKeyMap,
|
EditorKeyMap,
|
||||||
isDevelopment,
|
isDevelopment,
|
||||||
isMac,
|
isMac,
|
||||||
@ -21,9 +17,10 @@ import {
|
|||||||
} from '../../../common/constants';
|
} from '../../../common/constants';
|
||||||
import { docsKeyMaps } from '../../../common/documentation';
|
import { docsKeyMaps } from '../../../common/documentation';
|
||||||
import { strings } from '../../../common/strings';
|
import { strings } from '../../../common/strings';
|
||||||
import type { Settings } from '../../../models/settings';
|
import * as models from '../../../models';
|
||||||
import { initNewOAuthSession } from '../../../network/o-auth-2/misc';
|
import { initNewOAuthSession } from '../../../network/o-auth-2/misc';
|
||||||
import * as globalActions from '../../redux/modules/global';
|
import { setActiveActivity } from '../../redux/modules/global';
|
||||||
|
import { selectSettings, selectStats } from '../../redux/selectors';
|
||||||
import { Link } from '../base/link';
|
import { Link } from '../base/link';
|
||||||
import { CheckForUpdatesButton } from '../check-for-updates-button';
|
import { CheckForUpdatesButton } from '../check-for-updates-button';
|
||||||
import { HelpTooltip } from '../help-tooltip';
|
import { HelpTooltip } from '../help-tooltip';
|
||||||
@ -46,432 +43,451 @@ const RestartTooltip: FC<{ message: string }> = ({ message }) => (
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
interface Props {
|
const DevelopmentOnlySettings: FC = () => {
|
||||||
settings: Settings;
|
const { launches } = useSelector(selectStats);
|
||||||
hideModal: () => void;
|
|
||||||
handleSetActiveActivity: (activity?: GlobalActivity) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
@autoBindMethodsForReact(AUTOBIND_CFG)
|
const onChangeLaunches = useCallback(async event => {
|
||||||
class General extends PureComponent<Props> {
|
const launches = parseInt(event.target.value, 10);
|
||||||
_handleStartMigration() {
|
await models.stats.update({ launches });
|
||||||
trackEvent('Data', 'Migration', 'Manual');
|
}, []);
|
||||||
this.props.handleSetActiveActivity(ACTIVITY_MIGRATION);
|
|
||||||
this.props.hideModal();
|
if (!isDevelopment()) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
return (
|
||||||
const { settings } = this.props;
|
<>
|
||||||
return (
|
<hr className="pad-top" />
|
||||||
<div className="pad-bottom">
|
<h2>Development</h2>
|
||||||
<div className="row-fill row-fill--top">
|
|
||||||
<div>
|
<div className="form-row pad-top-sm">
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
label="Use bulk header editor"
|
label="Has been prompted to migrate from Insomnia Designer"
|
||||||
setting="useBulkHeaderEditor"
|
setting="hasPromptedToMigrateFromDesigner"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<BooleanSetting
|
||||||
|
label="Has seen analytics prompt"
|
||||||
|
setting="hasPromptedAnalytics"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<div className="form-control form-control--outlined">
|
||||||
|
<label>
|
||||||
|
Stats.Launches
|
||||||
|
<HelpTooltip className="space-left">If you need this to be a certain value after restarting the app, then just subtract one from your desired value before you restart. For example, if you want to simulate first launch, set it to 0 and when you reboot it will be 1. Note that Shift+F5 does not actually restart since it only refreshes the renderer and thus will not increment `Stats.launches`. This is because Stats.launches is incremented in the main process whereas refreshing the app with Shift+F5 doesn't retrigger that code path.</HelpTooltip>
|
||||||
|
<input
|
||||||
|
value={String(launches)}
|
||||||
|
min={0}
|
||||||
|
name="launches"
|
||||||
|
onChange={onChangeLaunches}
|
||||||
|
type={'number'}
|
||||||
/>
|
/>
|
||||||
<BooleanSetting
|
</label>
|
||||||
label="Use vertical layout"
|
|
||||||
setting="forceVerticalLayout"
|
|
||||||
help="Stack application panels (e.g. request / response) vertically instead of horizontally."
|
|
||||||
/>
|
|
||||||
<BooleanSetting
|
|
||||||
label={<RestartTooltip message="Show variable source and value" />}
|
|
||||||
help="If checked, reveals the environment variable source and value in the template tag. Otherwise, hover over the template tag to see the source and value."
|
|
||||||
setting="showVariableSourceAndValue"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Reveal passwords"
|
|
||||||
setting="showPasswords"
|
|
||||||
/>
|
|
||||||
{!isMac() && (
|
|
||||||
<BooleanSetting
|
|
||||||
label="Hide menu bar"
|
|
||||||
setting="autoHideMenuBar"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<BooleanSetting
|
|
||||||
label={<RestartTooltip message="Raw template syntax" />}
|
|
||||||
setting="nunjucksPowerUserMode"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
<div className="row-fill row-fill--top pad-top-sm">
|
interface Props {
|
||||||
<EnumSetting<EnvironmentHighlightColorStyle>
|
hideModal: () => void;
|
||||||
label="Environment Highlight Style"
|
}
|
||||||
help="Configures the appearance of environment's color indicator"
|
|
||||||
setting="environmentHighlightColorStyle"
|
export const General: FC<Props> = ({ hideModal }) => {
|
||||||
values={[
|
const dispatch = useDispatch();
|
||||||
{ value:'sidebar-indicator', name: 'Sidebar indicator' },
|
const settings = useSelector(selectSettings);
|
||||||
{ value:'sidebar-edge', name: 'Sidebar edge' },
|
|
||||||
{ value:'window-top', name: 'Window top' },
|
const handleStartMigration = useCallback(() => {
|
||||||
{ value:'window-bottom', name: 'Window bottom' },
|
trackEvent('Data', 'Migration', 'Manual');
|
||||||
{ value:'window-left', name: 'Window left' },
|
dispatch(setActiveActivity(ACTIVITY_MIGRATION));
|
||||||
{ value:'window-right', name: 'Window right' },
|
hideModal();
|
||||||
]}
|
}, [hideModal, dispatch]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="pad-bottom">
|
||||||
|
<div className="row-fill row-fill--top">
|
||||||
|
<div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Use bulk header editor"
|
||||||
|
setting="useBulkHeaderEditor"
|
||||||
/>
|
/>
|
||||||
|
<BooleanSetting
|
||||||
<NumberSetting
|
label="Use vertical layout"
|
||||||
label="Autocomplete popup delay"
|
setting="forceVerticalLayout"
|
||||||
setting="autocompleteDelay"
|
help="Stack application panels (e.g. request / response) vertically instead of horizontally."
|
||||||
help="Configure the autocomplete popup delay in milliseconds (0 to disable)"
|
/>
|
||||||
min={0}
|
<BooleanSetting
|
||||||
max={3000}
|
label={<RestartTooltip message="Show variable source and value" />}
|
||||||
|
help="If checked, reveals the environment variable source and value in the template tag. Otherwise, hover over the template tag to see the source and value."
|
||||||
|
setting="showVariableSourceAndValue"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
<hr className="pad-top" />
|
<BooleanSetting
|
||||||
<h2>Font</h2>
|
label="Reveal passwords"
|
||||||
|
setting="showPasswords"
|
||||||
<div className="row-fill row-fill--top">
|
/>
|
||||||
<div>
|
{!isMac() && (
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
label="Indent with tabs"
|
label="Hide menu bar"
|
||||||
setting="editorIndentWithTabs"
|
setting="autoHideMenuBar"
|
||||||
/>
|
/>
|
||||||
<BooleanSetting
|
)}
|
||||||
label="Wrap text editor lines"
|
<BooleanSetting
|
||||||
setting="editorLineWrapping"
|
label={<RestartTooltip message="Raw template syntax" />}
|
||||||
/>
|
setting="nunjucksPowerUserMode"
|
||||||
</div>
|
/>
|
||||||
<div>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Font ligatures"
|
|
||||||
setting="fontVariantLigatures"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="form-row pad-top-sm">
|
<div className="row-fill row-fill--top pad-top-sm">
|
||||||
<div className="form-row">
|
<EnumSetting<EnvironmentHighlightColorStyle>
|
||||||
<TextSetting
|
label="Environment Highlight Style"
|
||||||
label="Interface Font"
|
help="Configures the appearance of environment's color indicator"
|
||||||
setting="fontInterface"
|
setting="environmentHighlightColorStyle"
|
||||||
help="Comma-separated list of fonts. If left empty, takes system defaults."
|
values={[
|
||||||
placeholder="-- System Default --"
|
{ value:'sidebar-indicator', name: 'Sidebar indicator' },
|
||||||
/>
|
{ value:'sidebar-edge', name: 'Sidebar edge' },
|
||||||
<NumberSetting
|
{ value:'window-top', name: 'Window top' },
|
||||||
label="Interface Font Size (px)"
|
{ value:'window-bottom', name: 'Window bottom' },
|
||||||
setting="fontSize"
|
{ value:'window-left', name: 'Window left' },
|
||||||
min={MIN_INTERFACE_FONT_SIZE}
|
{ value:'window-right', name: 'Window right' },
|
||||||
max={MAX_INTERFACE_FONT_SIZE}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
<NumberSetting
|
||||||
|
label="Autocomplete popup delay"
|
||||||
|
setting="autocompleteDelay"
|
||||||
|
help="Configure the autocomplete popup delay in milliseconds (0 to disable)"
|
||||||
|
min={0}
|
||||||
|
max={3000}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
<h2>Font</h2>
|
||||||
|
|
||||||
|
<div className="row-fill row-fill--top">
|
||||||
|
<div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Indent with tabs"
|
||||||
|
setting="editorIndentWithTabs"
|
||||||
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Wrap text editor lines"
|
||||||
|
setting="editorLineWrapping"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Font ligatures"
|
||||||
|
setting="fontVariantLigatures"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
<div className="form-row">
|
<div className="form-row">
|
||||||
<TextSetting
|
<TextSetting
|
||||||
label="Text Editor Font"
|
label="Interface Font"
|
||||||
setting="fontMonospace"
|
setting="fontInterface"
|
||||||
help="Comma-separated list of monospace fonts. If left empty, takes system defaults."
|
help="Comma-separated list of fonts. If left empty, takes system defaults."
|
||||||
placeholder="-- System Default --"
|
placeholder="-- System Default --"
|
||||||
/>
|
/>
|
||||||
<NumberSetting
|
<NumberSetting
|
||||||
label="Editor Font Size (px)"
|
label="Interface Font Size (px)"
|
||||||
setting="editorFontSize"
|
setting="fontSize"
|
||||||
min={MIN_EDITOR_FONT_SIZE}
|
min={MIN_INTERFACE_FONT_SIZE}
|
||||||
max={MAX_EDITOR_FONT_SIZE}
|
max={MAX_INTERFACE_FONT_SIZE}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form-row">
|
|
||||||
<NumberSetting
|
|
||||||
label="Editor Indent Size"
|
|
||||||
setting="editorIndentSize"
|
|
||||||
help=""
|
|
||||||
min={1}
|
|
||||||
max={16}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<EnumSetting<EditorKeyMap>
|
|
||||||
label="Text Editor Key Map"
|
|
||||||
setting="editorKeyMap"
|
|
||||||
help={isMac() && settings.editorKeyMap === EditorKeyMap.vim && (
|
|
||||||
<Fragment>
|
|
||||||
To enable key-repeating with Vim on macOS, see <Link href={docsKeyMaps}>
|
|
||||||
documentation <i className="fa fa-external-link-square" /></Link>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
values={[
|
|
||||||
{ value: EditorKeyMap.default, name: 'Default' },
|
|
||||||
{ value: EditorKeyMap.vim, name: 'Vim' },
|
|
||||||
{ value: EditorKeyMap.emacs, name: 'Emacs' },
|
|
||||||
{ value: EditorKeyMap.sublime, name: 'Sublime' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
|
|
||||||
<h2>Request / Response</h2>
|
|
||||||
|
|
||||||
<div className="row-fill row-fill--top">
|
|
||||||
<div>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Validate certificates"
|
|
||||||
setting="validateSSL"
|
|
||||||
help="Indicates whether SSL certificates should be validated for API requests. This does not affect SSL certificate validation during authentication."
|
|
||||||
/>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Follow redirects"
|
|
||||||
setting="followRedirects"
|
|
||||||
/>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Filter responses by environment"
|
|
||||||
setting="filterResponsesByEnv"
|
|
||||||
help="Only show responses that were sent under the currently-active environment. This adds additional separation when working with Development, Staging, Production environments, for example."
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Disable JS in HTML preview"
|
|
||||||
setting="disableHtmlPreviewJs"
|
|
||||||
/>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Disable Links in response viewer"
|
|
||||||
setting="disableResponsePreviewLinks"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<EnumSetting<HttpVersion>
|
|
||||||
label="Preferred HTTP version"
|
|
||||||
setting="preferredHttpVersion"
|
|
||||||
values={[
|
|
||||||
{ value: HttpVersions.default, name: 'Default' },
|
|
||||||
{ value: HttpVersions.V1_0, name: 'HTTP 1.0' },
|
|
||||||
{ value: HttpVersions.V1_1, name: 'HTTP 1.1' },
|
|
||||||
{ value: HttpVersions.V2PriorKnowledge, name: 'HTTP/2 PriorKnowledge' },
|
|
||||||
{ value: HttpVersions.V2_0, name: 'HTTP/2' },
|
|
||||||
// Enable when our version of libcurl supports HTTP/3
|
|
||||||
// see: https://github.com/JCMais/node-libcurl/issues/233
|
|
||||||
// { value: HttpVersions.v3, name: 'HTTP/3' },
|
|
||||||
]}
|
|
||||||
help="Preferred HTTP version to use for requests which will fall back if it cannot be negotiated"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<NumberSetting
|
|
||||||
label="Maximum Redirects"
|
|
||||||
setting="maxRedirects"
|
|
||||||
help="-1 for infinity"
|
|
||||||
min={-1}
|
|
||||||
/>
|
|
||||||
<NumberSetting
|
|
||||||
label="Request Timeout"
|
|
||||||
setting="timeout"
|
|
||||||
help="-1 for infinity"
|
|
||||||
min={-1}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<NumberSetting
|
|
||||||
label="Response History Limit"
|
|
||||||
setting="maxHistoryResponses"
|
|
||||||
help="Number of responses to keep for each request (-1 for infinity)"
|
|
||||||
min={-1}
|
|
||||||
/>
|
|
||||||
<NumberSetting
|
|
||||||
label="Max Timeline Chunk Size (KB)"
|
|
||||||
setting="maxTimelineDataSizeKB"
|
|
||||||
help="Maximum size in kilobytes to show on timeline"
|
|
||||||
min={0}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
|
|
||||||
<h2>Security</h2>
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<BooleanSetting
|
|
||||||
label="Clear OAuth 2 session on start"
|
|
||||||
setting="clearOAuth2SessionOnRestart"
|
|
||||||
help="Clears the session of the OAuth2 popup window every time Insomnia is launched"
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
className="btn btn--clicky pointer"
|
|
||||||
style={{
|
|
||||||
padding: 0,
|
|
||||||
}}
|
|
||||||
onClick={initNewOAuthSession}
|
|
||||||
>
|
|
||||||
Clear OAuth 2 session
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<BooleanSetting
|
|
||||||
label="Validate certificates during authentication"
|
|
||||||
setting="validateAuthSSL"
|
|
||||||
help="Indicates whether SSL certificates should be validated during authentication flows"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
|
|
||||||
<h2>
|
|
||||||
HTTP Network Proxy
|
|
||||||
<HelpTooltip
|
|
||||||
className="space-left txt-md"
|
|
||||||
style={{
|
|
||||||
maxWidth: '20rem',
|
|
||||||
// @ts-expect-error -- TSCONVERSION
|
|
||||||
lineWrap: 'word',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Enable global network proxy. Supports authentication via Basic Auth, digest, or NTLM
|
|
||||||
</HelpTooltip>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<BooleanSetting
|
|
||||||
label="Enable proxy"
|
|
||||||
setting="proxyEnabled"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<MaskedSetting
|
|
||||||
label='HTTP Proxy'
|
|
||||||
setting='httpProxy'
|
|
||||||
placeholder="localhost:8005"
|
|
||||||
disabled={!settings.proxyEnabled}
|
|
||||||
/>
|
|
||||||
<MaskedSetting
|
|
||||||
label='HTTPS Proxy'
|
|
||||||
setting='httpsProxy'
|
|
||||||
placeholder="localhost:8005"
|
|
||||||
disabled={!settings.proxyEnabled}
|
|
||||||
/>
|
|
||||||
<TextSetting
|
|
||||||
label="No Proxy"
|
|
||||||
setting="noProxy"
|
|
||||||
help="Comma-separated list of hostnames that do not require a proxy to be contacted"
|
|
||||||
placeholder="localhost,127.0.0.1"
|
|
||||||
disabled={!settings.proxyEnabled}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{updatesSupported() && (
|
|
||||||
<Fragment>
|
|
||||||
<hr className="pad-top" />
|
|
||||||
<div>
|
|
||||||
<div className="pull-right">
|
|
||||||
<CheckForUpdatesButton className="btn btn--outlined btn--super-duper-compact">
|
|
||||||
Check Now
|
|
||||||
</CheckForUpdatesButton>
|
|
||||||
</div>
|
|
||||||
<h2>Software Updates</h2>
|
|
||||||
</div>
|
|
||||||
<BooleanSetting
|
|
||||||
label="Automatically download and install updates"
|
|
||||||
setting="updateAutomatically"
|
|
||||||
help="If disabled, you will receive a notification when a new update is available"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="for-row pad-top-sm">
|
|
||||||
<EnumSetting<UpdateChannel>
|
|
||||||
label="Update Channel"
|
|
||||||
setting="updateChannel"
|
|
||||||
values={[
|
|
||||||
{ value: UpdateChannel.stable, name: 'Release (Recommended)' },
|
|
||||||
{ value: UpdateChannel.beta, name: 'Early Access (Beta)' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
<h2>Notifications</h2>
|
|
||||||
{!updatesSupported() && (
|
|
||||||
<BooleanSetting
|
|
||||||
label="Do not notify of new releases"
|
|
||||||
setting="disableUpdateNotification"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<BooleanSetting
|
|
||||||
label="Do not tell me about premium features"
|
|
||||||
setting="disablePaidFeatureAds"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
<h2>Plugins</h2>
|
|
||||||
<TextSetting
|
|
||||||
label="Additional Plugin Path"
|
|
||||||
setting="pluginPath"
|
|
||||||
help="Tell Insomnia to look for plugins in a different directory"
|
|
||||||
placeholder="~/.insomnia:/other/path"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
<h2>Network Activity</h2>
|
|
||||||
<BooleanSetting
|
|
||||||
descriptions={[
|
|
||||||
'In incognito mode, Insomnia will not make any network requests other than the requests you ask it to send. You\'ll still be able to log in and manually sync collections, but any background network requests that are not the direct result of your actions will be disabled.',
|
|
||||||
'Note that, similar to incognito mode in Chrome, Insomnia cannot control the network behavior of any plugins you have installed.',
|
|
||||||
]}
|
|
||||||
label="Incognito Mode"
|
|
||||||
setting="incognitoMode"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<BooleanSetting
|
|
||||||
descriptions={[
|
|
||||||
`Help Kong improve its products by sending anonymous data about features and plugins used, hardware and software configuration, statistics on number of requests, ${strings.collection.plural.toLowerCase()}, ${strings.document.plural.toLowerCase()}, etc.`,
|
|
||||||
'Please note that this will not include personal data or any sensitive information, such as request data, names, etc.',
|
|
||||||
]}
|
|
||||||
label="Send Usage Statistics"
|
|
||||||
setting="enableAnalytics"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<BooleanSetting
|
|
||||||
descriptions={['Insomnia periodically makes background requests to api.insomnia.rest/notifications for things like email verification, out-of-date billing information, trial information.']}
|
|
||||||
label="Allow Notification Requests"
|
|
||||||
setting="allowNotificationRequests"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<hr className="pad-top" />
|
|
||||||
|
|
||||||
<h2>Migrate from Designer</h2>
|
|
||||||
<div className="form-row--start pad-top-sm">
|
|
||||||
<button className="btn btn--clicky pointer" onClick={this._handleStartMigration}>
|
|
||||||
Show migration workflow
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{isDevelopment() && (
|
|
||||||
<>
|
|
||||||
<hr className="pad-top" />
|
|
||||||
<h2>Development</h2>
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<BooleanSetting
|
|
||||||
label="Has been prompted to migrate from Insomnia Designer"
|
|
||||||
setting="hasPromptedToMigrateFromDesigner"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="form-row pad-top-sm">
|
|
||||||
<BooleanSetting
|
|
||||||
label="Has seen analytics prompt"
|
|
||||||
setting="hasPromptedAnalytics"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
<div className="form-row">
|
||||||
// @ts-expect-error -- TSCONVERSION
|
<TextSetting
|
||||||
const global = bindActionCreators(globalActions, dispatch);
|
label="Text Editor Font"
|
||||||
return {
|
setting="fontMonospace"
|
||||||
// @ts-expect-error -- TSCONVERSION
|
help="Comma-separated list of monospace fonts. If left empty, takes system defaults."
|
||||||
handleSetActiveActivity: global.setActiveActivity,
|
placeholder="-- System Default --"
|
||||||
};
|
/>
|
||||||
}
|
<NumberSetting
|
||||||
|
label="Editor Font Size (px)"
|
||||||
|
setting="editorFontSize"
|
||||||
|
min={MIN_EDITOR_FONT_SIZE}
|
||||||
|
max={MAX_EDITOR_FONT_SIZE}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
export default connect(null, mapDispatchToProps)(General);
|
<div className="form-row">
|
||||||
|
<NumberSetting
|
||||||
|
label="Editor Indent Size"
|
||||||
|
setting="editorIndentSize"
|
||||||
|
help=""
|
||||||
|
min={1}
|
||||||
|
max={16}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EnumSetting<EditorKeyMap>
|
||||||
|
label="Text Editor Key Map"
|
||||||
|
setting="editorKeyMap"
|
||||||
|
help={isMac() && settings.editorKeyMap === EditorKeyMap.vim && (
|
||||||
|
<Fragment>
|
||||||
|
To enable key-repeating with Vim on macOS, see <Link href={docsKeyMaps}>
|
||||||
|
documentation <i className="fa fa-external-link-square" /></Link>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
values={[
|
||||||
|
{ value: EditorKeyMap.default, name: 'Default' },
|
||||||
|
{ value: EditorKeyMap.vim, name: 'Vim' },
|
||||||
|
{ value: EditorKeyMap.emacs, name: 'Emacs' },
|
||||||
|
{ value: EditorKeyMap.sublime, name: 'Sublime' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
|
||||||
|
<h2>Request / Response</h2>
|
||||||
|
|
||||||
|
<div className="row-fill row-fill--top">
|
||||||
|
<div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Validate certificates"
|
||||||
|
setting="validateSSL"
|
||||||
|
help="Indicates whether SSL certificates should be validated for API requests. This does not affect SSL certificate validation during authentication."
|
||||||
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Follow redirects"
|
||||||
|
setting="followRedirects"
|
||||||
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Filter responses by environment"
|
||||||
|
setting="filterResponsesByEnv"
|
||||||
|
help="Only show responses that were sent under the currently-active environment. This adds additional separation when working with Development, Staging, Production environments, for example."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Disable JS in HTML preview"
|
||||||
|
setting="disableHtmlPreviewJs"
|
||||||
|
/>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Disable Links in response viewer"
|
||||||
|
setting="disableResponsePreviewLinks"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<EnumSetting<HttpVersion>
|
||||||
|
label="Preferred HTTP version"
|
||||||
|
setting="preferredHttpVersion"
|
||||||
|
values={[
|
||||||
|
{ value: HttpVersions.default, name: 'Default' },
|
||||||
|
{ value: HttpVersions.V1_0, name: 'HTTP 1.0' },
|
||||||
|
{ value: HttpVersions.V1_1, name: 'HTTP 1.1' },
|
||||||
|
{ value: HttpVersions.V2PriorKnowledge, name: 'HTTP/2 PriorKnowledge' },
|
||||||
|
{ value: HttpVersions.V2_0, name: 'HTTP/2' },
|
||||||
|
// Enable when our version of libcurl supports HTTP/3
|
||||||
|
// see: https://github.com/JCMais/node-libcurl/issues/233
|
||||||
|
// { value: HttpVersions.v3, name: 'HTTP/3' },
|
||||||
|
]}
|
||||||
|
help="Preferred HTTP version to use for requests which will fall back if it cannot be negotiated"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<NumberSetting
|
||||||
|
label="Maximum Redirects"
|
||||||
|
setting="maxRedirects"
|
||||||
|
help="-1 for infinity"
|
||||||
|
min={-1}
|
||||||
|
/>
|
||||||
|
<NumberSetting
|
||||||
|
label="Request Timeout"
|
||||||
|
setting="timeout"
|
||||||
|
help="-1 for infinity"
|
||||||
|
min={-1}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<NumberSetting
|
||||||
|
label="Response History Limit"
|
||||||
|
setting="maxHistoryResponses"
|
||||||
|
help="Number of responses to keep for each request (-1 for infinity)"
|
||||||
|
min={-1}
|
||||||
|
/>
|
||||||
|
<NumberSetting
|
||||||
|
label="Max Timeline Chunk Size (KB)"
|
||||||
|
setting="maxTimelineDataSizeKB"
|
||||||
|
help="Maximum size in kilobytes to show on timeline"
|
||||||
|
min={0}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
|
||||||
|
<h2>Security</h2>
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<BooleanSetting
|
||||||
|
label="Clear OAuth 2 session on start"
|
||||||
|
setting="clearOAuth2SessionOnRestart"
|
||||||
|
help="Clears the session of the OAuth2 popup window every time Insomnia is launched"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
className="btn btn--clicky pointer"
|
||||||
|
style={{
|
||||||
|
padding: 0,
|
||||||
|
}}
|
||||||
|
onClick={initNewOAuthSession}
|
||||||
|
>
|
||||||
|
Clear OAuth 2 session
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<BooleanSetting
|
||||||
|
label="Validate certificates during authentication"
|
||||||
|
setting="validateAuthSSL"
|
||||||
|
help="Indicates whether SSL certificates should be validated during authentication flows"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
HTTP Network Proxy
|
||||||
|
<HelpTooltip
|
||||||
|
className="space-left txt-md"
|
||||||
|
style={{
|
||||||
|
maxWidth: '20rem',
|
||||||
|
// @ts-expect-error -- TSCONVERSION
|
||||||
|
lineWrap: 'word',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Enable global network proxy. Supports authentication via Basic Auth, digest, or NTLM
|
||||||
|
</HelpTooltip>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<BooleanSetting
|
||||||
|
label="Enable proxy"
|
||||||
|
setting="proxyEnabled"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="form-row pad-top-sm">
|
||||||
|
<MaskedSetting
|
||||||
|
label='HTTP Proxy'
|
||||||
|
setting='httpProxy'
|
||||||
|
placeholder="localhost:8005"
|
||||||
|
disabled={!settings.proxyEnabled}
|
||||||
|
/>
|
||||||
|
<MaskedSetting
|
||||||
|
label='HTTPS Proxy'
|
||||||
|
setting='httpsProxy'
|
||||||
|
placeholder="localhost:8005"
|
||||||
|
disabled={!settings.proxyEnabled}
|
||||||
|
/>
|
||||||
|
<TextSetting
|
||||||
|
label="No Proxy"
|
||||||
|
setting="noProxy"
|
||||||
|
help="Comma-separated list of hostnames that do not require a proxy to be contacted"
|
||||||
|
placeholder="localhost,127.0.0.1"
|
||||||
|
disabled={!settings.proxyEnabled}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{updatesSupported() && (
|
||||||
|
<Fragment>
|
||||||
|
<hr className="pad-top" />
|
||||||
|
<div>
|
||||||
|
<div className="pull-right">
|
||||||
|
<CheckForUpdatesButton className="btn btn--outlined btn--super-duper-compact">
|
||||||
|
Check Now
|
||||||
|
</CheckForUpdatesButton>
|
||||||
|
</div>
|
||||||
|
<h2>Software Updates</h2>
|
||||||
|
</div>
|
||||||
|
<BooleanSetting
|
||||||
|
label="Automatically download and install updates"
|
||||||
|
setting="updateAutomatically"
|
||||||
|
help="If disabled, you will receive a notification when a new update is available"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="for-row pad-top-sm">
|
||||||
|
<EnumSetting<UpdateChannel>
|
||||||
|
label="Update Channel"
|
||||||
|
setting="updateChannel"
|
||||||
|
values={[
|
||||||
|
{ value: UpdateChannel.stable, name: 'Release (Recommended)' },
|
||||||
|
{ value: UpdateChannel.beta, name: 'Early Access (Beta)' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
<h2>Notifications</h2>
|
||||||
|
{!updatesSupported() && (
|
||||||
|
<BooleanSetting
|
||||||
|
label="Do not notify of new releases"
|
||||||
|
setting="disableUpdateNotification"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<BooleanSetting
|
||||||
|
label="Do not tell me about premium features"
|
||||||
|
setting="disablePaidFeatureAds"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
<h2>Plugins</h2>
|
||||||
|
<TextSetting
|
||||||
|
label="Additional Plugin Path"
|
||||||
|
setting="pluginPath"
|
||||||
|
help="Tell Insomnia to look for plugins in a different directory"
|
||||||
|
placeholder="~/.insomnia:/other/path"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
<h2>Network Activity</h2>
|
||||||
|
<BooleanSetting
|
||||||
|
descriptions={[
|
||||||
|
'In incognito mode, Insomnia will not make any network requests other than the requests you ask it to send. You\'ll still be able to log in and manually sync collections, but any background network requests that are not the direct result of your actions will be disabled.',
|
||||||
|
'Note that, similar to incognito mode in Chrome, Insomnia cannot control the network behavior of any plugins you have installed.',
|
||||||
|
]}
|
||||||
|
label="Incognito Mode"
|
||||||
|
setting="incognitoMode"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<BooleanSetting
|
||||||
|
descriptions={[
|
||||||
|
`Help Kong improve its products by sending anonymous data about features and plugins used, hardware and software configuration, statistics on number of requests, ${strings.collection.plural.toLowerCase()}, ${strings.document.plural.toLowerCase()}, etc.`,
|
||||||
|
'Please note that this will not include personal data or any sensitive information, such as request data, names, etc.',
|
||||||
|
]}
|
||||||
|
label="Send Usage Statistics"
|
||||||
|
setting="enableAnalytics"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<BooleanSetting
|
||||||
|
descriptions={['Insomnia periodically makes background requests to api.insomnia.rest/notifications for things like email verification, out-of-date billing information, trial information.']}
|
||||||
|
label="Allow Notification Requests"
|
||||||
|
setting="allowNotificationRequests"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<hr className="pad-top" />
|
||||||
|
|
||||||
|
<h2>Migrate from Designer</h2>
|
||||||
|
<div className="form-row--start pad-top-sm">
|
||||||
|
<button className="btn btn--clicky pointer" onClick={handleStartMigration}>
|
||||||
|
Show migration workflow
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DevelopmentOnlySettings />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user