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 = '';
|
||||
}
|
||||
try {
|
||||
final dev = vals[0];
|
||||
if (!dev.startsWith('/dev')) continue;
|
||||
list.add(Disk(
|
||||
dev: vals[0],
|
||||
dev: dev,
|
||||
mount: vals[5],
|
||||
usedPercent: int.parse(vals[4].replaceFirst('%', '')),
|
||||
used: BigInt.tryParse(vals[2]) ?? BigInt.zero,
|
||||
|
||||
@@ -17,16 +17,6 @@ abstract final class Defaults {
|
||||
'battery'
|
||||
];
|
||||
|
||||
static const diskIgnorePath = [
|
||||
'udev',
|
||||
'tmpfs',
|
||||
'devtmpfs',
|
||||
'overlay',
|
||||
'run',
|
||||
'none',
|
||||
'shm',
|
||||
];
|
||||
|
||||
static const sshVirtKeys = [
|
||||
VirtKey.esc,
|
||||
VirtKey.alt,
|
||||
|
||||
@@ -38,10 +38,6 @@ class SettingStore extends PersistentStore {
|
||||
Defaults.launchPageIdx,
|
||||
);
|
||||
|
||||
/// Server detail disk ignore path
|
||||
late final diskIgnorePath =
|
||||
property('diskIgnorePath', Defaults.diskIgnorePath);
|
||||
|
||||
/// Disk view: amount / IO
|
||||
late final serverTabPreferDiskAmount = property(
|
||||
'serverTabPreferDiskAmount',
|
||||
|
||||
@@ -430,15 +430,8 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildDiskView(ServerStatus ss) {
|
||||
final disks = ss.disk;
|
||||
disks.removeWhere((e) {
|
||||
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));
|
||||
final children = List.generate(
|
||||
ss.disk.length, (idx) => _buildDiskItem(ss.disk[idx], ss));
|
||||
return CardX(
|
||||
child: ExpandTile(
|
||||
title: Text(l10n.disk),
|
||||
|
||||
Reference in New Issue
Block a user