Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
33136c90
Commit
33136c90
authored
May 28, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(trafficshaper) work in progress UI parts
parent
9f86d730
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
46 deletions
+67
-46
dialogRule.xml
...p/controllers/OPNsense/TrafficShaper/forms/dialogRule.xml
+16
-0
TrafficShaper.xml
...e/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml
+21
-2
index.volt
src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt
+30
-44
No files found.
src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogRule.xml
View file @
33136c90
...
...
@@ -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>
...
...
src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml
View file @
33136c90
...
...
@@ -39,8 +39,8 @@
<default>
none
</default>
<OptionValues>
<none></none>
<s
ource>
source
</source
>
<d
estination>
destination
</destination
>
<s
rc-ip>
source
</src-ip
>
<d
st-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>
...
...
src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt
View file @
33136c90
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment