Skip to content

Commit

Permalink
Health page fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Sep 13, 2024
1 parent 9a15d34 commit 28b0481
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/php/AbeilleParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function &getDevice($net, $addr, $ieee = null, &$new = false) {
continue; // This network has already been checked

foreach ($GLOBALS['devices'][$oldNet] as $oldAddr => $eq) {
if ($eq['zigbee']['ieee'] !== $ieee)
if (!isset($eq['zigbee']['ieee']) || ($eq['zigbee']['ieee'] !== $ieee))
continue;

$GLOBALS['devices'][$net][$addr] = $eq; // net & addr update
Expand Down
10 changes: 5 additions & 5 deletions desktop/modal/AbeilleHealth.modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ function refreshHealth() {
console.log("net="+net+" => gtwId="+gtwId+", color="+netColor);
n = equipments[net];
parentBridge = equipments[net]['0000'];
bridgeEnabled = parentBridge.isEnabled;
gtwEnabled = parentBridge.isEnabled;
for (addr in n) {
// console.log("LA2 addr=", addr);
e = n[addr];
if ((e.isEnabled == 0) || (bridgeEnabled == 0)) { // Equipment disabled or its parent bridge ?
if ((e.isEnabled == 0) || (gtwEnabled == 0)) { // Equipment disabled or its parent bridge ?
dis1 = '<s>';
dis2 = '</s>';
} else {
Expand Down Expand Up @@ -175,7 +175,7 @@ function refreshHealth() {
// Status: Updated every minutes by cron() (see Abeille.class.php)
if (e.isEnabled == 0) // Disabled ?
status = '<span class="label label-default" style="font-size: 1em; cursor: default;">{{Désactivé}}</span>';
else if (bridgeEnabled == 0) // Parent bridge disabled ?
else if (gtwEnabled == 0) // Parent bridge disabled ?
status = '<span class="label label-default" style="font-size: 1em; cursor: default;">{{BR désactivé}}</span>';
else if (addr.substr(2) == "rc") // Remote control ?
status = '<span class="label label-success" style="font-size: 1em; cursor: default;">-</span>';
Expand Down Expand Up @@ -217,8 +217,8 @@ function refreshHealth() {

tr += '</tr>';

// Updating gateway status if coordinator (addr 0000)
if (addr = '0000') {
// Updating gateway status if coordinator (addr 0000) & enabled
if ((addr == '0000') && (gtwEnabled == 1)) {
let gtwSpan = document.getElementById("idGtw"+gtwId);
if (e.gtwType == 'zigate')
gtwSpan.textContent = "Zigate " + gtwId;
Expand Down
1 change: 1 addition & 0 deletions docs/fr_FR/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Corrections: Interne: Syntaxe PHP8.
- Corrections: Interne: install.php & AbeilleTools.class.php
- Amélioration: Flasher PI Zigate: Création package standalone.
- Correction: Page santé. Crash interne si plusieurs autre passerelles désactivées.

## 240902-BETA-1

Expand Down

0 comments on commit 28b0481

Please sign in to comment.