(trafficshaper) add burst option to pipes and clean up extra spaces

This commit is contained in:
Jos Schellevis 2015-06-25 18:43:59 +02:00
parent c63ef62075
commit 0f7cc6f9fe
5 changed files with 21 additions and 5 deletions

View File

@ -216,7 +216,7 @@ class SettingsController extends ApiControllerBase
$searchPhrase = $this->request->getPost('searchPhrase', 'string', '');
// create model and fetch query resuls
$fields = array("enabled","number", "bandwidth","bandwidthMetric","description","mask","origin");
$fields = array("enabled","number", "bandwidth","bandwidthMetric","burst","description","mask","origin");
$mdlShaper = new TrafficShaper();
$grid = new UIModelGrid($mdlShaper->pipes->pipe);
return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);

View File

@ -16,6 +16,17 @@
<label>bandwidth Metric</label>
<type>dropdown</type>
</field>
<field>
<id>pipe.burst</id>
<label>burst</label>
<type>text</type>
<help>If the data to be sent exceeds the pipe's bandwidth limit (and
the pipe was previously idle), up to size bytes of data are
allowed to bypass the dummynet scheduler, and will be sent as
fast as the physical link allows.
</help>
<advanced>true</advanced>
</field>
<field>
<id>pipe.queue</id>
<label>queue</label>

View File

@ -32,6 +32,10 @@
</OptionValues>
<ValidationMessage>Bandwidth metric should be one of bit,Kbit,Mbit</ValidationMessage>
</bandwidthMetric>
<burst type="IntegerField">
<Required>N</Required>
<ValidationMessage>The burst value is an integer and represent a number of bytes.</ValidationMessage>
</burst>
<queue type="IntegerField">
<Required>N</Required>
<MinimumValue>2</MinimumValue>

View File

@ -114,6 +114,7 @@ POSSIBILITY OF SUCH DAMAGE.
<th data-column-id="number" data-type="number" data-visible="false">Number</th>
<th data-column-id="bandwidth" data-type="number">Bandwidth</th>
<th data-column-id="bandwidthMetric" data-type="string">Metric</th>
<th data-column-id="burst" data-type="number">Burst</th>
<th data-column-id="mask" data-type="string">Mask</th>
<th data-column-id="description" data-type="string">Description</th>
<th data-column-id="commands" data-width="7em" data-formatter="commands" data-sortable="false">Commands</th>

View File

@ -31,10 +31,10 @@ flush
#======================================================================================
{% if helpers.exists('OPNsense.TrafficShaper.pipes.pipe') %}
{% for pipe in helpers.toList('OPNsense.TrafficShaper.pipes.pipe') %}
pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/s {%
if pipe.queue %} queue {{ pipe.queue }} {%
if pipe.queueMetric != 'slots' %} {{pipe.queueMetric}} {% endif %} {% endif
%} {% if pipe.mask != 'none' %} mask {{ pipe.mask }} 0xffffffff {% endif %}
pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/s{% if pipe.burst %} burst {{ pipe.burst }}{% endif %}{%
if pipe.queue %} queue {{ pipe.queue }}{%
if pipe.queueMetric != 'slots' %}{{pipe.queueMetric}}{% endif %}{% endif
%}{% if pipe.mask != 'none' %} mask {{ pipe.mask }} 0xffffffff {% endif %}
{% endfor %}
{% endif %}