Merge pull request #1679 from pi-hole/fixes/xo

Prep for #1678 - xo v0.37.1
This commit is contained in:
DL6ER
2021-01-03 08:25:49 +01:00
committed by GitHub
4 changed files with 9 additions and 14 deletions
+5 -4
View File
@@ -106,10 +106,11 @@ function updateQueriesOverTime() {
}
for (hour in data.ads_over_time[0]) {
if (Object.prototype.hasOwnProperty.call(data.ads_over_time[0], hour)) {
if (dates.indexOf(parseInt(data.ads_over_time[0][hour], 10)) === -1) {
dates.push(parseInt(data.ads_over_time[0][hour], 10));
}
if (
Object.prototype.hasOwnProperty.call(data.ads_over_time[0], hour) &&
dates.indexOf(parseInt(data.ads_over_time[0][hour], 10)) === -1
) {
dates.push(parseInt(data.ads_over_time[0][hour], 10));
}
}
+3 -3
View File
@@ -44,7 +44,7 @@ function countDown() {
var ena = $("#enableLabel");
var enaT = $("#enableTimer");
var target = new Date(parseInt(enaT.html(), 10));
var seconds = Math.round((target.getTime() - new Date().getTime()) / 1000);
var seconds = Math.round((target.getTime() - Date.now()) / 1000);
if (seconds > 0) {
setTimeout(countDown, 1000);
@@ -81,7 +81,7 @@ function piholeChange(action, duration) {
btnStatus.html("");
piholeChanged("disabled");
if (duration > 0) {
enaT.html(new Date().getTime() + duration * 1000);
enaT.html(Date.now() + duration * 1000);
setTimeout(countDown, 100);
}
}
@@ -206,7 +206,7 @@ function initCPUtemp() {
$(function () {
var enaT = $("#enableTimer");
var target = new Date(parseInt(enaT.html(), 10));
var seconds = Math.round((target.getTime() - new Date().getTime()) / 1000);
var seconds = Math.round((target.getTime() - Date.now()) / 1000);
if (seconds > 0) {
setTimeout(countDown, 100);
}
+1 -1
View File
@@ -49,7 +49,7 @@ var customTooltips = function (tooltip) {
tooltipEl.style.fontStyle = tooltip._bodyFontStyle;
// append Tooltip next to canvas-containing box
tooltipEl.ancestor = this._chart.canvas.closest(".box[id]").parentNode;
tooltipEl.ancestor.appendChild(tooltipEl);
tooltipEl.ancestor.append(tooltipEl);
}
// Hide if no tooltip
-6
View File
@@ -31,12 +31,6 @@ function handleAjaxError(xhr, textStatus) {
}
function getTimestamp() {
if (!Date.now) {
Date.now = function () {
return new Date().getTime();
};
}
return Math.floor(Date.now() / 1000);
}