@@ -6696,6 +6697,26 @@
meshserver.send({ action: 'events', limit: parseInt(p3limitdropdown.value) });
}
+ function p3showDownloadEventsDialog() {
+ if (xxdialogMode) return;
+ var x = 'Download the list of events with one of the file formats below.
';
+ x += addHtmlValue('CSV Format', 'eventslist.csv');
+ x += addHtmlValue('JSON Format', 'eventslist.json');
+ setDialogMode(2, "Event List Export", 1, null, x);
+ }
+
+ function p3downloadEventsDialogCSV() {
+ var csv = "time, type, action, user, message\r\n";
+ for (var i in events) { csv += '\"' + events[i].time + '\",\"' + events[i].etype + '\",\"' + ((events[i].action != null)?events[i].action:'') + '\",\"' + ((events[i].username != null)?events[i].username:'') + '\",\"' + ((events[i].msg != null)?events[i].msg:'') + '\"\r\n'; }
+ saveAs(new Blob([csv], { type: "application/octet-stream" }), "eventslist.csv");
+ }
+
+ function p3downloadEventsDialogJSON() {
+ var r = []
+ for (var i in events) { r.push(events[i]); }
+ saveAs(new Blob([JSON.stringify(r)], { type: "application/octet-stream" }), "eventslist.json");
+ }
+
//
// MY USERS
//