Merge branch 'master' into feature/tls-renegotiation

pull/482/head
Anže Jenšterle 2020-04-06 18:05:39 +02:00 committed by GitHub
commit 6b74003533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 22 deletions

View File

@ -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);

View File

@ -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
}
}
}
</script>

View File