diff options
-rw-r--r-- | classes/pref/system.php | 7 | ||||
-rw-r--r-- | js/prefs.js | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/classes/pref/system.php b/classes/pref/system.php index d2b6cd746..7accb1f91 100644 --- a/classes/pref/system.php +++ b/classes/pref/system.php @@ -19,6 +19,10 @@ class Pref_System extends Handler_Protected { return array_search($method, $csrf_ignored) !== false; } + function clearLog() { + $this->dbh->query("DELETE FROM ttrss_error_log"); + } + function index() { print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">"; @@ -35,6 +39,9 @@ class Pref_System extends Handler_Protected { print "<button dojoType=\"dijit.form.Button\" onclick=\"updateSystemList()\">".__('Refresh')."</button> "; + print " <button dojoType=\"dijit.form.Button\" + onclick=\"clearSqlLog()\">".__('Clear log')."</button> "; + print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">"; print "<tr class=\"title\"> diff --git a/js/prefs.js b/js/prefs.js index 431a1fe84..4346054ef 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -1833,3 +1833,21 @@ function clearPluginData(name) { exception_error("clearPluginData", e); } } + +function clearSqlLog() { + + if (confirm(__("Clear all messages in the error log?"))) { + + notify_progress("Loading, please wait..."); + var query = "?op=pref-system&method=clearLog"; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + updateSystemList(); + } }); + + } +} + + |