Commit 143e759f authored by Franco Fichtner's avatar Franco Fichtner

ids: first pass for simpler ruleset handling #1129

This does:

o Enable/disable all text as opposed to confusing icons of
  checkboxes.  Also mark them as "primary".
o Make the info button a pencil / edit button as we can modify
  data from there.
o Minor cleanups.

Missing:

o Removing the toggle buttons for each rule (the edit button
  is sufficient).  Haven't done this because the rowtoggle
  mechanism is probably better adapted by @adschellevis.
o Maybe move the enable disable all buttons back to the bottom.
parent 1611955b
......@@ -144,7 +144,7 @@ POSSIBILITY OF SUCH DAMAGE.
/**
* save (general) settings and reconfigure
* @param callback_funct: callback function, receives result status true/false
* @param callback_funct: callback function, receives result status true/false
*/
function actionReconfigure(callback_funct) {
var result_status = false;
......@@ -226,7 +226,7 @@ POSSIBILITY OF SUCH DAMAGE.
rowCount:[10, 25, 50,100,500,1000] ,
formatters:{
rowtoggle: function (column, row) {
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.sid + "\"><span class=\"fa fa-info-circle\"></span></button> ";
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.sid + "\"><span class=\"fa fa-pencil\"></span></button> ";
if (parseInt(row[column.id], 2) == 1) {
toggle += "&nbsp; <span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.sid + "\"></span>";
} else {
......@@ -257,7 +257,7 @@ POSSIBILITY OF SUCH DAMAGE.
requestHandler:addAlertQryFilters,
formatters:{
info: function (column, row) {
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "/" + row.fileid + "\"><span class=\"fa fa-info-circle\"></span></button> ";
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "/" + row.fileid + "\"><span class=\"fa fa-pencil\"></span></button> ";
}
},
}
......@@ -277,8 +277,6 @@ POSSIBILITY OF SUCH DAMAGE.
}
})
/**
* grid for installable rule files
*/
......@@ -291,7 +289,7 @@ POSSIBILITY OF SUCH DAMAGE.
navigation:0,
formatters:{
rowtoggle: function (column, row) {
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filename + "\"><span class=\"fa fa-info-circle\"></span></button> ";
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filename + "\"><span class=\"fa fa-pencil\"></span></button> ";
if (parseInt(row[column.id], 2) == 1) {
toggle += "<span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.filename + "\"></span>";
} else {
......@@ -532,9 +530,8 @@ POSSIBILITY OF SUCH DAMAGE.
<table class="table table-condensed table-responsive">
<tr>
<td>
<button data-toggle="tooltip" title="{{ lang._('Disable selected') }}" id="disableSelectedRuleSets" type="button" class="btn btn-xs btn-default"><span class="fa fa-square-o command-toggle"></span></button>
<button data-toggle="tooltip" title="{{ lang._('Enable selected') }}" id="enableSelectedRuleSets" type="button" class="btn btn-xs btn-default"><span class="fa fa-check-square-o command-toggle"></span></button>
&nbsp;<small>{{lang._('Use selectboxes on the left for multiselect') }}</small>
<button data-toggle="tooltip" id="enableSelectedRuleSets" type="button" class="btn btn-xs btn-default btn-primary">{{ lang._('Enable selected') }}</span></button>
<button data-toggle="tooltip" id="disableSelectedRuleSets" type="button" class="btn btn-xs btn-default btn-primary">{{ lang._('Disable selected') }}</span></button>
</td>
</tr>
</table>
......@@ -542,10 +539,10 @@ POSSIBILITY OF SUCH DAMAGE.
<thead>
<tr>
<th data-column-id="filename" data-type="string" data-visible="false" data-identifier="true">{{ lang._('Filename') }}</th>
<th data-column-id="description" data-type="string" data-sortable="false" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="description" data-type="string" data-sortable="false" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="modified_local" data-type="rulets" data-sortable="false" data-visible="true">{{ lang._('Last updated') }}</th>
<th data-column-id="filter_str" data-type="string" data-identifier="true">{{ lang._('Filter') }}</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Enabled') }}</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Commands') }}</th>
</tr>
</thead>
<tbody>
......@@ -557,8 +554,8 @@ POSSIBILITY OF SUCH DAMAGE.
</table>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b><i id="reconfigureAct_progress" class=""></i></button>
<button class="btn btn-primary" id="updateRulesAct" type="button"><b>{{ lang._('Download & Update Rules') }}</b><i id="updateRulesAct_progress" class=""></i></button>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b><i id="reconfigureAct_progress" class=""></i></button>
<button class="btn btn-primary" id="updateRulesAct" type="button"><b>{{ lang._('Download & Update Rules') }}</b><i id="updateRulesAct_progress" class=""></i></button>
<br/>
<i>{{ lang._('Please use "Download & Update Rules" to fetch your initial ruleset, automatic updating can be scheduled after the first download.') }} </i>
</div>
......@@ -589,7 +586,7 @@ POSSIBILITY OF SUCH DAMAGE.
<th data-column-id="source" data-type="string">{{ lang._('Source') }}</th>
<th data-column-id="classtype" data-type="string">{{ lang._('ClassType') }}</th>
<th data-column-id="msg" data-type="string">{{ lang._('Message') }}</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Info / Enabled') }}</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Info / Enabled') }}</th>
</tr>
</thead>
<tbody>
......@@ -619,7 +616,7 @@ POSSIBILITY OF SUCH DAMAGE.
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Enabled') }}</th>
<th data-column-id="action" data-type="string" data-sortable="true">{{ lang._('Action') }}</th>
<th data-column-id="description" data-type="string" data-sortable="true">{{ lang._('Description') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-width="7em" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
</thead>
......@@ -648,7 +645,7 @@ POSSIBILITY OF SUCH DAMAGE.
<div class="row">
<div class="col-sm-12 actionBar">
<select id="alert-logfile" class="selectpicker" data-width="200px"></select>
<span id="actDeleteLog" class="btn btn-lg fa fa-trash" style="cursor: pointer;"></span>
<span id="actDeleteLog" class="btn btn-lg fa fa-trash" style="cursor: pointer;"></span>
<select id="alert-logfile-max" class="selectpicker" data-width="80px">
<option value="7">7</option>
<option value="50">50</option>
......@@ -661,7 +658,7 @@ POSSIBILITY OF SUCH DAMAGE.
<div class="search form-group">
<div class="input-group">
<input class="search-field form-control" placeholder="{{ lang._('Search') }}" type="text" id="inputSearchAlerts">
<span id="actQueryAlerts" class="icon input-group-addon fa fa-refresh" title="{{ lang._('Query') }}" style="cursor: pointer;"></span>
<span id="actQueryAlerts" class="icon input-group-addon fa fa-refresh" title="{{ lang._('Query') }}" style="cursor: pointer;"></span>
</div>
</div>
</div>
......@@ -672,8 +669,8 @@ POSSIBILITY OF SUCH DAMAGE.
<tr>
<th data-column-id="timestamp" data-type="string" data-sortable="false">{{ lang._('Timestamp') }}</th>
<th data-column-id="alert_action" data-type="string" data-sortable="false">{{ lang._('Action') }}</th>
<th data-column-id="src_ip" data-type="string" data-sortable="false" data-width="10em">{{ lang._('Source') }}</th>
<th data-column-id="dest_ip" data-type="string" data-sortable="false" data-width="10em">{{ lang._('Destination') }}</th>
<th data-column-id="src_ip" data-type="string" data-sortable="false" data-width="10em">{{ lang._('Source') }}</th>
<th data-column-id="dest_ip" data-type="string" data-sortable="false" data-width="10em">{{ lang._('Destination') }}</th>
<th data-column-id="alert" data-type="string" data-sortable="false" >{{ lang._('Alert') }}</th>
<th data-column-id="info" data-formatter="info" data-sortable="false" data-width="4em">{{ lang._('Info') }}</th>
</tr>
......
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