Expose log details for admins

This commit is contained in:
Raphael Michel
2018-10-01 14:13:44 +02:00
parent efbddc2486
commit f848561d25
7 changed files with 48 additions and 3 deletions

View File

@@ -551,6 +551,22 @@ $(function () {
}
});
$("a[data-expandlogs]").click(function (e) {
e.preventDefault();
var $a = $(this);
var id = $(this).attr("data-id");
$a.find(".fa").removeClass("fa-eye").addClass("fa-cog fa-spin");
$.getJSON('/control/logdetail/?pk=' + id, function (data) {
if ($a.parent().tagName === "p") {
$("<pre>").html(JSON.stringify(data.data, null, 2)).insertAfter($a.parent());
} else {
$("<pre>").html(JSON.stringify(data.data, null, 2)).appendTo($a.parent());
}
$a.remove();
});
return false;
});
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
moment.locale($("body").attr("data-datetimelocale"));
});