diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index ffbf6844..c14495bd 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -287,11 +287,7 @@ if (sessionvalidity > 0) { seconds = "0" + seconds; } - if (totalseconds > 0) { - sessionTimerCounter.textContent = minutes + ":" + seconds; - } else { - sessionTimerCounter.textContent = "-- : --"; - } + sessionTimerCounter.textContent = totalseconds > 0 ? minutes + ":" + seconds : "-- : --"; }, 1000); } else { document.getElementById("sessiontimer").style.display = "none"; diff --git a/scripts/pi-hole/js/ip-address-sorting.js b/scripts/pi-hole/js/ip-address-sorting.js index ecc3aa5f..e4f487b4 100644 --- a/scripts/pi-hole/js/ip-address-sorting.js +++ b/scripts/pi-hole/js/ip-address-sorting.js @@ -59,20 +59,38 @@ $.extend($.fn.dataTableExt.oSort, { xa += ":"; } - if (item.length === 0) { - count += 0; - } else if (item.length === 1) { - xa += "000" + item; - count += 4; - } else if (item.length === 2) { - xa += "00" + item; - count += 4; - } else if (item.length === 3) { - xa += "0" + item; - count += 4; - } else { - xa += item; - count += 4; + switch (item.length) { + case 0: { + count += 0; + + break; + } + + case 1: { + xa += "000" + item; + count += 4; + + break; + } + + case 2: { + xa += "00" + item; + count += 4; + + break; + } + + case 3: { + xa += "0" + item; + count += 4; + + break; + } + + default: { + xa += item; + count += 4; + } } }