mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 19:08:15 +00:00
Merge pull request #3696 from laf/issue-2069
Updated unpolled notification to only show unpolled devices
This commit is contained in:
commit
bf268dcd4a
@ -19,6 +19,10 @@ if (isset($searchPhrase) && !empty($searchPhrase)) {
|
||||
$sql .= " AND (hostname LIKE '%$searchPhrase%' OR last_polled LIKE '%$searchPhrase%' OR last_polled_timetaken LIKE '%$searchPhrase%')";
|
||||
}
|
||||
|
||||
if ($_POST['type'] == "unpolled") {
|
||||
$sql .= " AND `last_polled` <= DATE_ADD(NOW(), INTERVAL - 15 minute)";
|
||||
}
|
||||
|
||||
if (!isset($sort) || empty($sort)) {
|
||||
$sort = 'last_polled_timetaken DESC';
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ echo('<h5>Powered by <a href="' . $config['project_home'] . '" target="_blank" c
|
||||
}
|
||||
|
||||
if(dbFetchCell("SELECT COUNT(`device_id`) FROM `devices` WHERE `last_polled` <= DATE_ADD(NOW(), INTERVAL - 15 minute) AND `ignore` = 0 AND `disabled` = 0 AND status = 1",array()) > 0) {
|
||||
$msg_box[] = array('type' => 'warning', 'message' => "<a href=\"poll-log/\">It appears as though you have some devices that haven't completed polling within the last 15 minutes, you may want to check that out :)</a>",'title' => 'Devices unpolled');
|
||||
$msg_box[] = array('type' => 'warning', 'message' => "<a href=\"poll-log/filter=unpolled/\">It appears as though you have some devices that haven't completed polling within the last 15 minutes, you may want to check that out :)</a>",'title' => 'Devices unpolled');
|
||||
}
|
||||
|
||||
if(is_array($msg_box)) {
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
$no_refresh = true;
|
||||
$pagetitle[] = 'Poll Log';
|
||||
if (isset($vars['filter'])) {
|
||||
$type = $vars['filter'];
|
||||
}
|
||||
?>
|
||||
<table id="poll-log" class="table table-condensed table-hover table-striped">
|
||||
<thead>
|
||||
@ -15,12 +18,24 @@ $pagetitle[] = 'Poll Log';
|
||||
|
||||
<script>
|
||||
|
||||
searchbar = "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\">"+
|
||||
"<div class=\"col-sm-9 actionBar\"><span class=\"pull-left\">"+
|
||||
"<a href='<?php echo generate_url(array('page' => 'poll-log')); ?>' class='btn btn-primary btn-sm'>All devices</a> "+
|
||||
"<a href='<?php echo generate_url(array('page' => 'poll-log', 'filter' => 'unpolled')); ?>' class='btn btn-danger btn-sm'>Unpolled devices</a>"+
|
||||
"</div><div class=\"col-sm-3 actionBar\"><p class=\"{{css.search}}\"></p><p class=\"{{css.actions}}\"></p></div>";
|
||||
|
||||
var grid = $("#poll-log").bootgrid({
|
||||
ajax: true,
|
||||
rowCount: [50,100,250,-1],
|
||||
columnSelection: false,
|
||||
templates: {
|
||||
header: searchbar
|
||||
},
|
||||
post: function ()
|
||||
{
|
||||
return {
|
||||
id: "poll-log"
|
||||
id: "poll-log",
|
||||
type: "<?php echo $type;?>"
|
||||
};
|
||||
},
|
||||
url: "ajax_table.php"
|
||||
|
Loading…
Reference in New Issue
Block a user