Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"Equipement",
"esata",
"Etat",
"Eteindre",
"Etes",
"firmver",
"Formated",
"freebsd",
Expand Down
36 changes: 20 additions & 16 deletions core/class/Monitoring.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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';
}
Expand Down
1,093 changes: 602 additions & 491 deletions core/template/dashboard/AsusWRT.html

Large diffs are not rendered by default.

1,126 changes: 554 additions & 572 deletions core/template/dashboard/Monitoring.html

Large diffs are not rendered by default.

803 changes: 803 additions & 0 deletions core/template/dashboard/Synology.html

Large diffs are not rendered by default.

953 changes: 516 additions & 437 deletions core/template/mobile/AsusWRT.html

Large diffs are not rendered by default.

954 changes: 461 additions & 493 deletions core/template/mobile/Monitoring.html

Large diffs are not rendered by default.

Loading