Skip to content
Snippets Groups Projects
Commit 52e7b5a0 authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

add clear sql log button

parent 39ede986
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,10 @@ class Pref_System extends Handler_Protected { ...@@ -19,6 +19,10 @@ class Pref_System extends Handler_Protected {
return array_search($method, $csrf_ignored) !== false; return array_search($method, $csrf_ignored) !== false;
} }
function clearLog() {
$this->dbh->query("DELETE FROM ttrss_error_log");
}
function index() { function index() {
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">"; print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
...@@ -35,6 +39,9 @@ class Pref_System extends Handler_Protected { ...@@ -35,6 +39,9 @@ class Pref_System extends Handler_Protected {
print "<button dojoType=\"dijit.form.Button\" print "<button dojoType=\"dijit.form.Button\"
onclick=\"updateSystemList()\">".__('Refresh')."</button> "; onclick=\"updateSystemList()\">".__('Refresh')."</button> ";
print "&nbsp;<button dojoType=\"dijit.form.Button\"
onclick=\"clearSqlLog()\">".__('Clear log')."</button> ";
print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">"; print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">";
print "<tr class=\"title\"> print "<tr class=\"title\">
......
...@@ -1833,3 +1833,21 @@ function clearPluginData(name) { ...@@ -1833,3 +1833,21 @@ function clearPluginData(name) {
exception_error("clearPluginData", e); 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();
} });
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment