summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-06 10:10:54 +0300
committerAndrew Dolgov <[email protected]>2021-02-06 10:10:54 +0300
commit10392ecc285871b3f0866370bea11c18693d6a2c (patch)
treee125369271fff6c4be0b6f672e28c55b03633d3b /js
parent9fdeb58fd39fb24aafebd67ad88f58be12b8ce7d (diff)
event log: add pagination
Diffstat (limited to 'js')
-rw-r--r--js/PrefHelpers.js42
1 files changed, 29 insertions, 13 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index 0780fb708..57dff2333 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -50,21 +50,37 @@ const Helpers = {
return false;
},
- updateEventLog: function() {
- xhrPost("backend.php", { op: "pref-system", severity: dijit.byId("severity").attr('value') }, (transport) => {
- dijit.byId('systemConfigTab').attr('content', transport.responseText);
- Notify.close();
- });
- },
- clearEventLog: function() {
- if (confirm(__("Clear event log?"))) {
+ EventLog: {
+ log_page: 0,
+ refresh: function() {
+ this.log_page = 0;
+ this.update();
+ },
+ update: function() {
+ xhrPost("backend.php", { op: "pref-system", severity: dijit.byId("severity").attr('value'), page: Helpers.EventLog.log_page }, (transport) => {
+ dijit.byId('systemConfigTab').attr('content', transport.responseText);
+ Notify.close();
+ });
+ },
+ nextPage: function() {
+ this.log_page += 1;
+ this.update();
+ },
+ prevPage: function() {
+ if (this.log_page > 0) this.log_page -= 1;
- Notify.progress("Loading, please wait...");
+ this.update();
+ },
+ clear: function() {
+ if (confirm(__("Clear event log?"))) {
- xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
- this.updateEventLog();
- });
- }
+ Notify.progress("Loading, please wait...");
+
+ xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
+ Helpers.EventLog.refresh();
+ });
+ }
+ },
},
editProfiles: function() {