insomnia/app/ui/components/viewers/ResponseError.js
Gregory Schier e380a4d2b1 Insomnia Plus Launch (#41)
* Payment modal done

* Refactor settings and added command support

* Made sync operations more efficient

* Sync button slightly more efficient

* Remove Elm

* Fixed Codemirror

* Nunjucks 3.0

* Revert sourcemap change and some renaming

* Some fixes for Config creation, and added name to resources

* Set to new Insomnia URL

* Some fixes
2016-11-07 12:24:38 -08:00

64 lines
1.7 KiB
JavaScript

import React, {Component, PropTypes} from 'react';
import Link from '../../components/base/Link';
import {showModal} from '../modals/index';
import SettingsModal from '../modals/SettingsModal';
class ResponseError extends Component {
render () {
const {error} = this.props;
let msg = null;
if (error && error.toLowerCase().indexOf('certificate') !== -1) {
msg = (
<button className="btn btn--super-compact btn--outlined"
onClick={() => showModal(SettingsModal)}>
Disable SSL Validation
</button>
)
} else if (error && error.toLowerCase().indexOf('getaddrinfo') !== -1) {
msg = (
<button className="btn btn--super-compact btn--outlined"
onClick={() => showModal(SettingsModal)}>
Setup Network Proxy
</button>
)
} else {
msg = (
<Link button={true} className="btn btn--super-compact btn--outlined"
href="http://docs.insomnia.rest">
Documentation
</Link>
)
}
return (
<div>
<pre className="selectable pad force-word-wrap">
{error}
</pre>
<hr/>
<div className="text-center pad">
<p className="faint pad-left pad-right">
Here are some additional things that may help.
</p>
{msg}
&nbsp;&nbsp;
<Link button={true} className="btn btn--super-compact btn--outlined margin-top-sm"
href="mailto:support@insomnia.rest">
Contact Support
</Link>
</div>
</div>
);
}
}
ResponseError.propTypes = {
error: PropTypes.string.isRequired,
url: PropTypes.string.isRequired
};
export default ResponseError;