PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 2.0.3
JetBackup – Backup, Restore & Migrate v2.0.3
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / public / dashboardWidget.php
backup / public Last commit date
ajax 3 years ago config 3 years ago cron 3 years ago css 3 years ago fonts 3 years ago img 3 years ago include 3 years ago js 3 years ago templates 3 years ago backups.php 3 years ago boot.php 3 years ago cloud.php 3 years ago dashboardWidget.php 3 years ago pagesContent.php 3 years ago proFeatures.php 3 years ago restore_wordpress.php 3 years ago schedule.php 3 years ago settings.php 3 years ago support.php 3 years ago systemInfo.php 3 years ago videoTutorials.php 3 years ago
dashboardWidget.php
109 lines
1 <?php
2 require_once SG_BACKUP_PATH . 'SGBackup.php';
3 // Function that outputs the contents of the dashboard widget
4 function backup_guard_dashboard_widget_function($post, $callback_args)
5 {
6 $backups = SGBackup::getAllBackups();
7 $allBackupsCount = count($backups);
8 $successBackups = 0;
9 $faildBackups = 0;
10 $inprogress = 0;
11 $warningBackups = 0;
12 $canceledBackups = 0;
13
14 for ($i = 0; $i < $allBackupsCount; $i++) {
15 if (empty($backups[$i])) {
16 continue;
17 }
18 switch ($backups[$i]['status']) {
19 case SG_ACTION_STATUS_IN_PROGRESS_DB:
20 case SG_ACTION_STATUS_IN_PROGRESS_FILES:
21 $inprogress++;
22 break;
23 case SG_ACTION_STATUS_FINISHED_WARNINGS:
24 $warningBackups++;
25 break;
26 case SG_ACTION_STATUS_CANCELLED:
27 $canceledBackups++;
28 break;
29 case SG_ACTION_STATUS_ERROR:
30 $faildBackups++;
31 break;
32 default:
33 $successBackups++;
34 }
35 }
36 if (strpos(SG_PRODUCT_IDENTIFIER, "silver") !== false || strpos(SG_PRODUCT_IDENTIFIER, "gold") !== false) {
37 $sgb = new SGBackup();
38 $scheduleParams = $sgb->getScheduleParamsById(SG_SCHEDULER_DEFAULT_ID);
39 $scheduleParams = backupGuardParseBackupOptions($scheduleParams);
40 $schedulesCount = strlen($scheduleParams['label']) ? 1 : 0;
41 } else if (strpos(SG_PRODUCT_IDENTIFIER, "free") === false) { // platinum
42 include_once SG_BACKUP_PATH . 'SGBackupSchedule.php';
43 $allSchedules = SGBackupSchedule::getAllSchedules();
44 $schedulesCount = count($allSchedules);
45 }
46 ?>
47 <div id="canvas-holder" style="width:100%">
48 <canvas id="chart-area"></canvas>
49 </div>
50 <script>
51 function backupGuardLoadChart() {
52 var config = {
53 type: 'pie',
54 data: {
55 datasets: [{
56 data: [
57 <?php echo $successBackups ?>,
58 <?php echo $faildBackups ?>,
59 <?php echo $warningBackups ?>,
60 <?php echo $canceledBackups ?>,
61 <?php echo $inprogress ?>
62
63
64 ],
65 backgroundColor: [
66 "#2b8b3a",
67 "#f96868",
68 "#ffb848",
69 "#7C858E",
70 "#64aed9"
71
72 ],
73 label: 'Dataset 1'
74 }],
75 labels: [
76 "Success (<?php echo $successBackups ?>)",
77 "Failed (<?php echo $faildBackups ?>)",
78 "Warning (<?php echo $warningBackups ?>)",
79 "Canceled (<?php echo $canceledBackups ?>)",
80 "In progress (<?php echo $inprogress ?>)",
81 ]
82 },
83 options: {
84 responsive: true,
85 legend: {
86 labels: {
87 // This more specific font property overrides the global property
88 fontFamily: "'Source Sans Pro', 'Calibri', 'Candara', 'Arial', 'sans-serif'"
89 }
90 }
91 }
92 };
93 <?php
94 if (isset($schedulesCount)) {
95 ?>
96 config.data.datasets[0].data.push(<?php echo $schedulesCount ?>);
97 config.data.datasets[0].backgroundColor.push("#cecece");
98 config.data.labels.push("Schedules (<?php echo $schedulesCount ?>)");
99 <?php }
100 ?>
101 var ctx = document.getElementById("chart-area").getContext("2d");
102 window.backupGuardPieChart = new Chart(ctx, config);
103 }
104
105 backupGuardLoadChart();
106 </script>
107 <?php
108 }
109