diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 00eadc69..4e41ac8a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -36,6 +36,8 @@ "Equipement", "esata", "Etat", + "Eteindre", + "Etes", "firmver", "Formated", "freebsd", diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 23ff2898..9909f35e 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -241,12 +241,14 @@ public static function pullCustom($_options) { $mem_stats = config::byKey('configStatsMemCustom', 'Monitoring', '0') == '1' ? true : false; if ($mem_stats) { $mem_start_usage = memory_get_usage(); - log::add('Monitoring', 'info', '[PULLCUSTOM] Memory Usage Start :: ' . round($mem_start_usage / 1024, 2) . ' Ko'); } /** @var Monitoring $Monitoring */ $Monitoring = Monitoring::byId($_options['Monitoring_Id']); if (is_object($Monitoring)) { + if ($mem_stats) { + log::add('Monitoring', 'info', '[' . $Monitoring->getName() .'][PULLCUSTOM] Memory Usage Start :: ' . round($mem_start_usage / 1024, 2) . ' Ko'); + } $cronState = $Monitoring->getCmd(null, 'cron_status'); if (is_object($cronState) && $cronState->execCmd() === 0) { log::add('Monitoring', 'debug', '[' . $Monitoring->getName() .'][PULLCUSTOM] Pull (Custom) :: En Pause'); @@ -270,20 +272,20 @@ public static function pullCustom($_options) { } $Monitoring->refreshWidget(); } + if ($mem_stats) { + $mem_end_usage = memory_get_usage(); + log::add('Monitoring', 'info', '[' . $Monitoring->getName() .'][PULLCUSTOM] Memory Usage End :: ' . round($mem_end_usage / 1024, 2) . ' Ko | Conso :: ' . round(($mem_end_usage - $mem_start_usage) / 1024, 2) . ' Ko'); + } } - if ($mem_stats) { - $mem_end_usage = memory_get_usage(); - log::add('Monitoring', 'info', '[PULLCUSTOM] Memory Usage End :: ' . round($mem_end_usage / 1024, 2) . ' Ko | Conso :: ' . round(($mem_end_usage - $mem_start_usage) / 1024, 2) . ' Ko'); - } } - public static function postConfig_configPullLocal($value) { - log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration PullLocal :: '. $value); - } - + public static function postConfig_configPullLocal($value) { + log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration PullLocal :: ' . $value); + } + public static function postConfig_configPull($value) { - log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration Pull :: '. $value); - } + log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration Pull :: ' . $value); + } // Fonction exécutée automatiquement avant la suppression de l'équipement public function preRemove() { @@ -2116,10 +2118,10 @@ public function postSave() { $cron->save(); } else { $cron = cron::byClassAndFunction('Monitoring', 'pullCustom', array('Monitoring_Id' => intval($this->getId()))); - if (is_object($cron)) { - log::add('Monitoring', 'debug', '['. $this->getName() .'][POSTSAVE] Remove CustomPull'); - $cron->remove(); - } + if (is_object($cron)) { + log::add('Monitoring', 'debug', '[' . $this->getName() . '][POSTSAVE] Remove CustomPull'); + $cron->remove(); + } } $this->getInformations(); @@ -2327,9 +2329,11 @@ public function toHtml($_version = 'dashboard') { $replace['#multi_network_cards#'] = template_replace($replace, $multi_network_html); } - // Use a specific template for AsusWRT and default for others + // Use specific templates for AsusWRT, Synology, and default for others if ($this->getConfiguration('asuswrt') == '1') { $template = 'AsusWRT'; + } elseif ($this->getConfiguration('synology') == '1') { + $template = 'Synology'; } else { $template = 'Monitoring'; } diff --git a/core/template/dashboard/AsusWRT.html b/core/template/dashboard/AsusWRT.html index 42cd756a..39ad65ab 100644 --- a/core/template/dashboard/AsusWRT.html +++ b/core/template/dashboard/AsusWRT.html @@ -1,8 +1,12 @@ -