opt.: server detail page

This commit is contained in:
lollipopkit
2023-11-01 01:25:09 -06:00
parent a5341b00c1
commit 9000228698
2 changed files with 42 additions and 27 deletions

View File

@@ -1,10 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:countly_flutter/countly_flutter.dart'; import 'package:countly_flutter/countly_flutter.dart';
import 'package:toolbox/core/build_mode.dart'; import 'package:toolbox/core/build_mode.dart';
import 'package:toolbox/core/utils/platform/base.dart'; import 'package:toolbox/core/utils/platform/base.dart';
import 'package:toolbox/data/res/logger.dart';
class Analysis { class Analysis {
static const _url = 'https://countly.xuty.cc'; static const _url = 'https://countly.xuty.cc';
@@ -23,8 +21,6 @@ class Analysis {
.enableCrashReporting(); .enableCrashReporting();
await Countly.initWithConfig(config); await Countly.initWithConfig(config);
await Countly.giveAllConsent(); await Countly.giveAllConsent();
} else {
Loggers.app.info('Countly unsupport: ${Platform.operatingSystem}');
} }
} }

View File

@@ -412,6 +412,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
) )
], ],
), ),
childrenPadding: const EdgeInsets.only(bottom: 11),
leading: const Icon(Icons.device_hub, size: 17), leading: const Icon(Icons.device_hub, size: 17),
initiallyExpanded: children.length <= 7, initiallyExpanded: children.length <= 7,
children: children, children: children,
@@ -420,26 +421,38 @@ class _ServerDetailPageState extends State<ServerDetailPage>
} }
Widget _buildNetSpeedItem(NetSpeed ns, String device) { Widget _buildNetSpeedItem(NetSpeed ns, String device) {
return ListTile( return Padding(
title: Text( padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 17),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
device, device,
style: UIs.textSize11Bold, style: UIs.textSize11Bold,
textScaleFactor: _textFactor, textScaleFactor: _textFactor,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.fade,
textAlign: TextAlign.left,
), ),
subtitle: Text( Text(
'${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}', '${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}',
style: UIs.textSize11Grey, style: UIs.textSize11Grey,
textScaleFactor: _textFactor, textScaleFactor: _textFactor,
)
],
), ),
trailing: SizedBox( SizedBox(
width: 170, width: 170,
child: Text( child: Text(
'${ns.speedOut(device: device)}\n${ns.speedIn(device: device)}', '${ns.speedOut(device: device)}\n${ns.speedIn(device: device)}',
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: UIs.textSize11Grey, style: UIs.textSize11Grey,
), ),
)
],
), ),
); );
} }
@@ -461,9 +474,15 @@ class _ServerDetailPageState extends State<ServerDetailPage>
} }
Widget _buildTemperatureItem(String key, double? val) { Widget _buildTemperatureItem(String key, double? val) {
return ListTile( return Padding(
title: Text(key, style: UIs.textSize13Bold), padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 7),
trailing: Text('${val?.toStringAsFixed(1)}°C'), child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(key, style: UIs.textSize13),
Text('${val?.toStringAsFixed(1)}°C', style: UIs.textSize11Grey),
],
),
); );
} }