summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-15 05:40:58 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-15 05:40:58 +0900
commitc985fed3e43bae05f9e6e854f651f49f2bc3e83a (patch)
treee85c05f5192bef89b4380653b739db3a38804de2 /src/server/api/endpoints
parent8.39.0 (diff)
downloadsharkey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.tar.gz
sharkey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.tar.bz2
sharkey-c985fed3e43bae05f9e6e854f651f49f2bc3e83a.zip
Resolve #2328
Diffstat (limited to 'src/server/api/endpoints')
-rw-r--r--src/server/api/endpoints/chart.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/api/endpoints/chart.ts b/src/server/api/endpoints/chart.ts
index 7da970131e..3b1a3b56fc 100644
--- a/src/server/api/endpoints/chart.ts
+++ b/src/server/api/endpoints/chart.ts
@@ -6,6 +6,15 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
function migrateStats(stats: IStats[]) {
stats.forEach(stat => {
+ if (stat.network == null) {
+ stat.network = {
+ requests: 0,
+ totalTime: 0,
+ incomingBytes: 0,
+ outgoingBytes: 0
+ };
+ }
+
const isOldData =
stat.users.local.inc == null ||
stat.users.local.dec == null ||
@@ -180,6 +189,12 @@ export default (params: any) => new Promise(async (res, rej) => {
decCount: 0,
decSize: 0
}
+ },
+ network: {
+ requests: 0,
+ totalTime: 0,
+ incomingBytes: 0,
+ outgoingBytes: 0
}
});
} else {
@@ -236,6 +251,12 @@ export default (params: any) => new Promise(async (res, rej) => {
decCount: 0,
decSize: 0
}
+ },
+ network: {
+ requests: 0,
+ totalTime: 0,
+ incomingBytes: 0,
+ outgoingBytes: 0
}
});
}