diff --git a/db_queries.php b/db_queries.php index a2441b58..b0a884c1 100644 --- a/db_queries.php +++ b/db_queries.php @@ -103,31 +103,29 @@ $token = $_SESSION['token'];
-
- - - - - - - - - - - - - - - - - - - - - -
TimeTypeDomainClientStatusAction
TimeTypeDomainClientStatusAction
-
-
+ + + + + + + + + + + + + + + + + + + + + +
TimeTypeDomainClientStatusAction
TimeTypeDomainClientStatusAction
+ diff --git a/queries.php b/queries.php index ebd06443..bd9df8fe 100644 --- a/queries.php +++ b/queries.php @@ -110,32 +110,30 @@ if(strlen($showing) > 0)
-
- - - - - - - - - - - - - - - - - - - - - -
TimeTypeDomainClientStatusAction
TimeTypeDomainClientStatusAction
-
- -
+ + + + + + + + + + + + + + + + + + + + + +
TimeTypeDomainClientStatusAction
TimeTypeDomainClientStatusAction
+ + diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 8551e9dc..8a47df5c 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -201,13 +201,13 @@ $(document).ready(function() { else if (data[4] === 2) { $(row).css("color","green"); - $("td:eq(4)", row).html( "OK (forwarded)" ); + $("td:eq(4)", row).html( "OK (forwarded)" ); $("td:eq(5)", row).html( "" ); } else if (data[4] === 3) { $(row).css("color","green"); - $("td:eq(4)", row).html( "OK (cached)" ); + $("td:eq(4)", row).html( "OK (cached)" ); $("td:eq(5)", row).html( "" ); // statistics[1]++; @@ -215,20 +215,20 @@ $(document).ready(function() { else if (data[4] === 4) { $(row).css("color","red"); - $("td:eq(4)", row).html( "Pi-holed (wildcard)" ); + $("td:eq(4)", row).html( "Pi-holed (wildcard)" ); $("td:eq(5)", row).html( "" ); // statistics[3]++; } else { - $("td:eq(4)", row).html( "Unknown ("+data[4]+")" ); + $("td:eq(4)", row).html( "Unknown ("+data[4]+")" ); $("td:eq(5)", row).html( "" ); } // statistics[0]++; }, dom: "<'row'<'col-sm-12'f>>" + "<'row'<'col-sm-4'l><'col-sm-8'p>>" + - "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", "ajax": {"url": APIstring, "error": handleAjaxError }, "autoWidth" : false, @@ -236,12 +236,12 @@ $(document).ready(function() { "deferRender": true, "order" : [[0, "desc"]], "columns": [ - { "width" : "20%", "render": function (data, type, full, meta) { if(type === "display"){return moment.unix(data).format("Y-MM-DD HH:mm:ss z");}else{return data;} }}, + { "width" : "15%", "render": function (data, type, full, meta) { if(type === "display"){return moment.unix(data).format("Y-MM-DD []HH:mm:ss z");}else{return data;} }}, { "width" : "10%" }, { "width" : "40%" }, + { "width" : "20%" }, { "width" : "10%" }, - { "width" : "10%" }, - { "width" : "10%" }, + { "width" : "5%" }, ], "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "columnDefs": [ { diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 24e37b88..50bf40a9 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -136,26 +136,26 @@ $(document).ready(function() { else if (data[4] === "2") { $(row).css("color","green"); - $("td:eq(4)", row).html( "OK (forwarded)" ); + $("td:eq(4)", row).html( "OK (forwarded)" ); $("td:eq(5)", row).html( "" ); } else if (data[4] === "3") { $(row).css("color","green"); - $("td:eq(4)", row).html( "OK (cached)" ); + $("td:eq(4)", row).html( "OK (cached)" ); $("td:eq(5)", row).html( "" ); } else if (data[4] === "4") { $(row).css("color","red"); - $("td:eq(4)", row).html( "Pi-holed (wildcard)" ); + $("td:eq(4)", row).html( "Pi-holed (wildcard)" ); $("td:eq(5)", row).html( "" ); } else if (data[4] === "5") { $(row).css("color","red"); - $("td:eq(4)", row).html( "Pi-holed (blacklist)" ); + $("td:eq(4)", row).html( "Pi-holed (blacklist)" ); $("td:eq(5)", row).html( "" ); } else @@ -166,19 +166,19 @@ $(document).ready(function() { }, dom: "<'row'<'col-sm-12'f>>" + "<'row'<'col-sm-4'l><'col-sm-8'p>>" + - "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", "ajax": {"url": APIstring, "error": handleAjaxError }, "autoWidth" : false, "processing": true, "order" : [[0, "desc"]], "columns": [ - { "width" : "20%", "render": function (data, type, full, meta) { if(type === "display"){return moment.unix(data).format("Y-MM-DD HH:mm:ss z");}else{return data;} }}, + { "width" : "15%", "render": function (data, type, full, meta) { if(type === "display"){return moment.unix(data).format("Y-MM-DD []HH:mm:ss z");}else{return data;} }}, { "width" : "10%" }, { "width" : "40%", "render": $.fn.dataTable.render.text() }, - { "width" : "10%", "render": $.fn.dataTable.render.text() }, - { "width" : "10%" }, + { "width" : "20%", "render": $.fn.dataTable.render.text() }, { "width" : "10%" }, + { "width" : "5%" }, ], "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "columnDefs": [ { diff --git a/style/pi-hole.css b/style/pi-hole.css index 3fc896c8..9cf11441 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -36,12 +36,47 @@ a.lookatme { -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } -#all-queries { - table-layout: fixed; + +.table-responsive { + -webkit-overflow-scrolling: touch; } -#all-queries tbody { - word-wrap: break-word; + +/* Optimize Queries-Table for small screens */ +#all-queries td:nth-of-type(1), /* Time column */ +#all-queries td:nth-of-type(5) { /* Status column */ + white-space: nowrap; } +#all-queries td:nth-of-type(3) { /* Domain column */ + min-width: 200px; + word-break: break-all; + white-space: pre-wrap; +} +#all-queries_info { /* Allow Info String to wrap (useful while filtering entries on small screen) */ + white-space: unset; +} +#all-queries_wrapper .pagination > li > a { /* adjust the buttons width */ + padding-left: 6px; + padding-right: 6px; + min-width: 34px; + text-align: center; +} +@media screen and (max-width: 500px), + screen and (min-width: 767px) and (max-width: 1000px) { + /* Hide "Previous" & "Next"-Buttons in Pagination */ + #all-queries_wrapper .pagination > li.previous, + #all-queries_wrapper .pagination > li.next { + display: none; + } + #all-queries_wrapper .pagination > li:nth-of-type(2) a { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + #all-queries_wrapper .pagination > li:nth-last-of-type(2) a { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + } +} + .main-header>.navbar { height: 50px; }