function init_auditlog()
{
	var datastr = get_ajax_datastr("admin", "audit", "list");
	var filter = $('#auditlog-filter').val();
	datastr += "&name=" + encodeURIComponent(name);
	datastr += "&q=" + encodeURIComponent(filter);
	ajax_call(datastr, ajax_show_auditlog, null);
}

function ajax_show_auditlog(x, jqXHR, textStatus, params)
{
	var list = "";
	if(x != null) {
		if(x.status == 'ok') {
			var errors = x.data;
			for(var i = 0; i < errors.length; i++) {
				var extraclass = "";
				var msg = errors[i];
				msg = msg.replace("*#", "<b>").replace("#*", "</b>").replace("\n", "<br>");
				if(msg.indexOf("found for") > 0)
					extraclass = " dns-added-row";
				else if(msg.indexOf("deleted for") > 0)
					extraclass = " dns-deleted-row";
				else if(msg.indexOf("timeout on") > 0)
					extraclass = " dns-timeout-row";
				list += "<li class=\"list-group-item list-group-flush" + extraclass + "\">" + msg + "</li>";
			}
		}
	}
	$('#auditlog-data').html(list);
}
