diff --git a/frontend/src/components/Service/ServiceHeatmap.vue b/frontend/src/components/Service/ServiceHeatmap.vue index 6418d7aa..1206ab69 100644 --- a/frontend/src/components/Service/ServiceHeatmap.vue +++ b/frontend/src/components/Service/ServiceHeatmap.vue @@ -96,21 +96,17 @@ start = new Date(start.getUTCFullYear(), start.getUTCMonth()+1, 1); monthNum += 1 } - - window.console.log(monthData) this.series = monthData.reverse() this.ready = true }, async heatmapData(start, end) { - - window.console.log("start: ", start) - window.console.log("end: ", end) - const data = await Api.service_failures_data(this.service.id, this.toUnix(start), this.toUnix(end), "24h", true) - let dataArr = [] + if (!data) { + return {name: start.toLocaleString('en-us', { month: 'long'}), data: []} + } data.forEach((d) => { - dataArr.push({x: this.parseISO(d.timeframe), y: d.amount}); + dataArr.push({x: this.parseISO(d.timeframe), y: d.amount}); }); let date = new Date(dataArr[0].x); diff --git a/frontend/src/components/Service/StatsGen.vue b/frontend/src/components/Service/StatsGen.vue index 1504cf92..8f4bf143 100644 --- a/frontend/src/components/Service/StatsGen.vue +++ b/frontend/src/components/Service/StatsGen.vue @@ -44,23 +44,25 @@ async mounted() { await this.latencyYesterday(); }, - async latencyYesterday() { - const todayTime = await Api.service_hits(this.service.id, this.toUnix(this.nowSubtract(86400)), this.toUnix(new Date()), this.group, false) - const fetched = await Api.service_hits(this.service.id, this.start, this.end, this.group, false) + methods: { + async latencyYesterday() { + const todayTime = await Api.service_hits(this.service.id, this.toUnix(this.nowSubtract(86400)), this.toUnix(new Date()), this.group, false) + const fetched = await Api.service_hits(this.service.id, this.start, this.end, this.group, false) - let todayAmount = this.addAmounts(todayTime) - let yesterday = this.addAmounts(fetched) + let todayAmount = this.addAmounts(todayTime) + let yesterday = this.addAmounts(fetched) - window.console.log(todayAmount) - window.console.log(yesterday) + window.console.log(todayAmount) + window.console.log(yesterday) - }, - addAmounts(data) { - let total = 0 - data.forEach((f) => { - total += parseInt(f.amount) - }); - return total + }, + addAmounts(data) { + let total = 0 + data.forEach((f) => { + total += parseInt(f.amount) + }); + return total + } } } diff --git a/source/tmpl/index.html b/source/tmpl/index.html deleted file mode 100644 index e69de29b..00000000