* disable config saving if invalid pair
This commit is contained in:
parent
224c2a891d
commit
b8595b87c4
|
@ -57,6 +57,7 @@ let Form = (props) => {
|
||||||
valid_chain,
|
valid_chain,
|
||||||
valid_key,
|
valid_key,
|
||||||
valid_cert,
|
valid_cert,
|
||||||
|
valid_pair,
|
||||||
dns_names,
|
dns_names,
|
||||||
key_type,
|
key_type,
|
||||||
issuer,
|
issuer,
|
||||||
|
@ -65,6 +66,15 @@ let Form = (props) => {
|
||||||
setTlsConfig,
|
setTlsConfig,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
const isSavingDisabled = invalid
|
||||||
|
|| submitting
|
||||||
|
|| processingConfig
|
||||||
|
|| processingValidate
|
||||||
|
|| (isEnabled && (!privateKey || !certificateChain))
|
||||||
|
|| (privateKey && !valid_key)
|
||||||
|
|| (certificateChain && !valid_cert)
|
||||||
|
|| (privateKey && certificateChain && !valid_pair);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
@ -291,15 +301,7 @@ let Form = (props) => {
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-success btn-standart"
|
className="btn btn-success btn-standart"
|
||||||
disabled={
|
disabled={isSavingDisabled}
|
||||||
invalid
|
|
||||||
|| submitting
|
|
||||||
|| processingConfig
|
|
||||||
|| processingValidate
|
|
||||||
|| (isEnabled && (!privateKey || !certificateChain))
|
|
||||||
|| (privateKey && !valid_key)
|
|
||||||
|| (certificateChain && !valid_cert)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Trans>save_config</Trans>
|
<Trans>save_config</Trans>
|
||||||
</button>
|
</button>
|
||||||
|
@ -334,6 +336,7 @@ Form.propTypes = {
|
||||||
valid_chain: PropTypes.bool,
|
valid_chain: PropTypes.bool,
|
||||||
valid_key: PropTypes.bool,
|
valid_key: PropTypes.bool,
|
||||||
valid_cert: PropTypes.bool,
|
valid_cert: PropTypes.bool,
|
||||||
|
valid_pair: PropTypes.bool,
|
||||||
dns_names: PropTypes.string,
|
dns_names: PropTypes.string,
|
||||||
key_type: PropTypes.string,
|
key_type: PropTypes.string,
|
||||||
issuer: PropTypes.string,
|
issuer: PropTypes.string,
|
||||||
|
|
|
@ -70,6 +70,7 @@ const encryption = handleActions({
|
||||||
valid_chain: false,
|
valid_chain: false,
|
||||||
valid_key: false,
|
valid_key: false,
|
||||||
valid_cert: false,
|
valid_cert: false,
|
||||||
|
valid_pair: false,
|
||||||
status_cert: '',
|
status_cert: '',
|
||||||
status_key: '',
|
status_key: '',
|
||||||
certificate_chain: '',
|
certificate_chain: '',
|
||||||
|
|
Loading…
Reference in New Issue