mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix up the formatting of the Wake on LAN widget and change the code style so it isn't a bunch of echos. Fixes #5960
This commit is contained in:
parent
4af2649f7f
commit
b35edfe772
@ -78,32 +78,39 @@ if (is_array($config['wol']['wolentry'])) {
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (count($wolcomputers) > 0) {
|
||||
foreach ($wolcomputers as $wolent) {
|
||||
echo '<tr><td>' . $wolent['descr'] . '<br />' . $wolent['mac'] . '</td>' . "\n";
|
||||
echo '<td>' . convert_friendly_interface_to_friendly_descr($wolent['interface']) . '</td>' . "\n";
|
||||
|
||||
if (count($wolcomputers) > 0):
|
||||
foreach ($wolcomputers as $wolent):
|
||||
$is_active = exec("/usr/sbin/arp -an |/usr/bin/grep {$wolent['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
|
||||
$status = exec("/usr/sbin/arp -an | /usr/bin/awk '$4 == \"{$wolent['mac']}\" { print $7 }'");
|
||||
|
||||
if ($status == 'expires') {
|
||||
echo '<i class="fa fa-arrow-right" data-toggle="tooltip" title="' . gettext("Online") . '"></i>';
|
||||
} else if ($status == 'permanent') {
|
||||
echo '<td class="text-center">' . "\n";
|
||||
echo '<i class="fa fa-arrow-right" data-toggle="tooltip" title="' . gettext("Static ARP") . '"></i>';
|
||||
} else {
|
||||
echo '<td class="text-center">' . "\n";
|
||||
echo '<i class="fa fa-ban" data-toggle="tooltip" title="' . gettext("Offline") . '"></i>';
|
||||
}
|
||||
|
||||
echo "</td>\n<td>";
|
||||
echo "<a href='services_wol.php?mac={$wolent['mac']}&if={$wolent['interface']}'> ";
|
||||
echo '<i class="fa fa-bed" data-toggle="tooltip" title="' . gettext("Wake up!") . '"></i></a>' . "\n";
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
} else {
|
||||
echo "<tr><td colspan=\"4\" class=\"text-center\">" . gettext("No saved WoL addresses") . ".</td></tr>\n";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $wolent['descr'] ?><br />
|
||||
<?= $wolent['mac'] ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= convert_friendly_interface_to_friendly_descr($wolent['interface']) ?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?php if ($status == 'expires'): ?>
|
||||
<i class="fa fa-arrow-right" data-toggle="tooltip" title="<?= gettext("Online") ?>"></i>
|
||||
<?php elseif ($status == 'permanent'): ?>
|
||||
<i class="fa fa-arrow-right" data-toggle="tooltip" title="<?= gettext("Static ARP") ?>"></i>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-ban" data-toggle="tooltip" title="<?= gettext("Offline") ?>"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="services_wol.php?mac=<?= $wolent['mac'] ?>&if=<?= $wolent['interface']?>">
|
||||
<i class="fa fa-bed" data-toggle="tooltip" title="<?= gettext("Wake up!") ?>"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;
|
||||
else: ?>
|
||||
<tr><td colspan="4" class="text-center"><?= gettext("No saved WoL addresses") ?></td></tr>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user