import React, {Component, PropTypes} from 'react'; import {connect} from 'react-redux' import {bindActionCreators} from 'redux'; import {Tab, Tabs, TabList, TabPanel} from 'react-tabs' import {shell} from 'electron'; import Link from '../base/Link'; import Modal from '../base/Modal'; import ModalBody from '../base/ModalBody'; import ModalHeader from '../base/ModalHeader'; import ModalFooter from '../base/ModalFooter'; import KeyboardShortcutsTable from '../KeyboardShortcutsTable'; import * as GlobalActions from '../../redux/modules/global'; import * as db from '../../database'; import {MASHAPE_URL} from '../../lib/constants'; import {getAppVersion} from '../../lib/appInfo'; import {getAppName, getAppLongName} from '../../lib/appInfo'; class SettingsTabs extends Component { constructor (props) { super(props); this._currentTabIndex = -1; this._currentVersion = null; } _importFile () { const workspace = this._getActiveWorkspace(this.props); this.props.actions.global.importFile(workspace); this.props.hide(); } _handleTabSelect (selectedIndex) { this._currentTabIndex = selectedIndex; } _exportAll () { this.props.actions.global.exportFile(); this.props.hide(); } _exportWorkspace () { this.props.actions.global.exportFile(this._getActiveWorkspace()); this.props.hide(); } _getActiveWorkspace (props) { // TODO: Factor this out into a selector const {entities, workspaces} = props || this.props; let workspace = entities.workspaces[workspaces.activeId]; if (!workspace) { workspace = entities.workspaces[Object.keys(entities.workspaces)[0]]; } return workspace; } componentWillReceiveProps ({selectedIndex, version}) { if (this._currentVersion !== version) { this._currentTabIndex = selectedIndex; this._currentVersion = version; } } render () { const {entities} = this.props; const settings = entities.settings[Object.keys(entities.settings)[0]]; return ( this._handleTabSelect(i)} selectedIndex={this._currentTabIndex}>

db.settingsUpdate(settings, {showPasswords: e.target.checked})} />   
db.settingsUpdate(settings, {useBulkHeaderEditor: e.target.checked})} />   
db.settingsUpdate(settings, {followRedirects: e.target.checked})} />   
db.settingsUpdate(settings, {validateSSL: e.target.checked})} />   
db.settingsUpdate(settings, {timeout: parseInt(e.target.value, 10)})} />

db.settingsUpdate(settings, {httpProxy: e.target.value})} />
db.settingsUpdate(settings, {httpsProxy: e.target.value})} />
db.settingsUpdate(settings, {editorLineWrapping: e.target.checked})} />   
db.settingsUpdate(settings, {editorFontSize: parseInt(e.target.value, 10)})} />

This will export all app data for all workspaces.

Be aware that you may be exporting private data

{" "} {" "}

Hi there!

{getAppName()} is made with love by me,  Gregory Schier.

You can help me out by sending your feedback to  support@insomnia.rest or tweet  @GetInsomnia.

Thanks!


~Gregory

); } } SettingsTabs.propTypes = { workspaces: PropTypes.shape({ activeId: PropTypes.string }), entities: PropTypes.shape({ workspaces: PropTypes.object.isRequired, settings: PropTypes.object.isRequired }).isRequired, actions: PropTypes.shape({ global: PropTypes.shape({ importFile: PropTypes.func.isRequired, exportFile: PropTypes.func.isRequired, }) }), // Optional selectedIndex: PropTypes.number, version: PropTypes.number }; function mapStateToProps (state) { return { workspaces: state.workspaces, entities: state.entities, actions: state.actions, loading: state.global.loading }; } function mapDispatchToProps (dispatch) { return { actions: { global: bindActionCreators(GlobalActions, dispatch) } } } // NOTE: We can't _connect_ the SettingsModal because it hides the public methods const ConnectedSettingsTabs = connect( mapStateToProps, mapDispatchToProps )(SettingsTabs); class SettingsModal extends Component { constructor (props) { super(props); this.state = { version: 0, selectedIndex: -1 } } _setIndex (selectedIndex) { const version = this.state.version + 1; this.setState({selectedIndex, version}); } show (selectedIndex = 0) { this.modal.show(); this._setIndex(selectedIndex); } toggle (selectedIndex = 0) { this.modal.toggle(); this._setIndex(selectedIndex); } render () { const {selectedIndex, version} = this.state; return ( this.modal = m} tall={true} {...this.props}> {getAppLongName()}    v{getAppVersion()} this.modal.hide()} selectedIndex={selectedIndex} />
Supported By  
); } } export default SettingsModal;