diff options
author | Ermal <eri@pfsense.org> | 2012-05-18 19:49:41 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-05-18 19:49:41 +0000 |
commit | 1346306cf7bdc82d4f33b607e46452fe6efa691f (patch) | |
tree | ec0c166a3633206053490a64a0eec9ae3a20b667 /usr/local/www | |
parent | 9c408ade49967be256a02a4ee64aedee6614e6b3 (diff) | |
download | pfsense-1346306cf7bdc82d4f33b607e46452fe6efa691f.zip pfsense-1346306cf7bdc82d4f33b607e46452fe6efa691f.tar.gz |
Allow 802.1p tags to be controlled from firewall rules edit screen
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 41 | ||||
-rw-r--r-- | usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js | 6 |
2 files changed, 47 insertions, 0 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index b53d151..2629731 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -171,6 +171,8 @@ if (isset($id) && $a_filter[$id]) { //schedule support $pconfig['sched'] = $a_filter[$id]['sched']; + $pconfig['vlanprio'] = $a_filter[$id]['vlanprio']; + $pconfig['vlanprioset'] = $a_filter[$id]['vlanprioset']; if (!isset($_GET['dup'])) $pconfig['associated-rule-id'] = $a_filter[$id]['associated-rule-id']; @@ -576,6 +578,13 @@ if ($_POST) { $filterent['sched'] = $_POST['sched']; } + if ($_POST['vlanprio'] != "") { + $filterent['vlanprio'] = $_POST['vlanprio']; + } + if ($_POST['vlanprioset'] != "") { + $filterent['vlanprioset'] = $_POST['vlanprioset']; + } + // If we have an associated nat rule, make sure the source and destination doesn't change if( isset($a_filter[$id]['associated-rule-id']) ) { $filterent['interface'] = $a_filter[$id]['interface']; @@ -1249,6 +1258,38 @@ $i--): ?> </div> </td> </tr> + <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("802.1p");?></td> + <td width="78%" class="vtable"> + <div id="showadvvlanpriobox" <?php if (!empty($pconfig['vlanprio'])) echo "style='display:none'"; ?>> + <input type="button" onClick="show_advanced_vlanprio()" value="<?=gettext("Advanced"); ?>"></input> - <?=gettext("Show advanced option");?></a> + </div> + <div id="showvlanprioadv" <?php if (empty($pconfig['vlanprio'])) echo "style='display:none'"; ?>> + <?php $vlanprio = array("none", "be", "bk", "ee", "ca", "vi", "vo", "ic", "nc"); ?> +<?php + $opts = ""; + foreach($vlanprio as $vprio) { + if ($vprio == $pconfig['vlanprio']) + $selected = " SELECTED"; + else + $selected = ""; + if ($vprio == "none") + $opts .= "<option value=\"\" {$vprio}>{$vprio}</option>\n"; + else + $opts .= "<option value=\"{$vprio}\" {$selected}>" . strtoupper($vprio) . "</option>\n"; + } +?> + <select name='vlanprio'> + <?php echo $opts; ?> + </select> + <p><?=gettext("Choose 802.1p priority to match on");?></p> + <select name='vlanprioset'> + <?php echo $opts; ?> + </select> + <p><?=gettext("Choose 802.1p priority to apply");?></p> + </div> + </td> + </tr> <?php //build list of schedules $schedules = array(); diff --git a/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js b/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js index 138dbf4..4348b0e 100644 --- a/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js +++ b/usr/local/www/javascript/firewall_rules_edit/firewall_rules_edit.js @@ -149,6 +149,12 @@ function show_advanced_noxmlrpc() { aodiv.style.display = "block"; } +function show_advanced_vlanprio() { + document.getElementById("showadvvlanpriobox").innerHTML=''; + aodiv = document.getElementById('showvlanprioadv'); + aodiv.style.display = "block"; +} + function show_advanced_schedule() { document.getElementById("showadvschedulebox").innerHTML=''; aodiv = document.getElementById('showscheduleadv'); |