import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withNamespaces } from 'react-i18next'; import debounce from 'lodash/debounce'; import { DEBOUNCE_TIMEOUT } from '../../../helpers/constants'; import Form from './Form'; import Card from '../../ui/Card'; import PageTitle from '../../ui/PageTitle'; import Loading from '../../ui/Loading'; class Encryption extends Component { componentDidMount() { const { getTlsStatus, validateTlsConfig, encryption } = this.props; getTlsStatus(); if (encryption.enabled) { validateTlsConfig(encryption); } } handleFormSubmit = (values) => { this.props.setTlsConfig(values); }; handleFormChange = debounce((values) => { this.props.validateTlsConfig(values); }, DEBOUNCE_TIMEOUT); render() { const { encryption, t } = this.props; const { enabled, server_name, force_https, port_https, port_dns_over_tls, certificate_chain, private_key, } = encryption; return (