Commit 33136c90 authored by Ad Schellevis's avatar Ad Schellevis

(trafficshaper) work in progress UI parts

parent 9f86d730
......@@ -23,12 +23,28 @@
<type>text</type>
<help></help>
</field>
<field>
<id>rule.src_port</id>
<label>src-port</label>
<type>text</type>
<help></help>
</field>
<field>
<id>rule.destination</id>
<label>destination</label>
<type>text</type>
<help></help>
</field>
<field>
<id>rule.dst_port</id>
<labek>dst-port</labek>
<type>text</type>
</field>
<field>
<id>rule.direction</id>
<label>direction</label>
<type>dropdown</type>
</field>
<field>
<id>rule.target</id>
<label>target</label>
......
......@@ -39,8 +39,8 @@
<default>none</default>
<OptionValues>
<none></none>
<source>source</source>
<destination>destination</destination>
<src-ip>source</src-ip>
<dst-ip>destination</dst-ip>
</OptionValues>
</mask>
<origin type="TextField">
......@@ -71,6 +71,8 @@
<default>ip</default>
<OptionValues>
<ip>ip</ip>
<ip4>ipv4</ip4>
<ip5>ipv6</ip5>
<udp>udp</udp>
<tcp>tcp</tcp>
</OptionValues>
......@@ -79,10 +81,27 @@
<Required>Y</Required>
<default>any</default>
</source>
<src_port type="TextField">
<Required>Y</Required>
<default>any</default>
</src_port>
<destination type="TextField">
<Required>Y</Required>
<default>any</default>
</destination>
<dst_port type="TextField">
<Required>Y</Required>
<default>any</default>
</dst_port>
<direction type="OptionField">
<Required>Y</Required>
<default></default>
<OptionValues>
<both></both>
<in>in</in>
<out>out</out>
</OptionValues>
</direction>
<target type="ModelRelationField">
<Model>
<pipes>
......
......@@ -41,20 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Render pipe grid using searchPipes api
*/
var gridPipes =$("#grid-pipes").bootgrid({
ajax: true,
selection: true,
multiSelect: true,
rowCount:[7,14,20,-1],
url: '/api/trafficshaper/settings/searchPipes',
formatters: {
"commands": function(column, row)
{
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.uuid + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.uuid + "\"><span class=\"fa fa-trash-o\"></span></button>";
}
}
});
var gridPipes = stdBootgridUI("grid-pipes", "/api/trafficshaper/settings/searchPipes");
/**
* Link pipe grid command controls (edit/delete)
......@@ -179,20 +166,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* Render rules grid using searchPipes api
*/
var gridRules =$("#grid-rules").bootgrid({
ajax: true,
selection: true,
multiSelect: true,
rowCount:[7,14,20,-1],
url: '/api/trafficshaper/settings/searchRules',
formatters: {
"commands": function(column, row)
{
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.uuid + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.uuid + "\"><span class=\"fa fa-trash-o\"></span></button>";
}
}
});
var gridRules = stdBootgridUI("grid-rules", "/api/trafficshaper/settings/searchRules");
/**
* Link rule grid command controls (edit/delete)
......@@ -266,6 +240,27 @@ POSSIBILITY OF SUCH DAMAGE.
});
});
/**
* Reconfigure ipfw / trafficshaper
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/trafficshaper/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "Error reconfiguring trafficshaper",
message: JSON.stringify(data),
draggable: true
});
}
});
});
});
......@@ -273,7 +268,7 @@ POSSIBILITY OF SUCH DAMAGE.
<div class="container-fluid">
<div class="row">
<div class="col-md-12" id="content">
<div class="col-md-12">
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<li class="active"><a data-toggle="tab" href="#pipes">{{ lang._('Pipes') }}</a></li>
<li><a data-toggle="tab" href="#rules">{{ lang._('Rules') }}</a></li>
......@@ -298,12 +293,6 @@ POSSIBILITY OF SUCH DAMAGE.
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<button type="button" id="addPipe" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span></button>
......@@ -333,15 +322,7 @@ POSSIBILITY OF SUCH DAMAGE.
<tbody>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<tr >
<td></td>
<td>
<button type="button" id="addRule" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span></button>
......@@ -354,6 +335,11 @@ POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>Apply</b><i id="reconfigureAct_progress" class=""></i></button>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment