import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withNamespaces } from 'react-i18next'; import Card from '../../ui/Card'; import Form from './Form'; class LogsConfig extends Component { handleFormSubmit = (values) => { const { t, interval: prevInterval } = this.props; const { interval } = values; if (interval !== prevInterval) { // eslint-disable-next-line no-alert if (window.confirm(t('query_log_retention_confirm'))) { this.props.setLogsConfig(values); } } else { this.props.setLogsConfig(values); } }; handleClear = () => { const { t, clearLogs } = this.props; // eslint-disable-next-line no-alert if (window.confirm(t('query_log_confirm_clear'))) { clearLogs(); } }; render() { const { t, enabled, interval, processing, processingClear, } = this.props; return (
); } } LogsConfig.propTypes = { interval: PropTypes.number.isRequired, enabled: PropTypes.bool.isRequired, processing: PropTypes.bool.isRequired, processingClear: PropTypes.bool.isRequired, setLogsConfig: PropTypes.func.isRequired, clearLogs: PropTypes.func.isRequired, t: PropTypes.func.isRequired, }; export default withNamespaces()(LogsConfig);