diff options
Diffstat (limited to 'src/usr/local/www/services_wol.php')
-rw-r--r-- | src/usr/local/www/services_wol.php | 191 |
1 files changed, 87 insertions, 104 deletions
diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php index e443ab0..37b46b6 100644 --- a/src/usr/local/www/services_wol.php +++ b/src/usr/local/www/services_wol.php @@ -42,13 +42,14 @@ ##|-PRIV require("guiconfig.inc"); +require_once('classes/Form.class.php'); if (!is_array($config['wol']['wolentry'])) { $config['wol']['wolentry'] = array(); } $a_wol = &$config['wol']['wolentry']; -if ($_GET['wakeall'] <> "") { +if($_GET['wakeall'] != "") { $i = 0; $savemsg = ""; foreach ($a_wol as $wolent) { @@ -121,113 +122,95 @@ if ($_GET['act'] == "del") { $pgtitle = array(gettext("Services"), gettext("Wake on LAN")); include("head.inc"); +print_info_box(gettext('This service can be used to wake up (power on) computers by sending special') . ' "' . gettext('Magic Packets') . '"<br />' . + gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).')); + ?> -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php include("fbegin.inc"); ?> -<?php if ($input_errors) print_input_errors($input_errors); ?> -<?php if ($savemsg) print_info_box($savemsg); ?> -<form action="services_wol.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="wake on lan"> - <tr> - <td colspan="2" valign="top" class="listtopic"><?=gettext("Wake on LAN");?></td> - </tr> - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> - <td width="78%" class="vtable"> - <select name="interface" class="formselect"> - <?php - $interfaces = get_configured_interface_with_descr(); - foreach ($interfaces as $iface => $ifacename): ?> - <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $if) echo "selected=\"selected\""; ?>> - <?=htmlspecialchars($ifacename);?> - </option> - <?php endforeach; ?> - </select> - <br /> - <span class="vexpl"><?=gettext("Choose which interface the host to be woken up is connected to.");?></span> - </td> - </tr> - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td> - <td width="78%" class="vtable"> - <input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($mac);?>" /> - <br /> - <?=gettext("Enter a MAC address ");?><span class="vexpl"> <?=gettext("in the following format: xx:xx:xx:xx:xx:xx");?></span> - </td> - </tr> - <tr> - <td width="22%" valign="top"> </td> - <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Send");?>" /> - </td> - </tr> - </table> - <br /> - <?=gettext("Wake all clients at once: ");?><a href="services_wol.php?wakeall=true"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wol_all.gif" width="17" height="17" border="0" alt="wol all" /></a><br/> - <?=gettext("Or Click the MAC address to wake up an individual device:");?> - <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="clients"> - <tr> - <td width="15%" class="listhdrr"><?=gettext("Interface");?></td> - <td width="25%" class="listhdrr"><?=gettext("MAC address");?></td> - <td width="50%" class="listhdr"><?=gettext("Description");?></td> - <td width="10%" class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td valign="middle" width="17"></td> - <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td> - </tr> - </table> - </td> - </tr> <?php - $i = 0; - foreach ($a_wol as $wolent): + +if ($input_errors) + print_input_errors($input_errors); + +if ($savemsg) + print_info_box($savemsg); + +$form = new Form('Send'); + +$section = new Form_Section('Wake on LAN'); + +$section->addInput(new Form_Select( + 'interface', + 'Interface', + (link_interface_to_bridge($if) ? null : $if), + get_configured_interface_with_descr() +))->setHelp('Choose which interface the host to be woken up is connected to.'); + +$section->addInput(new Form_Input( + 'mac', + 'MAC address', + 'text', + $mac +))->setHelp(gettext('Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx')); + +$form->add($section); +print $form; ?> - <tr> - <td class="listlr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';"> - <?=convert_friendly_interface_to_friendly_descr($wolent['interface']);?> - </td> - <td class="listr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';"> - <a href="?mac=<?=$wolent['mac'];?>&if=<?=$wolent['interface'];?>"><?=strtolower($wolent['mac']);?></a> - </td> - <td class="listbg" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';"> - <?=htmlspecialchars($wolent['descr']);?> - </td> - <td valign="middle" class="list nowrap"> - <table border="0" cellspacing="0" cellpadding="1" summary="icons"> + +<div class="panel panel-default"> + <div class="panel-heading"> + <h2 class="panel-title">Wake on LAN devices</h2> + </div> + + <div class="panel-body"> + <p><?=gettext("Click the MAC address to wake up an individual device.")?></p> + <div class="table-responsive"> + <table class="table table-striped table-hover"> + <thead> <tr> - <td valign="middle"><a href="services_wol_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td> - <td valign="middle"><a href="services_wol.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td> + <th><?=gettext("Interface")?></th> + <th><?=gettext("MAC address")?></th> + <th><?=gettext("Description")?></th> + <th></th> </tr> - </table> - </td> - </tr> + </thead> + <tbody> + <?php foreach ($a_wol as $i => $wolent): ?> + <tr> + <td> + <?=convert_friendly_interface_to_friendly_descr($wolent['interface']);?> + </td> + <td> + <a href="?mac=<?=$wolent['mac'];?>&if=<?=$wolent['interface'];?>"><?=strtolower($wolent['mac']);?></a> + </td> + <td> + <?=htmlspecialchars($wolent['descr']);?> + </td> + <td> + <a class="btn btn-xs btn-primary" href="services_wol_edit.php?id=<?=$i?>"> + edit + </a> + <a class="btn btn-xs btn-danger" href="services_wol.php?act=del&id=<?=$i?>"> + delete + </a> + </td> + </tr> + <?php endforeach?> + </tbody> + </table> + </div> + </div> + <div class="panel-footer"> + <a class="btn btn-success" href="services_wol_edit.php"> + Add + </a> + + <a href="services_wol.php?wakeall=true" role="button" class="btn btn-primary"> + <?=gettext("Wake all devices")?> + </a> + </div> +</div> + <?php - $i++; - endforeach; -?> - <tr> - <td class="list" colspan="3"></td> - <td class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td valign="middle" width="17"></td> - <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td> - </tr> - </table> - </td> - </tr> - </table> - <span class="vexpl"> - <span class="red"> - <strong> - <?=gettext("Note:");?><br /> - </strong> - </span> - <?=gettext("This service can be used to wake up (power on) computers by sending special"); ?> "<?=gettext("Magic Packets"); ?>". <?=gettext("The NIC in the computer that is to be woken up must support Wake on LAN and has to be configured properly (WOL cable, BIOS settings). ");?> - </span> -</form> -<?php include("fend.inc"); ?> -</body> -</html> + +include("foot.inc");
\ No newline at end of file |