diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-11-25 16:59:24 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-11-25 16:59:24 +0000 |
commit | 392cd413c1c6269d027e2da15f466928e6715271 (patch) | |
tree | 1037b5b111f792909086ababa2e6834dee1a35dc /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | |
parent | c19900ef564b9523850f7323831820f12facf493 (diff) | |
download | pfsense-392cd413c1c6269d027e2da15f466928e6715271.zip pfsense-392cd413c1c6269d027e2da15f466928e6715271.tar.gz |
Resolves #169. Show interface friendly names during the wizards. Some more cosemtics is needed in this wizard but this is a first step.
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc')
-rwxr-xr-x | usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | 185 |
1 files changed, 92 insertions, 93 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index d4185be..76cd710 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -50,16 +50,15 @@ function step2_stepbeforeformdisplay() { $numberofinterfaces = 0; $iflist = array(); - foreach ($config['interfaces'] as $if => $ifdesc) { - if (!is_altq_capable($ifdesc['if'])) - continue; - if (!isset($ifdesc['enable']) && $if != "lan" && $if != "wan") - continue; - if ($if == "lan") - continue; - $numberofinterfaces++; - $iflist[] = $if; - } + $iflisttmp = get_configured_interface_with_descr(); + foreach ($iflisttmp as $if => $ifdesc) { + if (!is_altq_capable(get_real_interface($if))) + continue; + if ($if == "lan") + continue; + $numberofinterfaces++; + $iflist[$if] = $ifdesc; + } $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); if ($numberofconnections > $numberofinterfaces) { $message=gettext("You have less interfaces than number of connections!"); @@ -86,10 +85,10 @@ function step2_stepbeforeformdisplay() { */ $fields = array(); - $field = array(); - $field['name'] = "Setup LAN schedulers"; - $field['type'] = "listtopic"; - $fields[] = $field; + $field = array(); + $field['name'] = "Setup LAN schedulers"; + $field['type'] = "listtopic"; + $fields[] = $field; for ($i = 0; $i < $numberoflocalinterfaces; $i++) { $field = array(); @@ -97,12 +96,13 @@ function step2_stepbeforeformdisplay() { $field['type'] = "select"; // $field['typehint'] = "Interface of this connection."; $field['options']['option'] = array(); - foreach ($iflist as $ifname) { - $opts = array(); - $opts['name'] = $ifname; - $opts['value'] = $ifname; - $field['options']['option'][] = $opts; - } + foreach ($iflist as $ifname => $ifdescr) { + $opts = array(); + $opts['displayname'] = $ifdescr; + $opts['name'] = $ifname; + $opts['value'] = $ifname; + $field['options']['option'][] = $opts; + } /* LAN is needed here */ $opts = array(); $opts['name'] = "lan"; @@ -118,31 +118,30 @@ function step2_stepbeforeformdisplay() { $field['dontdisplayname'] = "true"; $field['dontcombinecells'] = "true"; - $field['name'] = "local{$i}downloadscheduler"; - $field['type'] = "select"; - $field['typehint'] = "Queueing discipline to apply on this local interface."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "HFSC"; - $opts['value'] = "HFSC"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "CBQ"; - $opts['value'] = "CBQ"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PRIQ"; - $opts['value'] = "PRIQ"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->local{$i}downloadscheduler"; - $fields[] = $field; - + $field['name'] = "local{$i}downloadscheduler"; + $field['type'] = "select"; + $field['typehint'] = "Queueing discipline to apply on this local interface."; + $field['options']['option'] = array(); + $opts = array(); + $opts['name'] = "HFSC"; + $opts['value'] = "HFSC"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['name'] = "CBQ"; + $opts['value'] = "CBQ"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['name'] = "PRIQ"; + $opts['value'] = "PRIQ"; + $field['options']['option'][] = $opts; + $field['bindstofield'] = "ezshaper->step2->local{$i}downloadscheduler"; + $fields[] = $field; } - $field = array(); - $field['name'] = "Setup connections speeds"; - $field['type'] = "listtopic"; - $fields[] = $field; + $field = array(); + $field['name'] = "Setup connections speeds"; + $field['type'] = "listtopic"; + $fields[] = $field; for ($i = 0; $i < $numberofconnections; $i++) { @@ -158,14 +157,15 @@ function step2_stepbeforeformdisplay() { $interface_real = $i+1; $field['typehint'] = "Select interface #{$interface_real} that you would like to shape"; $field['options']['option'] = array(); - foreach ($iflist as $ifname) { - $opts = array(); - $opts['name'] = $ifname; - $opts['value'] = $ifname; - $field['options']['option'][] = $opts; - } + foreach ($iflist as $ifname => $ifdescr) { + $opts = array(); + $opts['displayname'] = $ifdescr; + $opts['name'] = $ifname; + $opts['value'] = $ifname; + $field['options']['option'][] = $opts; + } $field['bindstofield'] = "ezshaper->step2->conn{$i}interface"; - $fields[] = $field; + $fields[] = $field; $field['name'] = "conn{$i}uploadscheduler"; $field['type'] = "select"; @@ -184,14 +184,14 @@ function step2_stepbeforeformdisplay() { $opts['value'] = "PRIQ"; $field['options']['option'][] = $opts; $field['bindstofield'] = "ezshaper->step2->conn{$i}uploadscheduler"; - $fields[] = $field; + $fields[] = $field; $field = array(); $field['name'] = "conn{$i}upload"; $field['type'] = "input"; $field['bindstofield'] = "ezshaper->step2->conn{$i}upload"; $field['combinefieldsbegin'] = "true"; - $fields[] = $field; + $fields[] = $field; $field = array(); $field['combinefieldsend'] = "true"; @@ -199,58 +199,57 @@ function step2_stepbeforeformdisplay() { $field['dontcombinecells'] = "true"; $field['name'] = "conn{$i}uploadspeed"; $field['typehint'] = "Upload bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}uploadspeed"; - $fields[] = $field; + $field['type'] = "select"; + $field['options']['option'] = array(); + $opts = array(); + $opts['value'] = "Kb"; + $opts['name'] = "Kbit/s"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['value'] = "Mb"; + $opts['name'] = "Mbit/s"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['value'] = "Gb"; + $opts['name'] = "Gbit/s"; + $field['options']['option'][] = $opts; + $field['bindstofield'] = "ezshaper->step2->conn{$i}uploadspeed"; + $fields[] = $field; $field = array(); $field['name'] = "conn{$i}download"; $field['type'] = "input"; $field['bindstofield'] = "ezshaper->step2->conn{$i}download"; $field['combinefieldsbegin'] = "true"; - $fields[] = $field; + $fields[] = $field; $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "conn{$i}downloadspeed"; + $field['combinefieldsend'] = "true"; + $field['dontdisplayname'] = "true"; + $field['dontcombinecells'] = "true"; + $field['name'] = "conn{$i}downloadspeed"; $field['typehint'] = "Download bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}downloadspeed"; - $fields[] = $field; + $field['type'] = "select"; + $field['options']['option'] = array(); + $opts = array(); + $opts['value'] = "Kb"; + $opts['name'] = "Kbit/s"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['value'] = "Mb"; + $opts['name'] = "Mbit/s"; + $field['options']['option'][] = $opts; + $opts = array(); + $opts['value'] = "Gb"; + $opts['name'] = "Gbit/s"; + $field['options']['option'][] = $opts; + $field['bindstofield'] = "ezshaper->step2->conn{$i}downloadspeed"; + $fields[] = $field; } - $field = array(); - $field['name'] = "Next"; - $field['type'] = "submit"; + $field = array(); + $field['name'] = "Next"; + $field['type'] = "submit"; $fields[] = $field; - } function step2_stepsubmitphpaction() { |