From fd504cf04a36ab9218c45e4daadd1ec194aa91f0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 26 Aug 2024 15:09:49 +0200 Subject: [PATCH] net/wol: change this back, bug in getArp() --- .../app/controllers/OPNsense/Wol/Api/WolController.php | 10 +--------- net/wol/src/opnsense/www/js/widgets/WakeOnLan.js | 6 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/net/wol/src/opnsense/mvc/app/controllers/OPNsense/Wol/Api/WolController.php b/net/wol/src/opnsense/mvc/app/controllers/OPNsense/Wol/Api/WolController.php index c6d3255f6..7b7841b5e 100644 --- a/net/wol/src/opnsense/mvc/app/controllers/OPNsense/Wol/Api/WolController.php +++ b/net/wol/src/opnsense/mvc/app/controllers/OPNsense/Wol/Api/WolController.php @@ -69,15 +69,7 @@ class WolController extends ApiMutableModelControllerBase public function searchHostAction() { - $ret = $this->searchBase('wolentry', ['interface', 'mac', 'descr']); - - foreach ($ret['rows'] ?? [] as $idx => $wol) { - /* not entirely accurate naming but it's too much effor to unwind this API */ - $ret['rows'][$idx]['identifier'] = - (string)$this->getModel()->getNodeByReference('wolentry.' . $wol['uuid'])->interface; - } - - return $ret; + return $this->searchBase('wolentry', ['interface', 'mac', 'descr']); } public function getHostAction($uuid = null) diff --git a/net/wol/src/opnsense/www/js/widgets/WakeOnLan.js b/net/wol/src/opnsense/www/js/widgets/WakeOnLan.js index 04c15480d..7a98b6a80 100644 --- a/net/wol/src/opnsense/www/js/widgets/WakeOnLan.js +++ b/net/wol/src/opnsense/www/js/widgets/WakeOnLan.js @@ -50,10 +50,10 @@ export default class WakeOnLan extends BaseTableWidget { const data = await this.ajaxCall('/api/wol/wol/searchHost'); let rows = []; - if (data.total == 0) { + if (data.total == 0) { const empty_list = [`${this.translations.msg_empty_wol}`]; rows.push(empty_list); - } else { + } else { const header = [`${this.translations.h_device}`, `${this.translations.h_interface}`, `${this.translations.h_status}`, @@ -66,7 +66,7 @@ export default class WakeOnLan extends BaseTableWidget { for(let it = 0; it < data.rows.length; it++){ const item = data.rows[it]; - let is_active = this.checkActive(arp, item.mac, item.identifier); + let is_active = this.checkActive(arp, item.mac, item.interface); let row = [ `${item.descr.length !== 0 ? item.descr + '
': ''} ${item.mac}`, `${item.interface}`,