Remove extra DNSSEC column. Instead, we integrate the DNSSEC result into the STATUS column if available.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-06-03 11:32:33 +02:00
parent de8f1374be
commit 2df0c21753
2 changed files with 33 additions and 43 deletions

View File

@@ -145,72 +145,65 @@ $(document).ready(function() {
tableApi = $("#all-queries").DataTable( {
"rowCallback": function( row, data, index ){
var blocked = false;
$dnssec_status = "";
if (data[5] === "1")
{
$dnssec_status = "<br><span style=\"color:green\">SECURE</span>";
}
else if (data[5] === "2")
{
$dnssec_status = "<br><span style=\"color:orange\">INSECURE</span>";
}
else if (data[5] === "3")
{
$dnssec_status = "<br><span style=\"color:red\">BOGUS</span>";
}
else if (data[5] === "4")
{
$dnssec_status = "<br><span style=\"color:red\">ABANDONED</span>";
}
else if (data[5] === "5")
{
$dnssec_status = "<br><span style=\"color:red\">?</span>";
}
if (data[4] === "1")
{
blocked = true;
$(row).css("color","red");
$("td:eq(4)", row).html( "Pi-holed" );
$("td:eq(7)", row).html( "<button style=\"color:green; white-space: nowrap;\"><i class=\"fa fa-pencil-square-o\"></i> Whitelist</button>" );
$("td:eq(4)", row).html( "Pi-holed"+$dnssec_status );
$("td:eq(6)", row).html( "<button style=\"color:green; white-space: nowrap;\"><i class=\"fa fa-pencil-square-o\"></i> Whitelist</button>" );
}
else if (data[4] === "2")
{
$(row).css("color","green");
$("td:eq(4)", row).html( "OK <br class='hidden-lg'>(forwarded)" );
$("td:eq(7)", row).html( "<button style=\"color:red; white-space: nowrap;\"><i class=\"fa fa-ban\"></i> Blacklist</button>" );
$("td:eq(4)", row).html( "OK <br class='hidden-lg'>(forwarded)"+$dnssec_status );
$("td:eq(6)", row).html( "<button style=\"color:red; white-space: nowrap;\"><i class=\"fa fa-ban\"></i> Blacklist</button>" );
}
else if (data[4] === "3")
{
$(row).css("color","green");
$("td:eq(4)", row).html( "OK <br class='hidden-lg'>(cached)" );
$("td:eq(7)", row).html( "<button style=\"color:red; white-space: nowrap;\"><i class=\"fa fa-ban\"></i> Blacklist</button>" );
$("td:eq(4)", row).html( "OK <br class='hidden-lg'>(cached)"+$dnssec_status );
$("td:eq(6)", row).html( "<button style=\"color:red; white-space: nowrap;\"><i class=\"fa fa-ban\"></i> Blacklist</button>" );
}
else if (data[4] === "4")
{
blocked = true;
$(row).css("color","red");
$("td:eq(4)", row).html( "Pi-holed <br class='hidden-lg'>(wildcard)" );
$("td:eq(7)", row).html( "" );
$("td:eq(4)", row).html( "Pi-holed <br class='hidden-lg'>(wildcard)"+$dnssec_status );
$("td:eq(6)", row).html( "" );
}
else if (data[4] === "5")
{
blocked = true;
$(row).css("color","red");
$("td:eq(4)", row).html( "Pi-holed <br class='hidden-lg'>(blacklist)" );
$("td:eq(7)", row).html( "<button style=\"color:green; white-space: nowrap;\"><i class=\"fa fa-pencil-square-o\"></i> Whitelist</button>" );
$("td:eq(6)", row).html( "<button style=\"color:green; white-space: nowrap;\"><i class=\"fa fa-pencil-square-o\"></i> Whitelist</button>" );
}
else
{
$("td:eq(4)", row).html( "Unknown" );
$("td:eq(7)", row).html( "" );
}
if (data[5] === "1")
{
$("td:eq(6)", row).css("color","green");
$("td:eq(6)", row).html( "SECURE" );
}
else if (data[5] === "2")
{
$("td:eq(6)", row).css("color","orange");
$("td:eq(6)", row).html( "INSECURE" );
}
else if (data[5] === "3")
{
$("td:eq(6)", row).css("color","red");
$("td:eq(6)", row).html( "BOGUS" );
}
else if (data[5] === "4")
{
$("td:eq(6)", row).css("color","red");
$("td:eq(6)", row).html( "ABANDONED" );
}
else if (data[5] === "5")
{
$("td:eq(6)", row).css("color","red");
$("td:eq(6)", row).html( "?" );
}
else
{
$("td:eq(6)", row).html( "-" );
$("td:eq(6)", row).html( "" );
}
// Check for existance of sixth column and display only if not Pi-holed
@@ -267,9 +260,8 @@ $(document).ready(function() {
{ "width" : "4%" },
{ "width" : "36%", "render": $.fn.dataTable.render.text() },
{ "width" : "8%", "render": $.fn.dataTable.render.text() },
{ "width" : "10%", "orderData": 4 },
{ "width" : "14%", "orderData": 4 },
{ "width" : "8%", "orderData": 6 },
{ "width" : "4%", "orderData": 5 },
{ "width" : "10%", "orderData": 4 }
],
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],