net/wol: change this back, bug in getArp()

This commit is contained in:
Franco Fichtner
2024-08-26 15:09:49 +02:00
parent ba175b5cc6
commit fd504cf04a
2 changed files with 4 additions and 12 deletions
@@ -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)
@@ -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 = [`<b>${this.translations.msg_empty_wol}</b>`];
rows.push(empty_list);
} else {
} else {
const header = [`<b>${this.translations.h_device}</b>`,
`<b>${this.translations.h_interface}</b>`,
`<b>${this.translations.h_status}</b>`,
@@ -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 + '<br/>': ''} ${item.mac}`,
`${item.interface}`,