Skip to content

Commit

Permalink
fix(api): Final fixes for disk stats
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Oct 1, 2020
1 parent 76d1066 commit 1805b02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 2 additions & 4 deletions apps/api/src/status/status.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ export class StatusService {

const folderSize = await this.getFolderSize()

const totalDiskUsed = disk.total - disk.available

const freePercentage = parseFloat(((disk.available / disk.total) * 100).toFixed(2))
const usedPercentage = parseFloat(((folderSize / totalDiskUsed) * 100).toFixed(2))
const sizePercentage = parseFloat((((totalDiskUsed - folderSize) / disk.total) * 100).toFixed(2))
const usedPercentage = parseFloat(((folderSize / disk.total) * 100).toFixed(2))
const sizePercentage = parseFloat((((disk.total - disk.available - folderSize) / disk.total) * 100).toFixed(2))

return {
version: 'unknown', // TODO:: Get git tag
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@
"lint": "nx workspace-lint && nx lint",
"logs": "yarn pm2 logs",
"nx": "nx",
"start": "nx serve",
"reload:prod": "yarn stop:prod && yarn start:prod",
"setup": "pm2 install pm2-logrotate && yarn build",
"start": "nx serve",
"start:api": "nx serve api",
"start:prod": "pm2 start ecosystem.config.js",
"stop:prod": "pm2 stop ecosystem.config.js",
"test": "nx test",
"update": "nx migrate latest",
"workspace-schematic": "nx workspace-schematic"
},
"resolutions": {
"webtorrent": "0.108.6",
"webtorrent-cli": "3.0.7",
"wrtc": "0.4.5"
},
"dependencies": {
"@hapi/joi": "17.1.1",
"@nestjs/cli": "7.5.1",
Expand Down Expand Up @@ -91,5 +87,10 @@
"ts-node": "~9.0.0",
"tslint": "~6.1.3",
"typescript": "~4.0.3"
},
"resolutions": {
"webtorrent": "0.108.6",
"webtorrent-cli": "3.0.7",
"wrtc": "0.4.5"
}
}

0 comments on commit 1805b02

Please sign in to comment.