Alertlog stats dashboard widget (#10967)

* Dashboard for alertlog stats

* Dashboard for alertlog stats

* Dashboard for alertlog stats

* Dashboard for alertlog stats

* Dashboard for alertlog stats

* Cleanup

* Cleanup

* Cleanup

* date selection

* date selection

* fix js rule details

* cleanup js

* dummy commit to reload CI/CD

* dummy commit to reload CI/CD
This commit is contained in:
louis-oui
2020-01-23 15:16:30 +01:00
committed by Kevin Krumm
parent 4395b002ab
commit 6931df8990
6 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<div class="row">
<div class="col-sm-12">
<span id="message"></span>
</div>
</div>
<div class="table-responsive">
<table id="alertlog-stats_{{ $id }}" class="table table-hover table-condensed table-striped">
<thead>
<tr>
<th data-column-id="count">Count</th>
<th data-column-id="hostname">Device</th>
<th data-column-id="alert_rule">Alert rule</th>
</tr>
</thead>
</table>
</div>
<script>
$("#alertlog-stats_{{ $id }}").bootgrid({
ajax: true,
rowCount: [50, 100, 250, -1],
post: function () {
return {
id: "alertlog-stats",
device_id: "",
min_severity: '{{ $min_severity }}',
time_interval: '{{ $time_interval }}'
};
},
url: "ajax_table.php"
});
</script>

View File

@@ -0,0 +1,21 @@
@extends('widgets.settings.base')
@section('form')
<div class="form-group row">
<label for="title-{{ $id }}" class="control-label">@lang('Widget title')</label>
<input type="text" class="form-control" name="title" id="title-{{ $id }}" placeholder="@lang('Custom title')" value="{{ $title }}">
</div>
<div class="form-group row">
<label for="min_severity-{{ $id }}" class="control-label">@lang('Displayed severity'):</label>
<select class="form-control" name="min_severity" id="min_severity-{{ $id }}">
<option value="">@lang('any severity')</option>
@foreach($severities as $name => $val)
<option value="{{ $val }}" @if($min_severity == $val) selected @endif>{{ $name }}{{$val > 3 ? '' : ' ' . __('or higher')}}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="time_interval-{{ $id }}" class="control-label">@lang('Last days')</label>
<input class="form-control" name="time_interval" id="time_interval-{{ $id }}" value="{{ $time_interval }}">
</div>
@endsection