show alert if recent_log_events > 0

This commit is contained in:
Andrew Dolgov 2018-12-10 10:53:11 +03:00
parent 51de0ce807
commit 7e5c999146
8 changed files with 27 additions and 4 deletions

View File

@ -741,6 +741,9 @@ body.ttrss_main #toolbar-frame #toolbar .net-alert i,
body.ttrss_main #toolbar-frame #toolbar .left i.icon-error {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar .log-alert i {
color: #ddba1c;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px;
flex-grow: 2;

File diff suppressed because one or more lines are too long

View File

@ -870,6 +870,10 @@ body.ttrss_main {
color : red;
}
.log-alert i {
color : #ddba1c;
}
#toolbar-headlines {
padding-right : 4px;
flex-grow : 2;

View File

@ -1311,7 +1311,7 @@
$data["labels"] = Labels::get_all_labels($_SESSION["uid"]);
if (LOG_DESTINATION == 'sql') {
if (LOG_DESTINATION == 'sql' && $_SESSION['access_level'] >= 10) {
if (DB_TYPE == 'pgsql') {
$log_interval = "created_at > NOW() - interval '1 hour'";
} else {
@ -1322,7 +1322,7 @@
$sth->execute();
if ($row = $sth->fetch()) {
$data['recent_eventlog_entries'] = $row['cid'];
$data['recent_log_events'] = $row['cid'];
}
}

View File

@ -166,6 +166,11 @@
<i class="material-icons">error_outline</i>
</div>
<div class="log-alert" style="display : none"
title="<?php echo __("Recent entries found in event log.") ?>">
<i class="material-icons">warning</i>
</div>
<?php
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) {
echo $p->hook_main_toolbar_button();

View File

@ -272,6 +272,14 @@ define(["dojo/_base/declare"], function (declare) {
}
}
if (k == "recent_log_events") {
const alert = $$(".log-alert")[0];
if (alert) {
v > 0 ? alert.show() : alert.hide();
}
}
if (k == "daemon_stamp_ok" && v != 1) {
Notify.error("<span onclick=\"App.explainError(3)\">Update daemon is not updating feeds.</span>", true);
return;

View File

@ -741,6 +741,9 @@ body.ttrss_main #toolbar-frame #toolbar .net-alert i,
body.ttrss_main #toolbar-frame #toolbar .left i.icon-error {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar .log-alert i {
color: #ddba1c;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px;
flex-grow: 2;

File diff suppressed because one or more lines are too long