2017-05-27 05:30:22 +00:00
|
|
|
import React from 'react';
|
2017-06-21 06:40:28 +00:00
|
|
|
import Navicon from 'containers/Navicon';
|
|
|
|
import FileInput from 'components/ui/FileInput';
|
2017-05-27 05:30:22 +00:00
|
|
|
|
|
|
|
const Settings = ({ settings, onCertChange, onKeyChange, uploadCert }) => {
|
|
|
|
const status = settings.get('uploadingCert') ? 'Uploading...' : 'Upload';
|
|
|
|
const error = settings.get('certError');
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="settings">
|
|
|
|
<Navicon />
|
|
|
|
<h1>Settings</h1>
|
|
|
|
<h2>Client Certificate</h2>
|
|
|
|
<div>
|
|
|
|
<p>Certificate</p>
|
|
|
|
<FileInput
|
|
|
|
name={settings.get('certFile') || 'Select Certificate'}
|
|
|
|
onChange={onCertChange}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<p>Private Key</p>
|
|
|
|
<FileInput
|
|
|
|
name={settings.get('keyFile') || 'Select Key'}
|
|
|
|
onChange={onKeyChange}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<button onClick={uploadCert}>{status}</button>
|
2018-04-05 23:46:22 +00:00
|
|
|
{error ? <p className="error">{error}</p> : null}
|
2017-05-27 05:30:22 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Settings;
|