Commit 78af5556 authored by Ad Schellevis's avatar Ad Schellevis

(IDS) hook loading of general settings on tab events

parent 646f9838
...@@ -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">
......
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