forked from mirror/misskey
Refactor
This commit is contained in:
parent
432e18a0c0
commit
9dd5ed7f1a
@ -58,6 +58,9 @@ const rgba = (color: string): string => {
|
|||||||
|
|
||||||
const limit = 35;
|
const limit = 35;
|
||||||
|
|
||||||
|
const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b));
|
||||||
|
const negate = arr => arr.map(x => -x);
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
XChart
|
XChart
|
||||||
@ -149,19 +152,11 @@ export default Vue.extend({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
format(arr) {
|
||||||
|
return arr.map((v, i) => ({ t: this.getDate(i).getTime(), y: v }));
|
||||||
|
},
|
||||||
|
|
||||||
notesChart(type: string): any {
|
notesChart(type: string): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
normal: type == 'local' ? this.stats.notes.local.diffs.normal[i] : type == 'remote' ? this.stats.notes.remote.diffs.normal[i] : this.stats.notes.local.diffs.normal[i] + this.stats.notes.remote.diffs.normal[i],
|
|
||||||
reply: type == 'local' ? this.stats.notes.local.diffs.reply[i] : type == 'remote' ? this.stats.notes.remote.diffs.reply[i] : this.stats.notes.local.diffs.reply[i] + this.stats.notes.remote.diffs.reply[i],
|
|
||||||
renote: type == 'local' ? this.stats.notes.local.diffs.renote[i] : type == 'remote' ? this.stats.notes.remote.diffs.renote[i] : this.stats.notes.local.diffs.renote[i] + this.stats.notes.remote.diffs.renote[i],
|
|
||||||
all: type == 'local' ? (this.stats.notes.local.inc[i] + -this.stats.notes.local.dec[i]) : type == 'remote' ? (this.stats.notes.remote.inc[i] + -this.stats.notes.remote.dec[i]) : (this.stats.notes.local.inc[i] + -this.stats.notes.local.dec[i]) + (this.stats.notes.remote.inc[i] + -this.stats.notes.remote.dec[i])
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'All',
|
label: 'All',
|
||||||
@ -171,7 +166,10 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.all }))
|
data: this.format(type == 'combined'
|
||||||
|
? sum(this.stats.notes.local.inc, negate(this.stats.notes.local.dec), this.stats.notes.remote.inc, negate(this.stats.notes.remote.dec))
|
||||||
|
: sum(this.stats.notes[type].inc, negate(this.stats.notes[type].dec))
|
||||||
|
)
|
||||||
}, {
|
}, {
|
||||||
label: 'Renotes',
|
label: 'Renotes',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -180,7 +178,10 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.renote }))
|
data: this.format(type == 'combined'
|
||||||
|
? sum(this.stats.notes.local.diffs.renote, this.stats.notes.remote.diffs.renote)
|
||||||
|
: this.stats.notes[type].diffs.renote
|
||||||
|
)
|
||||||
}, {
|
}, {
|
||||||
label: 'Replies',
|
label: 'Replies',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -189,7 +190,10 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.reply }))
|
data: this.format(type == 'combined'
|
||||||
|
? sum(this.stats.notes.local.diffs.reply, this.stats.notes.remote.diffs.reply)
|
||||||
|
: this.stats.notes[type].diffs.reply
|
||||||
|
)
|
||||||
}, {
|
}, {
|
||||||
label: 'Normal',
|
label: 'Normal',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -198,7 +202,10 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.normal }))
|
data: this.format(type == 'combined'
|
||||||
|
? sum(this.stats.notes.local.diffs.normal, this.stats.notes.remote.diffs.normal)
|
||||||
|
: this.stats.notes[type].diffs.normal
|
||||||
|
)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -222,16 +229,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
notesTotalChart(): any {
|
notesTotalChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localCount: this.stats.notes.local.total[i],
|
|
||||||
remoteCount: this.stats.notes.remote.total[i]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Combined',
|
label: 'Combined',
|
||||||
@ -241,7 +238,7 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteCount + x.localCount }))
|
data: this.format(sum(this.stats.notes.local.total, this.stats.notes.remote.total))
|
||||||
}, {
|
}, {
|
||||||
label: 'Local',
|
label: 'Local',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -250,7 +247,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localCount }))
|
data: this.format(this.stats.notes.local.total)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote',
|
label: 'Remote',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -259,7 +256,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteCount }))
|
data: this.format(this.stats.notes.remote.total)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -283,16 +280,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
usersChart(total: boolean): any {
|
usersChart(total: boolean): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localCount: total ? this.stats.users.local.total[i] : (this.stats.users.local.inc[i] + -this.stats.users.local.dec[i]),
|
|
||||||
remoteCount: total ? this.stats.users.remote.total[i] : (this.stats.users.remote.inc[i] + -this.stats.users.remote.dec[i])
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Combined',
|
label: 'Combined',
|
||||||
@ -302,7 +289,10 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteCount + x.localCount }))
|
data: this.format(total
|
||||||
|
? sum(this.stats.users.local.total, this.stats.users.remote.total)
|
||||||
|
: sum(this.stats.users.local.inc, negate(this.stats.users.local.dec), this.stats.users.remote.inc, negate(this.stats.users.remote.dec))
|
||||||
|
)
|
||||||
}, {
|
}, {
|
||||||
label: 'Local',
|
label: 'Local',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -311,7 +301,10 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localCount }))
|
data: this.format(total
|
||||||
|
? this.stats.users.local.total
|
||||||
|
: sum(this.stats.users.local.inc, negate(this.stats.users.local.dec))
|
||||||
|
)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote',
|
label: 'Remote',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -320,7 +313,10 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteCount }))
|
data: this.format(total
|
||||||
|
? this.stats.users.remote.total
|
||||||
|
: sum(this.stats.users.remote.inc, negate(this.stats.users.remote.dec))
|
||||||
|
)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -344,18 +340,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
driveChart(): any {
|
driveChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localInc: this.stats.drive.local.incSize[i],
|
|
||||||
localDec: -this.stats.drive.local.decSize[i],
|
|
||||||
remoteInc: this.stats.drive.remote.incSize[i],
|
|
||||||
remoteDec: -this.stats.drive.remote.decSize[i],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'All',
|
label: 'All',
|
||||||
@ -365,7 +349,7 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localInc + x.localDec + x.remoteInc + x.remoteDec }))
|
data: this.format(sum(this.stats.drive.local.incSize, negate(this.stats.drive.local.decSize), this.stats.drive.remote.incSize, negate(this.stats.drive.remote.decSize)))
|
||||||
}, {
|
}, {
|
||||||
label: 'Local +',
|
label: 'Local +',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -374,7 +358,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localInc }))
|
data: this.format(this.stats.drive.local.incSize)
|
||||||
}, {
|
}, {
|
||||||
label: 'Local -',
|
label: 'Local -',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -383,7 +367,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localDec }))
|
data: this.format(negate(this.stats.drive.local.decSize))
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote +',
|
label: 'Remote +',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -392,7 +376,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteInc }))
|
data: this.format(this.stats.drive.remote.incSize)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote -',
|
label: 'Remote -',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -401,7 +385,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteDec }))
|
data: this.format(negate(this.stats.drive.remote.decSize))
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -425,16 +409,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
driveTotalChart(): any {
|
driveTotalChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localSize: this.stats.drive.local.totalSize[i],
|
|
||||||
remoteSize: this.stats.drive.remote.totalSize[i]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Combined',
|
label: 'Combined',
|
||||||
@ -444,7 +418,7 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteSize + x.localSize }))
|
data: this.format(sum(this.stats.drive.local.totalSize, this.stats.drive.remote.totalSize))
|
||||||
}, {
|
}, {
|
||||||
label: 'Local',
|
label: 'Local',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -453,7 +427,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localSize }))
|
data: this.format(this.stats.drive.local.totalSize)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote',
|
label: 'Remote',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -462,7 +436,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteSize }))
|
data: this.format(this.stats.drive.remote.totalSize)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -486,18 +460,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
driveFilesChart(): any {
|
driveFilesChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localInc: this.stats.drive.local.incCount[i],
|
|
||||||
localDec: -this.stats.drive.local.decCount[i],
|
|
||||||
remoteInc: this.stats.drive.remote.incCount[i],
|
|
||||||
remoteDec: -this.stats.drive.remote.decCount[i]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'All',
|
label: 'All',
|
||||||
@ -507,7 +469,7 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localInc + x.localDec + x.remoteInc + x.remoteDec }))
|
data: this.format(sum(this.stats.drive.local.incCount, negate(this.stats.drive.local.decCount), this.stats.drive.remote.incCount, negate(this.stats.drive.remote.decCount)))
|
||||||
}, {
|
}, {
|
||||||
label: 'Local +',
|
label: 'Local +',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -516,7 +478,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localInc }))
|
data: this.format(this.stats.drive.local.incCount)
|
||||||
}, {
|
}, {
|
||||||
label: 'Local -',
|
label: 'Local -',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -525,7 +487,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localDec }))
|
data: this.format(negate(this.stats.drive.local.decCount))
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote +',
|
label: 'Remote +',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -534,7 +496,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteInc }))
|
data: this.format(this.stats.drive.remote.incCount)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote -',
|
label: 'Remote -',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -543,7 +505,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteDec }))
|
data: this.format(negate(this.stats.drive.remote.decCount))
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -567,16 +529,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
driveFilesTotalChart(): any {
|
driveFilesTotalChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
localCount: this.stats.drive.local.totalCount[i],
|
|
||||||
remoteCount: this.stats.drive.remote.totalCount[i],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Combined',
|
label: 'Combined',
|
||||||
@ -586,7 +538,7 @@ export default Vue.extend({
|
|||||||
borderDash: [4, 4],
|
borderDash: [4, 4],
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localCount + x.remoteCount }))
|
data: this.format(sum(this.stats.drive.local.totalCount, this.stats.drive.remote.totalCount))
|
||||||
}, {
|
}, {
|
||||||
label: 'Local',
|
label: 'Local',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -595,7 +547,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.localCount }))
|
data: this.format(this.stats.drive.local.totalCount)
|
||||||
}, {
|
}, {
|
||||||
label: 'Remote',
|
label: 'Remote',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -604,7 +556,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.remoteCount }))
|
data: this.format(this.stats.drive.remote.totalCount)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
@ -628,15 +580,6 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
networkRequestsChart(): any {
|
networkRequestsChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
incoming: this.stats.network.incomingRequests[i]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Incoming',
|
label: 'Incoming',
|
||||||
@ -646,7 +589,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.incoming }))
|
data: this.format(this.stats.network.incomingRequests)
|
||||||
}]
|
}]
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
@ -655,10 +598,7 @@ export default Vue.extend({
|
|||||||
const data = [];
|
const data = [];
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
for (let i = 0; i < limit; i++) {
|
||||||
data.push({
|
data.push(this.stats.network.incomingRequests[i] != 0 ? (this.stats.network.totalTime[i] / this.stats.network.incomingRequests[i]) : 0);
|
||||||
date: this.getDate(i),
|
|
||||||
time: this.stats.network.incomingRequests[i] != 0 ? (this.stats.network.totalTime[i] / this.stats.network.incomingRequests[i]) : 0,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
@ -670,22 +610,12 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.time }))
|
data: this.format(data)
|
||||||
}]
|
}]
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
|
|
||||||
networkUsageChart(): any {
|
networkUsageChart(): any {
|
||||||
const data = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
data.push({
|
|
||||||
date: this.getDate(i),
|
|
||||||
incoming: this.stats.network.incomingBytes[i],
|
|
||||||
outgoing: this.stats.network.outgoingBytes[i]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Incoming',
|
label: 'Incoming',
|
||||||
@ -695,7 +625,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.incoming }))
|
data: this.format(this.stats.network.incomingBytes)
|
||||||
}, {
|
}, {
|
||||||
label: 'Outgoing',
|
label: 'Outgoing',
|
||||||
fill: true,
|
fill: true,
|
||||||
@ -704,7 +634,7 @@ export default Vue.extend({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointBackgroundColor: '#fff',
|
pointBackgroundColor: '#fff',
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
data: data.map(x => ({ t: x.date, y: x.outgoing }))
|
data: this.format(this.stats.network.outgoingBytes)
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
scales: {
|
scales: {
|
||||||
|
Loading…
Reference in New Issue
Block a user