PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | modules/logs/ui/js/admin.js +42 -10 5.2 → 6.2.1 View file →
@@ -15,9 +15,9 @@
15 15 let str_startdate = jQuery('#log_delete_records_startdate').val();
16 16 let str_enddate = jQuery('#log_delete_records_enddate').val();
17 17 let errors = [];
18 18 if (str_startdate == '' || str_enddate == '') {
19 - errors.push(__('Please select Start Date and End Date.'));
19 + errors.push(MainWP.I18n.t('Please select Start Date and End Date.'));
20 20 }
21 21 if (errors.length > 0) {
22 22 mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + errors, 'red');
23 23 return;
@@ -22,9 +22,9 @@
22 22 mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + errors, 'red');
23 23 return;
24 24 }
25 25
26 - let msg = __('Are you sure you want to delete logs for selected date?');
26 + let msg = MainWP.I18n.t('Are you sure you want to delete logs for selected date?');
27 27
28 28 mainwp_confirm(msg, function () {
29 29 let data = mainwp_secure_data({
30 30 action: 'mainwp_module_log_delete_records',
@@ -30,17 +30,17 @@
30 30 action: 'mainwp_module_log_delete_records',
31 31 startdate: jQuery('#log_delete_records_startdate').val(),
32 32 enddate: jQuery('#log_delete_records_enddate').val(),
33 33 });
34 - mainwp_set_message_zone('#mainwp-message-zone', __('Running ...'), 'green');
34 + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green');
35 35 jQuery.post(ajaxurl, data, function (response) {
36 36 mainwp_set_message_zone('#mainwp-message-zone');
37 37 if (response.error) {
38 38 mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red');
39 39 } else if (response.result) {
40 - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Logs records has been deleted successfully.'), 'green');
40 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Logs records has been deleted successfully.'), 'green');
41 41 } else {
42 - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Undefined error. Please try again.'), 'red');
42 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red');
43 43 }
44 44 }, 'json');
45 45 });
46 46
@@ -50,13 +50,13 @@
50 50 jQuery('#logs_compact_records_button').on('click', function () {
51 51 let year = jQuery('#mainwp_module_log_compact_year').dropdown('get value');
52 52 mainwp_set_message_zone('#mainwp-message-zone');
53 53 if (0 == year) {
54 - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Please select year.'), 'red');
54 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Please select year.'), 'red');
55 55 return;
56 56 }
57 57
58 - let msg = __('Are you sure you want to compact logs for selected year?');
58 + let msg = MainWP.I18n.t('Are you sure you want to compact logs for selected year?');
59 59
60 60 mainwp_confirm(msg, function () {
61 61 let data = mainwp_secure_data({
62 62 action: 'mainwp_module_log_compact_records',
@@ -61,18 +61,50 @@
61 61 let data = mainwp_secure_data({
62 62 action: 'mainwp_module_log_compact_records',
63 63 year: year,
64 64 });
65 - mainwp_set_message_zone('#mainwp-message-zone', __('Running ...'), 'green');
65 + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green');
66 66 jQuery.post(ajaxurl, data, function (response) {
67 67 mainwp_set_message_zone('#mainwp-message-zone');
68 68 if (response.error) {
69 69 mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red');
70 70 } else if (response.result) {
71 - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Logs records has been compact successfully.'), 'green');
71 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Logs records has been compact successfully.'), 'green');
72 72 } else {
73 - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Undefined error. Please try again.'), 'red');
73 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red');
74 74 }
75 + }, 'json');
76 + });
77 + return false;
78 + });
79 +
80 +
81 +
82 + jQuery('.mainwp-acts-logs-big-child-db-cleanup-btn').on('click', function () {
83 + let msg = MainWP.I18n.t('Are you sure you want to clean up activity logs for the selected site?');
84 + mainwp_confirm(msg, () => {
85 + let data = mainwp_secure_data({
86 + action: 'mainwp_module_log_clean_up_child_logs',
87 + siteid: jQuery(this).data('siteid'),
88 + });
89 +
90 + $(this).attr('disabled', 'disabled');
91 +
92 + let btn = $(this);
93 +
94 + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green');
95 + jQuery.post(ajaxurl, data, function (response) {
96 + mainwp_set_message_zone('#mainwp-message-zone');
97 + if (response?.error) {
98 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red');
99 + } else if (response?.success) {
100 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Log records were cleaned up successfully.'), 'green');
101 + $(btn).closest('.item').fadeOut(3000);
102 + return;
103 + } else {
104 + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red');
105 + }
106 + $(btn).attr('disabled', false);
75 107 }, 'json');
76 108 });
77 109 return false;
78 110 });