h2.uk-text-success Logs configured in Splash
- unless @log_saved.nil?
javascript:
UIkit.notify("Log record #{@log_saved} saved", {status:'success'});
- unless @log_failed.nil?
javascript:
UIkit.notify("Log record #{@log_saved} not saved", {status:'danger'});
javascript:
$(document).on( 'click','input.delete-log',function(){
var id = this.id;
var url = "/api/config/deletelog/" + id + ".json";
UIkit.modal.confirm('Are you sure?', function(){
console.debug(url)
$.ajax({
url: url,
type: 'DELETE',
success: function( data ) {
console.debug(data)
if (data['status'] == 'success') {
$('table#logrecords tr#' + id).remove();
UIkit.notify("Deleting log for " + id + " done", {status:'success'});
}
else
{
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
}
},
error: function(e) {
UIkit.notify("Deleting log for " + id + " failed !", {status:'danger'});
}
});
});
});
$(document).on( 'click','input.monitor-log',function(){
var url = "/api/logs/monitor.json";
UIkit.modal.confirm('Are you sure?', function(){
console.debug(url)
$.ajax({
url: url,
type: 'POST',
success: function( data ) {
console.debug(data)
if (data['status'] == 'success') {
UIkit.notify("Forced monitoring done", {status:'success'});
}
else
{
UIkit.notify("Forced monitoring failed !", {status:'danger'});
}
},
error: function(e) {
UIkit.notify("Forced monitoring failed !", {status:'danger'});
}
});
});
});
div.uk-width-medium-1-1
div.uk-panel.uk-panel-box
span.uk-text-large.uk-text-bold List of logs monitored
br
table#logrecords.uk-table.uk-table-hover.uk-table-striped
thead
tr
th Log record label
th Definition
th Status
th Actions
tbody
- @data.each do |log|
tr id="#{log[:label].to_s}"
td Label : #{log[:label]}
td
ul
li File : #{log[:log]}
li Pattern : #{log[:pattern]}
td
- if @result[log[:label]][:status] == :missing
div.uk-badge.uk-badge-warning missing
- if @result[log[:label]][:status] == :clean
div.uk-badge.uk-badge-success success
ul
li Lines count : #{@result[log[:label]][:lines]}
- if @result[log[:label]][:status] == :matched
div.uk-badge.uk-badge-danger matched
ul
li Lines count : #{@result[log[:label]][:lines]}
li Matchs count : #{@result[log[:label]][:count]}
td
input.delete-log.uk-button.uk-button-mini.uk-button-danger id="#{log[:label].to_s}" value="Delete"
br
input.modify-log.uk-button.uk-button-mini.uk-button-primary id="#{log[:label].to_s}" value="Modify" onclick="location.href='/add_modify_log/#{log[:label].to_s}';"
br
input.history-log.uk-button.uk-button-mini.uk-button-primary id="#{log[:label].to_s}" value="History" onclick="location.href='/get_log_history/#{log[:label].to_s}';"
div.uk-align-right
form.uk-form.uk-form-horizontal#query action="/add_modify_log" method="GET"
div
input.monitor-log.uk-button value="Force monitoring"
input.add-log.uk-button type="submit" value="Add new log"