2017-02-28 21:32:23 +00:00
|
|
|
import React, {PureComponent, PropTypes} from 'react';
|
2016-08-25 17:06:01 +00:00
|
|
|
|
2017-03-08 05:52:17 +00:00
|
|
|
import Link from '../base/link';
|
2016-11-07 20:24:38 +00:00
|
|
|
import {showModal} from '../modals/index';
|
2017-03-08 05:52:17 +00:00
|
|
|
import SettingsModal from '../modals/settings-modal';
|
2016-08-25 17:06:01 +00:00
|
|
|
|
2017-02-28 21:32:23 +00:00
|
|
|
class ResponseError extends PureComponent {
|
2016-08-25 17:06:01 +00:00
|
|
|
render () {
|
2017-06-14 18:27:30 +00:00
|
|
|
const {error, fontSize} = this.props;
|
2016-08-25 17:06:01 +00:00
|
|
|
|
|
|
|
let msg = null;
|
2017-06-14 18:27:30 +00:00
|
|
|
if (error && error.toLowerCase().indexOf('certificate') !== -1) {
|
2016-11-29 20:55:31 +00:00
|
|
|
msg = (
|
|
|
|
<button className="btn btn--clicky" onClick={() => showModal(SettingsModal)}>
|
2016-08-25 17:06:01 +00:00
|
|
|
Disable SSL Validation
|
|
|
|
</button>
|
2017-03-03 20:09:08 +00:00
|
|
|
);
|
2016-08-25 17:06:01 +00:00
|
|
|
} else if (error && error.toLowerCase().indexOf('getaddrinfo') !== -1) {
|
|
|
|
msg = (
|
2016-11-29 20:55:31 +00:00
|
|
|
<button className="btn btn--clicky" onClick={() => showModal(SettingsModal)}>
|
2016-08-25 17:06:01 +00:00
|
|
|
Setup Network Proxy
|
|
|
|
</button>
|
2017-03-03 20:09:08 +00:00
|
|
|
);
|
2016-08-25 17:06:01 +00:00
|
|
|
} else {
|
|
|
|
msg = (
|
2017-03-01 21:15:56 +00:00
|
|
|
<Link button
|
2016-11-26 00:49:38 +00:00
|
|
|
className="btn btn--clicky"
|
2016-11-23 19:33:24 +00:00
|
|
|
href="https://insomnia.rest/documentation/">
|
2016-09-13 18:33:45 +00:00
|
|
|
Documentation
|
2016-08-25 17:06:01 +00:00
|
|
|
</Link>
|
2017-03-03 20:09:08 +00:00
|
|
|
);
|
2016-08-25 17:06:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2017-02-09 00:46:12 +00:00
|
|
|
<pre className="selectable pad force-word-wrap" style={{fontSize: `${fontSize}px`}}>
|
2016-08-25 17:06:01 +00:00
|
|
|
{error}
|
2016-09-28 21:17:57 +00:00
|
|
|
</pre>
|
2016-08-25 17:06:01 +00:00
|
|
|
<hr/>
|
|
|
|
<div className="text-center pad">
|
|
|
|
<p className="faint pad-left pad-right">
|
2016-09-13 18:33:45 +00:00
|
|
|
Here are some additional things that may help.
|
2016-08-25 17:06:01 +00:00
|
|
|
</p>
|
|
|
|
{msg}
|
|
|
|
|
2017-03-01 21:15:56 +00:00
|
|
|
<Link button className="btn btn--clicky margin-top-sm"
|
2016-11-23 19:33:24 +00:00
|
|
|
href="https://insomnia.rest/documentation/support-and-feedback/">
|
2016-08-25 17:06:01 +00:00
|
|
|
Contact Support
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ResponseError.propTypes = {
|
2016-11-29 20:55:31 +00:00
|
|
|
// Required
|
2016-08-25 17:06:01 +00:00
|
|
|
error: PropTypes.string.isRequired,
|
2016-11-29 20:55:31 +00:00
|
|
|
url: PropTypes.string.isRequired,
|
2017-03-03 20:09:08 +00:00
|
|
|
fontSize: PropTypes.number.isRequired
|
2016-08-25 17:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ResponseError;
|