diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-01-07 10:04:21 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-01-07 10:04:21 -0500 |
commit | 37d4f3639a9fab1ccfcb53130aff66e2140a72d1 (patch) | |
tree | 8e2fea60ffa46e244e6cc26d3945da344959c45f /src/etc | |
parent | eccb4c9ea5f2f7e350bd3878b4e86edecbe9f25c (diff) | |
parent | bfc94df0bf33e520287e61b740c9c0af0481b8f3 (diff) | |
download | pfsense-37d4f3639a9fab1ccfcb53130aff66e2140a72d1.zip pfsense-37d4f3639a9fab1ccfcb53130aff66e2140a72d1.tar.gz |
Merge pull request #2372 from phil-davis/patch-2
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/shaper.inc | 82 |
1 files changed, 63 insertions, 19 deletions
diff --git a/src/etc/inc/shaper.inc b/src/etc/inc/shaper.inc index 25afd86..3d48490 100644 --- a/src/etc/inc/shaper.inc +++ b/src/etc/inc/shaper.inc @@ -292,7 +292,7 @@ class altq_root_queue { var $interface; var $tbrconfig ; var $bandwidth; - var $bandwidthtype; /* b, Kb, Mb */ + var $bandwidthtype; /* b, Kb, Mb, Gb, % */ var $scheduler; var $qlimit; var $queues = array(); @@ -383,6 +383,28 @@ class altq_root_queue { $this->qlimit = $limit; } + function GetBwscaleText() { + switch ($this->bandwidthtype) { + case "b": + $bwscaletext = "Bit/s"; + break; + case "Kb": + $bwscaletext = "Kbit/s"; + break; + case "Mb": + $bwscaletext = "Mbit/s"; + break; + case "Gb": + $bwscaletext = "Gbit/s"; + break; + default: + /* For others that do not need translating like % */ + $bwscaletext = $this->bandwidthtype; + break; + } + return $bwscaletext; + } + function validate_input($data, &$input_errors) { $reqdfields[] = "bandwidth"; @@ -719,7 +741,7 @@ class altq_root_queue { $form .= 'Bandwidth'; $form .= ' </dt>'; $form .= ' <dd>'; - $form .= $this->GetBandwidth() . ' ' . $this->GetBwscale(); + $form .= $this->GetBandwidth() . ' ' . $this->GetBwscaleText(); $form .= ' </dd>'; $form .= ' <dt>'; @@ -792,10 +814,10 @@ class altq_root_queue { 'bandwidthtype', null, $this->GetBwscale(), - array('Kb' => 'Kb', - 'Mb' => 'Mb', - 'Gb' => 'Gb', - 'b' => 'b', + array('Kb' => 'Kbit/s', + 'Mb' => 'Mbit/s', + 'Gb' => 'Gbit/s', + 'b' => 'Bit/s', '%' => '%') )); @@ -1022,6 +1044,28 @@ class priq_queue { $this->qack = $ack; } + function GetBwscaleText() { + switch ($this->qbandwidthtype) { + case "b": + $bwscaletext = "Bit/s"; + break; + case "Kb": + $bwscaletext = "Kbit/s"; + break; + case "Mb": + $bwscaletext = "Mbit/s"; + break; + case "Gb": + $bwscaletext = "Gbit/s"; + break; + default: + /* For others that do not need translating like % */ + $bwscaletext = $this->qbandwidthtype; + break; + } + return $bwscaletext; + } + function build_javascript() { $javascript = "<script type=\"text/javascript\">"; $javascript .= "//<![CDATA[\n"; @@ -1449,7 +1493,7 @@ class priq_queue { $form .= 'Bandwidth'; $form .= ' </dt>'; $form .= ' <dd>'; - $form .= $this->GetBandwidth() . ' ' . $this->GetBwscale(); + $form .= $this->GetBandwidth() . ' ' . $this->GetBwscaleText(); $form .= ' </dd>'; $tmpvalue = $this->GetQpriority(); @@ -2220,10 +2264,10 @@ EOJS; 'bandwidthtype', null, $this->GetBwscale(), - array('Kb' => 'Kb', - 'Mb' => 'Mb', - 'Gb' => 'Gb', - 'b' => 'b', + array('Kb' => 'Kbit/s', + 'Mb' => 'Mbit/s', + 'Gb' => 'Gbit/s', + 'b' => 'Bit/s', '%' => '%') )); @@ -2778,10 +2822,10 @@ class cbq_queue extends priq_queue { 'bandwidthtype', null, $this->GetBwscale(), - array('Kb' => 'Kb', - 'Mb' => 'Mb', - 'Gb' => 'Gb', - 'b' => 'b', + array('Kb' => 'Kbit/s', + 'Mb' => 'Mbit/s', + 'Gb' => 'Gbit/s', + 'b' => 'Bit/s', '%' => '%') )); @@ -3079,10 +3123,10 @@ class fairq_queue extends priq_queue { 'bandwidthtype', null, $this->GetBwscale(), - array('Kb' => 'Kb', - 'Mb' => 'Mb', - 'Gb' => 'Gb', - 'b' => 'b', + array('Kb' => 'Kbit/s', + 'Mb' => 'Mbit/s', + 'Gb' => 'Gbit/s', + 'b' => 'Bit/s', '%' => '%') )); |