mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.
- spi: use ip as name if empty - server tab ui - only display io speed when available
This commit is contained in:
@@ -44,8 +44,9 @@ class DiskIO extends TimeSeq<DiskIOPiece> {
|
||||
|
||||
(String?, String?) getSpeed(String dev) {
|
||||
final (read_, write_) = _getSpeed(dev);
|
||||
final read = '${read_?.convertBytes}/s';
|
||||
final write = '${write_?.convertBytes}/s';
|
||||
if (read_ == null || write_ == null) return (null, null);
|
||||
final read = '${read_.convertBytes}/s';
|
||||
final write = '${write_.convertBytes}/s';
|
||||
return (read, write);
|
||||
}
|
||||
|
||||
|
||||
@@ -393,7 +393,9 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
}
|
||||
|
||||
final spi = ServerPrivateInfo(
|
||||
name: _nameController.text,
|
||||
name: _nameController.text.isEmpty
|
||||
? _ipController.text
|
||||
: _nameController.text,
|
||||
ip: _ipController.text,
|
||||
port: int.parse(_portController.text),
|
||||
user: _usernameController.text,
|
||||
|
||||
@@ -212,8 +212,8 @@ class _ServerPageState extends State<ServerPage>
|
||||
Widget _wrapWithSizedbox(Widget child) {
|
||||
return SizedBox(
|
||||
width: _useDoubleColumn
|
||||
? (_media.size.width - 146) / 10
|
||||
: (_media.size.width - 74) / 5,
|
||||
? (_media.size.width - 137) / 8
|
||||
: (_media.size.width - 74) / 4,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
@@ -307,9 +307,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
List<Widget> _buildNormalCard(ServerStatus ss, ServerPrivateInfo spi) {
|
||||
return [
|
||||
UIs.height13,
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 13),
|
||||
child: Row(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
_wrapWithSizedbox(_buildPercentCircle(ss.cpu.usedPercent())),
|
||||
@@ -318,7 +316,6 @@ class _ServerPageState extends State<ServerPage>
|
||||
_wrapWithSizedbox(_buildDisk(ss, spi.id)),
|
||||
],
|
||||
),
|
||||
),
|
||||
UIs.height13,
|
||||
if (Stores.setting.moveOutServerTabFuncBtns.fetch() &&
|
||||
// Discussion #146
|
||||
|
||||
Reference in New Issue
Block a user