diff --git a/www/acp.html b/www/acp.html
index c686532c..ae15855f 100644
--- a/www/acp.html
+++ b/www/acp.html
@@ -184,6 +184,28 @@
+
+
diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js
index 186d1cbc..bb0eafb0 100644
--- a/www/assets/js/acp.js
+++ b/www/assets/js/acp.js
@@ -103,6 +103,51 @@ $("#actionlog_filter").click(function() {
$("#actionlog table").data("entries", entries);
loadPage($("#actionlog table"), 0);
});
+$("#actionlog_searchbtn").click(function() {
+ var tbl = $("#actionlog table");
+ $("#actionlog tbody").remove();
+ var actions = $("#actionlog_filter").val();
+ var sfield = $("#actionlog_sfield").val();
+ var sval = $("#actionlog_search").val().toLowerCase();
+ var sort = $("#actionlog_sort").val();
+ var desc = $("#actionlog_sortorder").val() === "true";
+ tbl.data("sort_desc", desc);
+ tbl.data("sortby", sort);
+ var entries = [];
+ tbl.data("allentries").forEach(function(e) {
+ if(actions.indexOf(e.action) == -1)
+ return;
+ entries.push(e);
+ });
+ entries = entries.filter(function (item, i, arr) {
+ var f = item[sfield];
+ if(sfield === "time")
+ f = new Date(f).toString().toLowerCase();
+ return f.indexOf(sval) > -1;
+ });
+ $("#actionlog_pagination").remove();
+ if(entries.length > 20) {
+ var pag = $("").addClass("pagination")
+ .attr("id", "actionlog_pagination")
+ .insertAfter($("#actionlog table"));
+ var btns = $("").appendTo(pag);
+ for(var i = 0; i < entries.length / 20; i++) {
+ var li = $("").appendTo(btns);
+ (function(i) {
+ $("").attr("href", "javascript:void(0)")
+ .text(i+1)
+ .click(function() {
+ loadPage(tbl, i);
+ })
+ .appendTo(li);
+ })(i);
+ }
+ tbl.data("pagination", pag);
+ }
+
+ $("#actionlog table").data("entries", entries);
+ loadPage($("#actionlog table"), 0);
+});
$("#actionlog_clear").click(function() {
socket.emit("acp-actionlog-clear", $("#actionlog_filter").val());
getActionLog();
@@ -165,6 +210,7 @@ function getActionLog() {
socket.emit("acp-actionlog-clear-one", e);
tr.hide("blind", function () {
tr.remove();
+ getActionLog();
});
});
$(" | ").text(e.ip).appendTo(tr);
@@ -181,7 +227,7 @@ function getActionLog() {
actions.forEach(function(a) {
$("").text(a).val(a).appendTo($("#actionlog_filter"));
});
- loadPage(tbl, 0);
+ tbl.find("tbody").remove();
});
}
function getChanlog() {