mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-20 07:05:07 +01:00
Change CPU Algorithm. Update README imgs
This commit is contained in:
@@ -17,19 +17,19 @@ class _ServerDetailPageState extends State<ServerDetailPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<ServerProvider>(builder: (_, provider, __) {
|
||||
return _buildMainPage(provider.servers.firstWhere((e) => e.client.id == widget.id));
|
||||
return _buildMainPage(
|
||||
provider.servers.firstWhere((e) => e.client.id == widget.id));
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildMainPage(ServerInfo si) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(si.info.name ?? 'Server Detail'),),
|
||||
appBar: AppBar(
|
||||
title: Text(si.info.name ?? 'Server Detail'),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
_buildCPUView(si.status),
|
||||
_buildMemView(si.status)
|
||||
],
|
||||
),
|
||||
children: [_buildCPUView(si.status), _buildMemView(si.status)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
_buildPercentCircle(ss.cpuPercent!, 'CPU'),
|
||||
_buildPercentCircle(ss.cpuPercent!.first.calculateUsedPercent, 'CPU'),
|
||||
_buildPercentCircle(
|
||||
ss.memList![1]! / ss.memList![0]! * 100 + 0.01, 'Mem'),
|
||||
_buildIOData('Net', 'Conn:\n' + ss.tcp!.maxConn!.toString(),
|
||||
|
||||
Reference in New Issue
Block a user