Merge branch 'master' into 4926-scroll

This commit is contained in:
Ildar Kamalov 2022-09-19 19:35:48 +03:00
commit 23a352d214
3 changed files with 32 additions and 6 deletions

View File

@ -635,5 +635,6 @@
"parental_control": "Parental Control",
"safe_browsing": "Safe Browsing",
"served_from_cache": "{{value}} <i>(served from cache)</i>",
"form_error_password_length": "Password must be at least {{value}} characters long"
"form_error_password_length": "Password must be at least {{value}} characters long",
"anonymizer_notification": "<0>Note:</0> IP anonymization is enabled. You can disable it in <1>General settings</1>."
}

View File

@ -0,0 +1,16 @@
import React from 'react';
import { Trans } from 'react-i18next';
import { HashLink as Link } from 'react-router-hash-link';
const AnonymizerNotification = () => (
<div className="alert alert-primary mt-6">
<Trans components={[
<strong key="0">text</strong>,
<Link to="/settings#logs-config" key="1">link</Link>,
]}>
anonymizer_notification
</Trans>
</div>
);
export default AnonymizerNotification;

View File

@ -25,6 +25,7 @@ import {
import InfiniteTable from './InfiniteTable';
import './Logs.css';
import { BUTTON_PREFIX } from './Cells/helpers';
import AnonymizerNotification from './AnonymizerNotification';
const processContent = (data) => Object.entries(data)
.map(([key, value]) => {
@ -73,6 +74,7 @@ const Logs = () => {
processingGetConfig,
processingAdditionalLogs,
processingGetLogs,
anonymize_client_ip: anonymizeClientIp,
} = useSelector((state) => state.queryLogs, shallowEqual);
const filter = useSelector((state) => state.queryLogs.filter, shallowEqual);
const logs = useSelector((state) => state.queryLogs.logs, shallowEqual);
@ -206,11 +208,18 @@ const Logs = () => {
</Modal>
</>;
return <>
{enabled && processingGetConfig && <Loading />}
{enabled && !processingGetConfig && renderPage()}
{!enabled && !processingGetConfig && <Disabled />}
</>;
return (
<>
{enabled && (
<>
{processingGetConfig && <Loading />}
{anonymizeClientIp && <AnonymizerNotification />}
{!processingGetConfig && renderPage()}
</>
)}
{!enabled && !processingGetConfig && <Disabled />}
</>
);
};
export default Logs;