Merge pull request #1872 from pi-hole/tweak/color

Less color for the Query Log
This commit is contained in:
Adam Warner
2021-09-11 20:59:49 +01:00
committed by GitHub
+26 -36
View File
@@ -110,20 +110,20 @@ $(function () {
// Query status
var fieldtext,
buttontext = "",
colorClass = false,
isCNAME = false,
regexLink = false;
switch (data[4]) {
case "1":
colorClass = "text-red";
fieldtext = "Blocked (gravity)";
fieldtext = "<span class='text-red'>Blocked (gravity)</span>";
buttontext =
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
break;
case "2":
colorClass = "text-green";
fieldtext = replyid === 0 ? "OK, sent to " : "OK, answered by ";
fieldtext =
replyid === 0
? "<span class='text-green'>OK</span>, sent to "
: "<span class='text-green'>OK</span>, answered by ";
fieldtext +=
"<br class='hidden-lg'>" +
(data.length > 10 && data[10] !== "N/A" ? data[10] : "") +
@@ -132,14 +132,13 @@ $(function () {
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
case "3":
colorClass = "text-green";
fieldtext = "OK <br class='hidden-lg'>(cached)" + dnssecStatus;
fieldtext =
"<span class='text-green'>OK</span> <br class='hidden-lg'>(cache)" + dnssecStatus;
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
case "4":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(regex blacklist)";
fieldtext = "<span class='text-red'>Blocked <br class='hidden-lg'>(regex blacklist)";
if (data.length > 9 && data[9] > 0) {
regexLink = true;
@@ -149,36 +148,33 @@ $(function () {
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
break;
case "5":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(exact blacklist)";
fieldtext = "<span class='text-red'>Blocked <br class='hidden-lg'>(exact blacklist)";
buttontext =
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
break;
case "6":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(external, IP)";
fieldtext = "<span class='text-red'>Blocked <br class='hidden-lg'>(external, IP)";
buttontext = "";
break;
case "7":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(external, NULL)";
fieldtext =
"<span class='text-red'>Blocked <br class='hidden-lg'>(external, NULL)</span>";
buttontext = "";
break;
case "8":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(external, NXRA)";
fieldtext =
"<span class='text-red'>Blocked <br class='hidden-lg'>(external, NXRA)</span>";
buttontext = "";
break;
case "9":
colorClass = "text-red";
fieldtext = "Blocked (gravity, CNAME)";
fieldtext = "<span class='text-red'>Blocked (gravity, CNAME)</span>";
buttontext =
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
isCNAME = true;
break;
case "10":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(regex blacklist, CNAME)";
fieldtext =
"<span class='text-red'>Blocked <br class='hidden-lg'>(regex blacklist, CNAME)</span>";
if (data.length > 9 && data[9] > 0) {
regexLink = true;
@@ -189,32 +185,30 @@ $(function () {
isCNAME = true;
break;
case "11":
colorClass = "text-red";
fieldtext = "Blocked <br class='hidden-lg'>(exact blacklist, CNAME)";
fieldtext =
"<span class='text-red'>Blocked <br class='hidden-lg'>(exact blacklist, CNAME)</span>";
buttontext =
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
isCNAME = true;
break;
case "12":
colorClass = "text-green";
fieldtext = "Retried";
fieldtext = "<span class='text-green'>Retried</span>";
break;
case "13":
colorClass = "text-green";
fieldtext = "Retried <br class='hidden-lg'>(ignored)";
fieldtext = "<span class='text-green'>Retried</span> <br class='hidden-lg'>(ignored)";
break;
case "14":
colorClass = "text-green";
fieldtext = "OK <br class='hidden-lg'>(already forwarded)" + dnssecStatus;
fieldtext =
"<span class='text-green'>OK</span> <br class='hidden-lg'>(already forwarded)" +
dnssecStatus;
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
case "15":
colorClass = "text-orange";
fieldtext = "Blocked <br class='hidden-lg'>(database is busy)";
fieldtext =
"<span class='text-red'>Blocked <br class='hidden-lg'>(database is busy)</span>";
break;
default:
colorClass = false;
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
}
@@ -226,10 +220,6 @@ $(function () {
fieldtext += '<input type="hidden" name="id" value="' + parseInt(data[4], 10) + '">';
if (colorClass !== false) {
$(row).addClass(colorClass);
}
$("td:eq(4)", row).html(fieldtext);
$("td:eq(6)", row).html(buttontext);