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
376fc971
Commit
376fc971
authored
Jun 23, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ids) work in progress frontend parts
parent
c0ffb4ea
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
12 deletions
+57
-12
IndexController.php
...ense/mvc/app/controllers/OPNsense/IDS/IndexController.php
+2
-0
generalSettings.xml
...vc/app/controllers/OPNsense/IDS/forms/generalSettings.xml
+8
-0
IDS.xml
src/opnsense/mvc/app/models/OPNsense/IDS/IDS.xml
+6
-0
index.volt
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
+41
-12
No files found.
src/opnsense/mvc/app/controllers/OPNsense/IDS/IndexController.php
View file @
376fc971
...
...
@@ -39,6 +39,8 @@ class IndexController extends \OPNsense\Base\IndexController
$this
->
view
->
title
=
"IDS"
;
// link dialog
$this
->
view
->
formDialogRule
=
$this
->
getForm
(
"dialogRule"
);
// link IDS general settings
$this
->
view
->
formGeneralSettings
=
$this
->
getForm
(
"generalSettings"
);
// choose template
$this
->
view
->
pick
(
'OPNsense/IDS/index'
);
}
...
...
src/opnsense/mvc/app/controllers/OPNsense/IDS/forms/generalSettings.xml
0 → 100644
View file @
376fc971
<form>
<field>
<id>
ids.general.enabled
</id>
<label>
enabled
</label>
<type>
checkbox
</type>
<help>
enable IDS
</help>
</field>
</form>
src/opnsense/mvc/app/models/OPNsense/IDS/IDS.xml
View file @
376fc971
...
...
@@ -16,5 +16,11 @@
</enabled>
</rule>
</rules>
<general>
<enabled
type=
"BooleanField"
>
<default>
0
</default>
<Required>
Y
</Required>
</enabled>
</general>
</items>
</model>
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
View file @
376fc971
...
...
@@ -29,6 +29,14 @@ POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript">
$( document ).ready(function() {
//
var data_get_map = {'frm_GeneralSettings':"/api/ids/settings/get"};
// load initial data
mapDataToFormUI(data_get_map).done(function(){
formatTokenizersUI();
$('.selectpicker').selectpicker('refresh');
});
// list all known classtypes and add to selection box
function updateRuleClassTypes() {
...
...
@@ -81,6 +89,31 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
/**
* save settings and reconfigure ids
*/
$("#reconfigureAct").click(function(){
saveFormToEndpoint(url="/api/ids/settings/set",formid='frm_GeneralSettings',callback_ok=function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/ids/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 IDS",
message: data['status'],
draggable: true
});
}
});
});
});
});
...
...
@@ -88,12 +121,14 @@ POSSIBILITY OF SUCH DAMAGE.
</script>
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<li class="active"><a data-toggle="tab" href="#rules">{{ lang._('Rules') }}</a></li>
<li><a data-toggle="tab" href="#item2">{{ lang._('Item2') }}</a></li>
<li><a data-toggle="tab" href="#item3">{{ lang._('Item3') }}</a></li>
<li class="active"><a data-toggle="tab" href="#settings">{{ lang._('Settings') }}</a></li>
<li><a data-toggle="tab" href="#rules">{{ lang._('Rules') }}</a></li>
</ul>
<div class="tab-content content-box tab-content">
<div id="rules" class="tab-pane fade in active">
<div id="settings" class="tab-pane fade in active">
{{ partial("layout_partials/base_form",['fields':formGeneralSettings,'id':'frm_GeneralSettings'])}}
</div>
<div id="rules" class="tab-pane fade in">
<div class="bootgrid-header container-fluid">
<div class="row">
<div class="col-sm-12 actionBar">
...
...
@@ -107,22 +142,16 @@ POSSIBILITY OF SUCH DAMAGE.
<table id="grid-installedrules" class="table table-condensed table-hover table-striped table-responsive" data-editDialog="DialogRule">
<thead>
<tr>
<th data-column-id="sid" data-type="number" data-visible="true" data-identifier="true" >sid</th>
<th data-column-id="sid" data-type="number" data-visible="true" data-identifier="true"
data-width="6em"
>sid</th>
<th data-column-id="source" data-type="string">Source</th>
<th data-column-id="classtype" data-type="string">ClassType</th>
<th data-column-id="msg" data-type="string">Message</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false">enabled / info</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false"
data-width="10em"
>enabled / info</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div id="item2" class="tab-pane fade in">
</div>
<div id="item3" class="tab-pane fade in">
</div>
<div class="col-md-12">
<hr/>
...
...
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