opt.: custom diskIgnorePath
This commit is contained in:
@@ -27,14 +27,13 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late MediaQueryData _media;
|
||||
late S _s;
|
||||
bool _showDistLogo = true;
|
||||
final _setting = locator<SettingStore>();
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
_media = MediaQuery.of(context);
|
||||
_s = S.of(context)!;
|
||||
_showDistLogo = locator<SettingStore>().showDistLogo.fetch()!;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -76,7 +75,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildLinuxIcon(String sysVer) {
|
||||
if (!_showDistLogo) return placeholder;
|
||||
if (!_setting.showDistLogo.fetch()!) return placeholder;
|
||||
final iconPath = sysVer.dist?.iconPath;
|
||||
if (iconPath == null) return placeholder;
|
||||
return ConstrainedBox(
|
||||
@@ -262,13 +261,13 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildDiskView(ServerStatus ss) {
|
||||
final clone = ss.disk.toList();
|
||||
for (var item in ss.disk) {
|
||||
if (_ignorePath.any((ele) => item.path.startsWith(ele))) {
|
||||
clone.remove(item);
|
||||
ss.disk.removeWhere((e) {
|
||||
for (final ingorePath in _setting.diskIgnorePath.fetch()!) {
|
||||
if (e.path.startsWith(ingorePath)) return true;
|
||||
}
|
||||
}
|
||||
final children = clone
|
||||
return false;
|
||||
});
|
||||
final children = ss.disk
|
||||
.map((disk) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Column(
|
||||
@@ -344,14 +343,14 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildNetSpeedItem(NetSpeed ns, String device) {
|
||||
final width = (_media.size.width - 34 - 34) / 3;
|
||||
final width = (_media.size.width - 34 - 34) / 2.9;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: width,
|
||||
width: width / 1.2,
|
||||
child: Text(
|
||||
device,
|
||||
style: textSize11,
|
||||
@@ -364,7 +363,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
'${ns.speedIn(device: device)} | ${ns.totalIn(device: device)}',
|
||||
style: textSize11,
|
||||
textAlign: TextAlign.center,
|
||||
textScaleFactor: 0.9,
|
||||
textScaleFactor: 0.87,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -373,7 +372,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
'${ns.speedOut(device: device)} | ${ns.totalOut(device: device)}',
|
||||
style: textSize11,
|
||||
textAlign: TextAlign.right,
|
||||
textScaleFactor: 0.9,
|
||||
textScaleFactor: 0.87,
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -393,7 +392,10 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
Icon(Icons.arrow_downward, size: 17),
|
||||
],
|
||||
),
|
||||
const Padding(padding: EdgeInsets.symmetric(vertical: 3), child: Divider(height: 7),),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 3),
|
||||
child: Divider(height: 7),
|
||||
),
|
||||
];
|
||||
children.addAll(ss.temps.devices.map((key) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -415,6 +417,4 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
child: Column(children: children),
|
||||
));
|
||||
}
|
||||
|
||||
static const _ignorePath = ['udev', 'tmpfs', 'devtmpfs'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user