Skip to content

Commit

Permalink
Better diskusage
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 14, 2023
1 parent 00b87b9 commit 7ff24d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"cafy": "15.2.1",
"cbor": "8.1.0",
"chalk": "4.1.2",
"check-disk-space": "3.3.1",
"cli-highlight": "2.1.11",
"content-disposition": "0.5.4",
"crc-32": "1.2.2",
Expand Down
9 changes: 4 additions & 5 deletions src/daemons/server-stats.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as os from 'os';
import * as sysUtils from 'systeminformation';
const checkDiskSpace = require('check-disk-space').default;
import * as Deque from 'double-ended-queue';
import Xev from 'xev';
import * as osUtils from 'os-utils';
Expand Down Expand Up @@ -29,12 +28,12 @@ export default function() {
const cpu = await cpuUsage();
const usedmem = await usedMem();
const totalmem = await totalMem();
const fsStats = await sysUtils.fsSize();

const _disk = await checkDiskSpace(os.platform() == 'win32' ? 'c:' : '/') as { diskPath: string; free: number; size: number; };
const disk: DiskUsage = {
available: _disk.free,
free: _disk.free,
total: _disk.size,
available: fsStats[0].available,
free: fsStats[0].available,
total: fsStats[0].size,
};

const stats = {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2210,11 +2210,6 @@ character-parser@^2.2.0:
dependencies:
is-regex "^1.0.3"

[email protected]:
version "3.3.1"
resolved "https://registry.yarnpkg.com/check-disk-space/-/check-disk-space-3.3.1.tgz#10c4c8706fdd16d3e5c3572a16aa95efd0b4d40b"
integrity sha512-iOrT8yCZjSnyNZ43476FE2rnssvgw5hnuwOM0hm8Nj1qa0v4ieUUEbCyxxsEliaoDUb/75yCOL71zkDiDBLbMQ==

[email protected]:
version "0.22.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
Expand Down

0 comments on commit 7ff24d4

Please sign in to comment.