mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: ignore all disk not start with /dev
This commit is contained in:
@@ -40,8 +40,10 @@ class Disk {
|
|||||||
pathCache = '';
|
pathCache = '';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
final dev = vals[0];
|
||||||
|
if (!dev.startsWith('/dev')) continue;
|
||||||
list.add(Disk(
|
list.add(Disk(
|
||||||
dev: vals[0],
|
dev: dev,
|
||||||
mount: vals[5],
|
mount: vals[5],
|
||||||
usedPercent: int.parse(vals[4].replaceFirst('%', '')),
|
usedPercent: int.parse(vals[4].replaceFirst('%', '')),
|
||||||
used: BigInt.tryParse(vals[2]) ?? BigInt.zero,
|
used: BigInt.tryParse(vals[2]) ?? BigInt.zero,
|
||||||
|
|||||||
@@ -17,16 +17,6 @@ abstract final class Defaults {
|
|||||||
'battery'
|
'battery'
|
||||||
];
|
];
|
||||||
|
|
||||||
static const diskIgnorePath = [
|
|
||||||
'udev',
|
|
||||||
'tmpfs',
|
|
||||||
'devtmpfs',
|
|
||||||
'overlay',
|
|
||||||
'run',
|
|
||||||
'none',
|
|
||||||
'shm',
|
|
||||||
];
|
|
||||||
|
|
||||||
static const sshVirtKeys = [
|
static const sshVirtKeys = [
|
||||||
VirtKey.esc,
|
VirtKey.esc,
|
||||||
VirtKey.alt,
|
VirtKey.alt,
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ class SettingStore extends PersistentStore {
|
|||||||
Defaults.launchPageIdx,
|
Defaults.launchPageIdx,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Server detail disk ignore path
|
|
||||||
late final diskIgnorePath =
|
|
||||||
property('diskIgnorePath', Defaults.diskIgnorePath);
|
|
||||||
|
|
||||||
/// Disk view: amount / IO
|
/// Disk view: amount / IO
|
||||||
late final serverTabPreferDiskAmount = property(
|
late final serverTabPreferDiskAmount = property(
|
||||||
'serverTabPreferDiskAmount',
|
'serverTabPreferDiskAmount',
|
||||||
|
|||||||
@@ -430,15 +430,8 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDiskView(ServerStatus ss) {
|
Widget _buildDiskView(ServerStatus ss) {
|
||||||
final disks = ss.disk;
|
final children = List.generate(
|
||||||
disks.removeWhere((e) {
|
ss.disk.length, (idx) => _buildDiskItem(ss.disk[idx], ss));
|
||||||
for (final ingorePath in Stores.setting.diskIgnorePath.fetch()) {
|
|
||||||
if (e.dev.startsWith(ingorePath)) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
final children =
|
|
||||||
List.generate(disks.length, (idx) => _buildDiskItem(disks[idx], ss));
|
|
||||||
return CardX(
|
return CardX(
|
||||||
child: ExpandTile(
|
child: ExpandTile(
|
||||||
title: Text(l10n.disk),
|
title: Text(l10n.disk),
|
||||||
|
|||||||
Reference in New Issue
Block a user