mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-28 21:18:54 +03:00
fix NaN on graph
This commit is contained in:
parent
0e02df2345
commit
a863b83065
2 changed files with 11 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vuetorrent",
|
||||
"version": "0.1.3",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
|
|
@ -8,12 +8,20 @@ export default class Status {
|
|||
this.upspeed = this.formatBytes(data.up_info_speed, 1)
|
||||
this.freeDiskSpace = this.formatBytes(data.free_space_on_disk)
|
||||
this.altSpeed = data.use_alt_speed_limits
|
||||
this.dlspeedRaw = Math.round(data.dl_info_speed / 1000)
|
||||
this.upspeedRaw = Math.round(data.up_info_speed / 1000)
|
||||
this.dlspeedRaw = this.formatSpeed(data.dl_info_speed)
|
||||
this.upspeedRaw = this.formatSpeed(data.up_info_speed)
|
||||
this.tags = tags
|
||||
}
|
||||
}
|
||||
|
||||
formatSpeed(value) {
|
||||
if (!value) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return Math.round(value / 1000)
|
||||
}
|
||||
|
||||
formatBytes(a, b) {
|
||||
if (!a) return '0 Bytes'
|
||||
if (a == 0) return '0 Bytes'
|
||||
|
|
Loading…
Reference in a new issue