mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt.: server detail page
This commit is contained in:
@@ -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}');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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),
|
||||||
device,
|
child: Row(
|
||||||
style: UIs.textSize11Bold,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
textScaleFactor: _textFactor,
|
children: [
|
||||||
maxLines: 1,
|
Column(
|
||||||
overflow: TextOverflow.ellipsis,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
),
|
children: [
|
||||||
subtitle: Text(
|
Text(
|
||||||
'${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}',
|
device,
|
||||||
style: UIs.textSize11Grey,
|
style: UIs.textSize11Bold,
|
||||||
textScaleFactor: _textFactor,
|
textScaleFactor: _textFactor,
|
||||||
),
|
maxLines: 1,
|
||||||
trailing: SizedBox(
|
overflow: TextOverflow.fade,
|
||||||
width: 170,
|
textAlign: TextAlign.left,
|
||||||
child: Text(
|
),
|
||||||
'↑ ${ns.speedOut(device: device)}\n↓ ${ns.speedIn(device: device)}',
|
Text(
|
||||||
textAlign: TextAlign.end,
|
'${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}',
|
||||||
style: UIs.textSize11Grey,
|
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<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),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user