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
78af5556
Commit
78af5556
authored
Dec 20, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IDS) hook loading of general settings on tab events
parent
646f9838
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
index.volt
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
+21
-17
No files found.
src/opnsense/mvc/app/views/OPNsense/IDS/index.volt
View file @
78af5556
...
@@ -205,7 +205,9 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -205,7 +205,9 @@ POSSIBILITY OF SUCH DAMAGE.
* load content on tab changes
* load content on tab changes
*/
*/
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
if (e.target.id == 'rule_tab'){
if (e.target.id == 'settings_tab'){
loadGeneralSettings();
} else if (e.target.id == 'rule_tab'){
//
//
// activate rule tab page
// activate rule tab page
//
//
...
@@ -273,15 +275,13 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -273,15 +275,13 @@ POSSIBILITY OF SUCH DAMAGE.
toggle:'/api/ids/settings/toggleUserRule/'
toggle:'/api/ids/settings/toggleUserRule/'
}
}
);
);
} else if (e.target.id == 'download_settings_tab') {
}
/**
})
* grid for installable rule files
*/
/**
$('#grid-rule-files').bootgrid('destroy'); // always destroy previous grid, so data is always fresh
* grid for installable rule files
$("#grid-rule-files").UIBootgrid({
*/
search:'/api/ids/settings/listRulesets',
$("#grid-rule-files").UIBootgrid(
{ search:'/api/ids/settings/listRulesets',
get:'/api/ids/settings/getRuleset/',
get:'/api/ids/settings/getRuleset/',
set:'/api/ids/settings/setRuleset/',
set:'/api/ids/settings/setRuleset/',
toggle:'/api/ids/settings/toggleRuleset/',
toggle:'/api/ids/settings/toggleRuleset/',
...
@@ -315,6 +315,10 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -315,6 +315,10 @@ POSSIBILITY OF SUCH DAMAGE.
}
}
}
}
});
});
}
})
/*************************************************************************************************************
/*************************************************************************************************************
* UI button Commands
* UI button Commands
...
@@ -471,13 +475,15 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -471,13 +475,15 @@ POSSIBILITY OF SUCH DAMAGE.
/**
/**
* Initialize
* Initialize
*/
*/
loadGeneralSettings();
updateStatus();
updateStatus();
// update history on tab state and implement navigation
// update history on tab state and implement navigation
if(window.location.hash != "") {
if (window.location.hash != "") {
$('a[href="' + window.location.hash + '"]').click()
$('a[href="' + window.location.hash + '"]').click();
} else {
$('a[href="#settings"]').click();
}
}
$('.nav-tabs a').on('shown.bs.tab', function (e) {
$('.nav-tabs a').on('shown.bs.tab', function (e) {
history.pushState(null, null, e.target.hash);
history.pushState(null, null, e.target.hash);
});
});
...
@@ -520,7 +526,7 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -520,7 +526,7 @@ POSSIBILITY OF SUCH DAMAGE.
</script>
</script>
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<li
class="active"
><a data-toggle="tab" href="#settings" id="settings_tab">{{ lang._('Settings') }}</a></li>
<li><a data-toggle="tab" href="#settings" id="settings_tab">{{ lang._('Settings') }}</a></li>
<li><a data-toggle="tab" href="#download_settings" id="download_settings_tab">{{ lang._('Download') }}</a></li>
<li><a data-toggle="tab" href="#download_settings" id="download_settings_tab">{{ lang._('Download') }}</a></li>
<li><a data-toggle="tab" href="#rules" id="rule_tab">{{ lang._('Rules') }}</a></li>
<li><a data-toggle="tab" href="#rules" id="rule_tab">{{ lang._('Rules') }}</a></li>
<li><a data-toggle="tab" href="#userrules" id="userrules_tab">{{ lang._('User defined') }}</a></li>
<li><a data-toggle="tab" href="#userrules" id="userrules_tab">{{ lang._('User defined') }}</a></li>
...
@@ -528,7 +534,7 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -528,7 +534,7 @@ POSSIBILITY OF SUCH DAMAGE.
<li><a href="" id="scheduled_updates" style="display:none">{{ lang._('Schedule') }}</a></li>
<li><a href="" id="scheduled_updates" style="display:none">{{ lang._('Schedule') }}</a></li>
</ul>
</ul>
<div class="tab-content content-box tab-content">
<div class="tab-content content-box tab-content">
<div id="settings" class="tab-pane fade in
active
">
<div id="settings" class="tab-pane fade in">
{{ partial("layout_partials/base_form",['fields':formGeneralSettings,'id':'frm_GeneralSettings'])}}
{{ partial("layout_partials/base_form",['fields':formGeneralSettings,'id':'frm_GeneralSettings'])}}
<div class="col-md-12">
<div class="col-md-12">
<hr/>
<hr/>
...
@@ -580,7 +586,6 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -580,7 +586,6 @@ POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
</td>
</td>
</tr>
</tr>
<!--
<tr>
<tr>
<td><div class="control-label">
<td><div class="control-label">
<i class="fa fa-info-circle text-muted"></i>
<i class="fa fa-info-circle text-muted"></i>
...
@@ -591,7 +596,6 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -591,7 +596,6 @@ POSSIBILITY OF SUCH DAMAGE.
</td>
</td>
</tr>
</tr>
-->
</tbody>
</tbody>
</table>
</table>
<div class="col-md-12">
<div class="col-md-12">
...
...
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