Skip to content

Commit

Permalink
Better diskusage
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 authored and fs5m8 committed Jan 15, 2023
1 parent 0b3d965 commit 97a340b
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 @@ -55,7 +55,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 @@ -30,12 +29,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 @@ -2384,11 +2384,6 @@ character-parser@^2.2.0:
dependencies:
is-regex "^1.0.3"

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

cheerio@0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
Expand Down

0 comments on commit 97a340b

Please sign in to comment.