From 9000228698c185e2be3f5917ce7f3027a8f0ef5f Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Wed, 1 Nov 2023 01:25:09 -0600 Subject: [PATCH] opt.: server detail page --- lib/core/analysis.dart | 4 -- lib/view/page/server/detail.dart | 65 +++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/lib/core/analysis.dart b/lib/core/analysis.dart index 856b18c2..df35ebb1 100644 --- a/lib/core/analysis.dart +++ b/lib/core/analysis.dart @@ -1,10 +1,8 @@ import 'dart:async'; -import 'dart:io'; import 'package:countly_flutter/countly_flutter.dart'; import 'package:toolbox/core/build_mode.dart'; import 'package:toolbox/core/utils/platform/base.dart'; -import 'package:toolbox/data/res/logger.dart'; class Analysis { static const _url = 'https://countly.xuty.cc'; @@ -23,8 +21,6 @@ class Analysis { .enableCrashReporting(); await Countly.initWithConfig(config); await Countly.giveAllConsent(); - } else { - Loggers.app.info('Countly unsupport: ${Platform.operatingSystem}'); } } diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index c100fcd1..b6b3e833 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -412,6 +412,7 @@ class _ServerDetailPageState extends State ) ], ), + childrenPadding: const EdgeInsets.only(bottom: 11), leading: const Icon(Icons.device_hub, size: 17), initiallyExpanded: children.length <= 7, children: children, @@ -420,26 +421,38 @@ class _ServerDetailPageState extends State } Widget _buildNetSpeedItem(NetSpeed ns, String device) { - return ListTile( - title: Text( - device, - style: UIs.textSize11Bold, - textScaleFactor: _textFactor, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - subtitle: Text( - '${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}', - style: UIs.textSize11Grey, - textScaleFactor: _textFactor, - ), - trailing: SizedBox( - width: 170, - child: Text( - '↑ ${ns.speedOut(device: device)}\n↓ ${ns.speedIn(device: device)}', - textAlign: TextAlign.end, - style: UIs.textSize11Grey, - ), + return Padding( + padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 17), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + device, + style: UIs.textSize11Bold, + textScaleFactor: _textFactor, + maxLines: 1, + overflow: TextOverflow.fade, + textAlign: TextAlign.left, + ), + Text( + '${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}', + style: UIs.textSize11Grey, + textScaleFactor: _textFactor, + ) + ], + ), + SizedBox( + width: 170, + child: Text( + '↑ ${ns.speedOut(device: device)}\n↓ ${ns.speedIn(device: device)}', + textAlign: TextAlign.end, + style: UIs.textSize11Grey, + ), + ) + ], ), ); } @@ -461,9 +474,15 @@ class _ServerDetailPageState extends State } Widget _buildTemperatureItem(String key, double? val) { - return ListTile( - title: Text(key, style: UIs.textSize13Bold), - trailing: Text('${val?.toStringAsFixed(1)}°C'), + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 7), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(key, style: UIs.textSize13), + Text('${val?.toStringAsFixed(1)}°C', style: UIs.textSize11Grey), + ], + ), ); }