-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMiscBackendLogsEnable.js
More file actions
66 lines (62 loc) · 2.7 KB
/
Copy pathMiscBackendLogsEnable.js
File metadata and controls
66 lines (62 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React, {useContext} from 'react';
import {DataRootContext} from '../../../App';
const {__, sprintf} = wp.i18n;
const {createInterpolateElement} = wp.element;
export default function MiscBackendLogsEnable(props) {
const {id, name, value, onSettingChange, wlCompanyName} = props;
const {myBillingLink, backendLogsEnabled, backendLogsLink, wlModeEnabled} = useContext(DataRootContext) || {};
if (!backendLogsEnabled) {
return null;
}
return (
<>
<input
type="checkbox"
id={'spbc_setting_' + id}
name={name}
value={value}
checked={value === 1 || value === '1' || value === true}
onChange={(e) => {
const next = e.target.checked ? 1 : 0;
onSettingChange?.(id, next);
}}
/>
<label
htmlFor={'spbc_setting_' + id}
className="spbc_setting-field_title--field"
>
{__('Collect and send PHP logs', 'security-malware-firewall')}
</label>
<i data-setting={id} className="spbc_long_description__show spbc-icon-help-circled"></i>
{(backendLogsEnabled || wlModeEnabled) ? (
<div className="spbc_settings_description">{
sprintf(
__('Collect and send PHP error logs to your %s Dashboard where you can list them.', 'security-malware-firewall'),
wlModeEnabled && wlCompanyName ? wlCompanyName : __('CleanTalk', 'security-malware-firewall'),
)
}</div>
) : (
<div className="spbc_settings_description">
{createInterpolateElement(
__(
'To see the collected logs please use the <a1>Backend PHP log</a1>. The <a2>extra package</a2> is required to start the collection, please click "Synchronize with the Cloud" in the plugin settings after purchasing the Extra package.',
'security-malware-firewall',
),
{
a1: <a
href={backendLogsLink}
target="_blank"
rel="noopener noreferrer"
/>,
a2: <a
href={myBillingLink}
target="_blank"
rel="noopener noreferrer"
/>,
},
)}
</div>
)}
</>
);
}