feat: disk smart info (#773)

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-06-05 07:31:45 +08:00
committed by GitHub
parent 741a6442e0
commit 176cb7da03
41 changed files with 2225 additions and 157 deletions

View File

@@ -17,6 +17,11 @@ abstract final class GithubIds {
'dccif',
'mikropsoft',
'CakesTwix',
'dsvf',
'fei1025',
'MasedMSD',
'GitGitro',
'Shin-suechtig',
};
static const participants = <GhId>{
@@ -99,6 +104,20 @@ abstract final class GithubIds {
'88484396',
'honggeigei',
'likecreep',
'axlrose',
'immortal521',
'PRO-2684',
'Xiaobao-Yang',
'Mrhs121',
'Fudiautobi',
'papaj-na-wrotkach',
'kid1412621',
'smanx',
'xuanyue1024',
'RuofengX',
'rhwong',
'AstroEngineeer',
'mochasweet',
};
}

View File

@@ -8,56 +8,33 @@ import 'package:server_box/data/model/server/system.dart';
import 'package:server_box/data/model/server/temp.dart';
abstract final class InitStatus {
static SingleCpuCore get _initOneTimeCpuStatus => SingleCpuCore(
'cpu',
0,
0,
0,
0,
0,
0,
0,
);
static Cpus get cpus => Cpus(
[_initOneTimeCpuStatus],
[_initOneTimeCpuStatus],
);
static NetSpeedPart get _initNetSpeedPart => NetSpeedPart(
'',
BigInt.zero,
BigInt.zero,
0,
);
static NetSpeed get netSpeed => NetSpeed(
[_initNetSpeedPart],
[_initNetSpeedPart],
);
static SingleCpuCore get _initOneTimeCpuStatus =>
SingleCpuCore('cpu', 0, 0, 0, 0, 0, 0, 0);
static Cpus get cpus =>
Cpus([_initOneTimeCpuStatus], [_initOneTimeCpuStatus]);
static NetSpeedPart get _initNetSpeedPart =>
NetSpeedPart('', BigInt.zero, BigInt.zero, 0);
static NetSpeed get netSpeed =>
NetSpeed([_initNetSpeedPart], [_initNetSpeedPart]);
static ServerStatus get status => ServerStatus(
cpu: cpus,
mem: const Memory(
total: 1,
free: 1,
avail: 1,
),
disk: [
Disk(
path: '/',
mount: '/',
usedPercent: 0,
used: BigInt.zero,
size: BigInt.one,
avail: BigInt.zero,
)
],
tcp: const Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
netSpeed: netSpeed,
swap: const Swap(
total: 0,
free: 0,
cached: 0,
),
system: SystemType.linux,
temps: Temperatures(),
diskIO: DiskIO([], []),
);
cpu: cpus,
mem: const Memory(total: 1, free: 1, avail: 1),
disk: [
Disk(
path: '/',
mount: '/',
usedPercent: 0,
used: BigInt.zero,
size: BigInt.one,
avail: BigInt.zero,
),
],
tcp: const Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
netSpeed: netSpeed,
swap: const Swap(total: 0, free: 0, cached: 0),
system: SystemType.linux,
temps: Temperatures(),
diskIO: DiskIO([], []),
diskSmart: const [],
);
}