mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-18 14:14:51 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfd31e561c | ||
|
|
5b8468effa | ||
|
|
bd04fd3f1a | ||
|
|
398c49bb99 | ||
|
|
c036b78708 |
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<!-- Badges-->
|
<!-- Badges-->
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://apps.apple.com/app/serverbox-status-tools/id1586449703">
|
<a href="https://apps.apple.com/app/id1586449703">
|
||||||
<img style="height: 37px" src="screenshots/appstore.svg">
|
<img style="height: 37px" src="screenshots/appstore.svg">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/LollipopKit/flutter_server_box/releases/latest">
|
<a href="https://github.com/LollipopKit/flutter_server_box/releases/latest">
|
||||||
|
|||||||
BIN
assets/linux/armbian.png
Normal file
BIN
assets/linux/armbian.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -354,7 +354,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -492,7 +492,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -508,7 +508,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
class PersistentStore<E> {
|
class PersistentStore<E> {
|
||||||
late Box<E> box;
|
late Box<E> box;
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import 'package:toolbox/data/service/app.dart';
|
|||||||
import 'package:toolbox/generated/l10n.dart';
|
import 'package:toolbox/generated/l10n.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
|
|
||||||
final logger = Logger('UPDATE');
|
final _logger = Logger('UPDATE');
|
||||||
|
|
||||||
Future<bool> isFileAvailable(String url) async {
|
Future<bool> isFileAvailable(String url) async {
|
||||||
try {
|
try {
|
||||||
final resp = await Dio().head(url);
|
final resp = await Dio().head(url);
|
||||||
return resp.statusCode == 200;
|
return resp.statusCode == 200;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warning('update file not available: $e');
|
_logger.warning('update file not available: $e');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,11 +40,11 @@ Future<void> doUpdate(BuildContext context, {bool force = false}) async {
|
|||||||
}();
|
}();
|
||||||
|
|
||||||
if (!force && newest <= BuildData.build) {
|
if (!force && newest <= BuildData.build) {
|
||||||
logger.info('Update ignored due to current: ${BuildData.build}, '
|
_logger.info('Update ignored due to current: ${BuildData.build}, '
|
||||||
'update: $newest');
|
'update: $newest');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.info('Update available: $newest');
|
_logger.info('Update available: $newest');
|
||||||
|
|
||||||
if (Platform.isAndroid && !await isFileAvailable(update.android)) {
|
if (Platform.isAndroid && !await isFileAvailable(update.android)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import 'package:toolbox/view/widget/card_dialog.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:toolbox/core/extension/stringx.dart';
|
import 'package:toolbox/core/extension/stringx.dart';
|
||||||
|
|
||||||
void unawaited(Future<void> future) {}
|
|
||||||
|
|
||||||
bool isDarkMode(BuildContext context) =>
|
bool isDarkMode(BuildContext context) =>
|
||||||
Theme.of(context).brightness == Brightness.dark;
|
Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
@@ -110,3 +108,21 @@ Future<bool> shareFiles(BuildContext context, List<String> filePaths) async {
|
|||||||
await Share.shareFiles(filePaths, text: 'ServerBox -> $text');
|
await Share.shareFiles(filePaths, text: 'ServerBox -> $text');
|
||||||
return filePaths.isNotEmpty;
|
return filePaths.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildPopuopMenu(
|
||||||
|
{required List<PopupMenuEntry> items,
|
||||||
|
required Function(dynamic) onSelected}) {
|
||||||
|
return PopupMenuButton(
|
||||||
|
itemBuilder: (_) => items,
|
||||||
|
onSelected: onSelected,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.only(left: 7),
|
||||||
|
child: Icon(
|
||||||
|
Icons.more_vert,
|
||||||
|
size: 21,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ const debianDistList = [
|
|||||||
'ubuntu',
|
'ubuntu',
|
||||||
'linuxmint',
|
'linuxmint',
|
||||||
'elementary',
|
'elementary',
|
||||||
'raspbian'
|
'raspbian',
|
||||||
|
'armbian'
|
||||||
];
|
];
|
||||||
|
|
||||||
const rehlDistList = [
|
const rehlDistList = [
|
||||||
'redhat',
|
'redhat',
|
||||||
'fedora',
|
'fedora',
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
import 'package:toolbox/data/model/server/cpu_status.dart';
|
import 'package:toolbox/data/model/server/cpu_status.dart';
|
||||||
|
|
||||||
class Cpu2Status {
|
class Cpu2Status {
|
||||||
List<CpuStatus> pre;
|
List<CpuStatus> _pre;
|
||||||
List<CpuStatus> now;
|
List<CpuStatus> _now;
|
||||||
String temp;
|
String temp;
|
||||||
Cpu2Status(this.pre, this.now, this.temp);
|
Cpu2Status(this._pre, this._now, this.temp);
|
||||||
|
|
||||||
double usedPercent({int coreIdx = 0}) {
|
double usedPercent({int coreIdx = 0}) {
|
||||||
if (now.length != pre.length) return 0;
|
if (_now.length != _pre.length) return 0;
|
||||||
final idleDelta = now[coreIdx].idle - pre[coreIdx].idle;
|
final idleDelta = _now[coreIdx].idle - _pre[coreIdx].idle;
|
||||||
final totalDelta = now[coreIdx].total - pre[coreIdx].total;
|
final totalDelta = _now[coreIdx].total - _pre[coreIdx].total;
|
||||||
final used = idleDelta / totalDelta;
|
final used = idleDelta / totalDelta;
|
||||||
return used.isNaN ? 0 : 100 - used * 100;
|
return used.isNaN ? 0 : 100 - used * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(List<CpuStatus> newStatus, String newTemp) {
|
void update(List<CpuStatus> newStatus, String newTemp) {
|
||||||
pre = now;
|
_pre = _now;
|
||||||
now = newStatus;
|
_now = newStatus;
|
||||||
temp = newTemp;
|
temp = newTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get coresCount => now.length;
|
int get coresCount => _now.length;
|
||||||
|
|
||||||
int get totalDelta => now[0].total - pre[0].total;
|
int get totalDelta => _now[0].total - _pre[0].total;
|
||||||
|
|
||||||
double get user {
|
double get user {
|
||||||
if (now.length != pre.length) return 0;
|
if (_now.length != _pre.length) return 0;
|
||||||
final delta = now[0].user - pre[0].user;
|
final delta = _now[0].user - _pre[0].user;
|
||||||
final used = delta / totalDelta;
|
final used = delta / totalDelta;
|
||||||
return used.isNaN ? 0 : used * 100;
|
return used.isNaN ? 0 : used * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
double get sys {
|
double get sys {
|
||||||
if (now.length != pre.length) return 0;
|
if (_now.length != _pre.length) return 0;
|
||||||
final delta = now[0].sys - pre[0].sys;
|
final delta = _now[0].sys - _pre[0].sys;
|
||||||
final used = delta / totalDelta;
|
final used = delta / totalDelta;
|
||||||
return used.isNaN ? 0 : used * 100;
|
return used.isNaN ? 0 : used * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
double get nice {
|
double get nice {
|
||||||
if (now.length != pre.length) return 0;
|
if (_now.length != _pre.length) return 0;
|
||||||
final delta = now[0].nice - pre[0].nice;
|
final delta = _now[0].nice - _pre[0].nice;
|
||||||
final used = delta / totalDelta;
|
final used = delta / totalDelta;
|
||||||
return used.isNaN ? 0 : used * 100;
|
return used.isNaN ? 0 : used * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
double get iowait {
|
double get iowait {
|
||||||
if (now.length != pre.length) return 0;
|
if (_now.length != _pre.length) return 0;
|
||||||
final delta = now[0].iowait - pre[0].iowait;
|
final delta = _now[0].iowait - _pre[0].iowait;
|
||||||
final used = delta / totalDelta;
|
final used = delta / totalDelta;
|
||||||
return used.isNaN ? 0 : used * 100;
|
return used.isNaN ? 0 : used * 100;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
class LinuxIcons {
|
|
||||||
List<String> db;
|
|
||||||
|
|
||||||
LinuxIcons(this.db);
|
|
||||||
|
|
||||||
String? search(String sysVer) {
|
|
||||||
for (var item in db) {
|
|
||||||
if (sysVer.toLowerCase().contains(item)) {
|
|
||||||
return 'assets/linux/$item.png';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,46 +9,46 @@ class NetSpeedPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class NetSpeed {
|
class NetSpeed {
|
||||||
List<NetSpeedPart> old;
|
List<NetSpeedPart> _old;
|
||||||
List<NetSpeedPart> now;
|
List<NetSpeedPart> _now;
|
||||||
NetSpeed(this.old, this.now);
|
NetSpeed(this._old, this._now);
|
||||||
|
|
||||||
List<String> get devices {
|
List<String> get devices {
|
||||||
final devices = <String>[];
|
final devices = <String>[];
|
||||||
for (var item in now) {
|
for (var item in _now) {
|
||||||
devices.add(item.device);
|
devices.add(item.device);
|
||||||
}
|
}
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(List<NetSpeedPart> newOne) {
|
void update(List<NetSpeedPart> newOne) {
|
||||||
old = now;
|
_old = _now;
|
||||||
now = newOne;
|
_now = newOne;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get timeDiff => now[0].time - old[0].time;
|
int get timeDiff => _now[0].time - _old[0].time;
|
||||||
|
|
||||||
String speedIn({String? device}) {
|
String speedIn({String? device}) {
|
||||||
if (old[0].device == '' || now[0].device == '') return '0kb/s';
|
if (_old[0].device == '' || _now[0].device == '') return '0kb/s';
|
||||||
final idx = deviceIdx(device);
|
final idx = deviceIdx(device);
|
||||||
final speedInBytesPerSecond =
|
final speedInBytesPerSecond =
|
||||||
(now[idx].bytesIn - old[idx].bytesIn) / timeDiff;
|
(_now[idx].bytesIn - _old[idx].bytesIn) / timeDiff;
|
||||||
return buildStandardOutput(speedInBytesPerSecond);
|
return buildStandardOutput(speedInBytesPerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
String speedOut({String? device}) {
|
String speedOut({String? device}) {
|
||||||
if (old[0].device == '' || now[0].device == '') return '0kb/s';
|
if (_old[0].device == '' || _now[0].device == '') return '0kb/s';
|
||||||
final idx = deviceIdx(device);
|
final idx = deviceIdx(device);
|
||||||
final speedOutBytesPerSecond =
|
final speedOutBytesPerSecond =
|
||||||
(now[idx].bytesOut - old[idx].bytesOut) / timeDiff;
|
(_now[idx].bytesOut - _old[idx].bytesOut) / timeDiff;
|
||||||
return buildStandardOutput(speedOutBytesPerSecond);
|
return buildStandardOutput(speedOutBytesPerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
int deviceIdx(String? device) {
|
int deviceIdx(String? device) {
|
||||||
if (device != null) {
|
if (device != null) {
|
||||||
for (var item in now) {
|
for (var item in _now) {
|
||||||
if (item.device == device) {
|
if (item.device == device) {
|
||||||
return now.indexOf(item);
|
return _now.indexOf(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
part 'private_key_info.g.dart';
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
||||||
///
|
///
|
||||||
|
@HiveType(typeId: 1)
|
||||||
class PrivateKeyInfo {
|
class PrivateKeyInfo {
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
@@ -12,8 +17,11 @@ class PrivateKeyInfo {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
late String id;
|
late String id;
|
||||||
|
@HiveField(1)
|
||||||
late String privateKey;
|
late String privateKey;
|
||||||
|
@HiveField(2)
|
||||||
late String password;
|
late String password;
|
||||||
|
|
||||||
PrivateKeyInfo(
|
PrivateKeyInfo(
|
||||||
|
|||||||
47
lib/data/model/server/private_key_info.g.dart
Normal file
47
lib/data/model/server/private_key_info.g.dart
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'private_key_info.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class PrivateKeyInfoAdapter extends TypeAdapter<PrivateKeyInfo> {
|
||||||
|
@override
|
||||||
|
final int typeId = 1;
|
||||||
|
|
||||||
|
@override
|
||||||
|
PrivateKeyInfo read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return PrivateKeyInfo(
|
||||||
|
fields[0] as String,
|
||||||
|
fields[1] as String,
|
||||||
|
fields[2] as String,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, PrivateKeyInfo obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(3)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.privateKey)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.password);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is PrivateKeyInfoAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
part 'server_private_info.g.dart';
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
||||||
///
|
///
|
||||||
|
@HiveType(typeId: 3)
|
||||||
class ServerPrivateInfo {
|
class ServerPrivateInfo {
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
@@ -13,13 +18,21 @@ class ServerPrivateInfo {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
late String name;
|
late String name;
|
||||||
|
@HiveField(1)
|
||||||
late String ip;
|
late String ip;
|
||||||
|
@HiveField(2)
|
||||||
late int port;
|
late int port;
|
||||||
|
@HiveField(3)
|
||||||
late String user;
|
late String user;
|
||||||
|
@HiveField(4)
|
||||||
late String pwd;
|
late String pwd;
|
||||||
|
@HiveField(5)
|
||||||
String? pubKeyId;
|
String? pubKeyId;
|
||||||
|
|
||||||
|
String get id => '$user@$ip:$port';
|
||||||
|
|
||||||
ServerPrivateInfo(
|
ServerPrivateInfo(
|
||||||
{required this.name,
|
{required this.name,
|
||||||
required this.ip,
|
required this.ip,
|
||||||
|
|||||||
56
lib/data/model/server/server_private_info.g.dart
Normal file
56
lib/data/model/server/server_private_info.g.dart
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'server_private_info.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
|
||||||
|
@override
|
||||||
|
final int typeId = 3;
|
||||||
|
|
||||||
|
@override
|
||||||
|
ServerPrivateInfo read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return ServerPrivateInfo(
|
||||||
|
name: fields[0] as String,
|
||||||
|
ip: fields[1] as String,
|
||||||
|
port: fields[2] as int,
|
||||||
|
user: fields[3] as String,
|
||||||
|
pwd: fields[4] as String,
|
||||||
|
pubKeyId: fields[5] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, ServerPrivateInfo obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(6)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.name)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.ip)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.port)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.user)
|
||||||
|
..writeByte(4)
|
||||||
|
..write(obj.pwd)
|
||||||
|
..writeByte(5)
|
||||||
|
..write(obj.pubKeyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ServerPrivateInfoAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
part 'snippet.g.dart';
|
||||||
|
|
||||||
|
@HiveType(typeId: 2)
|
||||||
class Snippet {
|
class Snippet {
|
||||||
|
@HiveField(0)
|
||||||
late String name;
|
late String name;
|
||||||
|
@HiveField(1)
|
||||||
late String script;
|
late String script;
|
||||||
Snippet(this.name, this.script);
|
Snippet(this.name, this.script);
|
||||||
|
|
||||||
|
|||||||
44
lib/data/model/server/snippet.g.dart
Normal file
44
lib/data/model/server/snippet.g.dart
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'snippet.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class SnippetAdapter extends TypeAdapter<Snippet> {
|
||||||
|
@override
|
||||||
|
final int typeId = 2;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Snippet read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return Snippet(
|
||||||
|
fields[0] as String,
|
||||||
|
fields[1] as String,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, Snippet obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(2)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.name)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.script);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SnippetAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ class PrivateKeyProvider extends BusyProvider {
|
|||||||
void updateInfo(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
|
void updateInfo(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
|
||||||
final idx = _infos.indexWhere((e) => e.id == old.id);
|
final idx = _infos.indexWhere((e) => e.id == old.id);
|
||||||
_infos[idx] = newInfo;
|
_infos[idx] = newInfo;
|
||||||
locator<PrivateKeyStore>().update(old, newInfo);
|
locator<PrivateKeyStore>().put(newInfo);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SnippetProvider extends BusyProvider {
|
|||||||
void update(Snippet old, Snippet newOne) {
|
void update(Snippet old, Snippet newOne) {
|
||||||
if (!have(old)) return;
|
if (!have(old)) return;
|
||||||
_snippets[index(old)] = newOne;
|
_snippets[index(old)] = newOne;
|
||||||
locator<SnippetStore>().update(old, newOne);
|
locator<SnippetStore>().put(newOne);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 154;
|
static const int build = 159;
|
||||||
static const String engine =
|
static const String engine =
|
||||||
"Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision eb6d86ee27 (2 weeks ago) • 2022-10-04 22:31:45 -0700\nEngine • revision c08d7d5efc\nTools • Dart 2.18.2 • DevTools 2.15.0\n";
|
"Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision eb6d86ee27 (5 weeks ago) • 2022-10-04 22:31:45 -0700\nEngine • revision c08d7d5efc\nTools • Dart 2.18.2 • DevTools 2.15.0\n";
|
||||||
static const String buildAt = "2022-10-21 17:29:42.809139";
|
static const String buildAt = "2022-11-07 19:55:21.553007";
|
||||||
static const int modifications = 9;
|
static const int modifications = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'package:toolbox/data/model/server/linux_icon.dart';
|
|
||||||
|
|
||||||
final linuxIcons = LinuxIcons([
|
final linuxIcons = LinuxIcons([
|
||||||
'ubuntu',
|
'ubuntu',
|
||||||
'arch',
|
'arch',
|
||||||
@@ -8,5 +6,21 @@ final linuxIcons = LinuxIcons([
|
|||||||
'fedora',
|
'fedora',
|
||||||
'opensuse',
|
'opensuse',
|
||||||
'kali',
|
'kali',
|
||||||
'wrt'
|
'wrt',
|
||||||
|
'armbian'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
class LinuxIcons {
|
||||||
|
List<String> db;
|
||||||
|
|
||||||
|
LinuxIcons(this.db);
|
||||||
|
|
||||||
|
String? search(String sysVer) {
|
||||||
|
for (var item in db) {
|
||||||
|
if (sysVer.toLowerCase().contains(item)) {
|
||||||
|
return 'assets/linux/$item.png';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,38 +1,28 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
import 'package:toolbox/data/model/server/private_key_info.dart';
|
import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||||
|
|
||||||
class PrivateKeyStore extends PersistentStore {
|
class PrivateKeyStore extends PersistentStore {
|
||||||
void put(PrivateKeyInfo info) {
|
void put(PrivateKeyInfo info) {
|
||||||
final ss = fetch();
|
box.put(info.id, info);
|
||||||
if (!have(info)) ss.add(info);
|
|
||||||
box.put('key', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PrivateKeyInfo> fetch() {
|
List<PrivateKeyInfo> fetch() {
|
||||||
return getPrivateKeyInfoList(
|
final keys = box.keys;
|
||||||
json.decode(box.get('key', defaultValue: '[]')!));
|
final ps = <PrivateKeyInfo>[];
|
||||||
|
for (final key in keys) {
|
||||||
|
final s = box.get(key);
|
||||||
|
if (s != null) {
|
||||||
|
ps.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivateKeyInfo get(String id) {
|
PrivateKeyInfo get(String id) {
|
||||||
final ss = fetch();
|
return box.get(id);
|
||||||
return ss.firstWhere((e) => e.id == id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete(PrivateKeyInfo s) {
|
void delete(PrivateKeyInfo s) {
|
||||||
final ss = fetch();
|
box.delete(s.id);
|
||||||
ss.removeAt(index(s));
|
|
||||||
box.put('key', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
|
|
||||||
final ss = fetch();
|
|
||||||
ss[index(old)] = newInfo;
|
|
||||||
box.put('key', json.encode(ss));
|
|
||||||
}
|
|
||||||
|
|
||||||
int index(PrivateKeyInfo s) => fetch().indexWhere((e) => e.id == s.id);
|
|
||||||
|
|
||||||
bool have(PrivateKeyInfo s) => index(s) != -1;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,33 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||||
|
|
||||||
class ServerStore extends PersistentStore {
|
class ServerStore extends PersistentStore {
|
||||||
void put(ServerPrivateInfo info) {
|
void put(ServerPrivateInfo info) {
|
||||||
final ss = fetch();
|
box.put(info.id, info);
|
||||||
if (!have(info)) ss.add(info);
|
|
||||||
box.put('servers', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ServerPrivateInfo> fetch() {
|
List<ServerPrivateInfo> fetch() {
|
||||||
return getServerInfoList(
|
final ids = box.keys;
|
||||||
json.decode(box.get('servers', defaultValue: '[]')!));
|
final List<ServerPrivateInfo> ss = [];
|
||||||
|
for (final id in ids) {
|
||||||
|
final s = box.get(id);
|
||||||
|
if (s != null) {
|
||||||
|
ss.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete(ServerPrivateInfo s) {
|
void delete(ServerPrivateInfo s) {
|
||||||
final ss = fetch();
|
box.delete(s.id);
|
||||||
ss.removeAt(index(s));
|
|
||||||
box.put('servers', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
|
void update(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
|
||||||
final ss = fetch();
|
if (!have(old)) {
|
||||||
final idx = index(old);
|
throw Exception('Old ServerPrivateInfo not found');
|
||||||
if (idx < 0) {
|
|
||||||
throw RangeError.index(idx, ss);
|
|
||||||
}
|
}
|
||||||
ss[idx] = newInfo;
|
put(newInfo);
|
||||||
box.put('servers', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int index(ServerPrivateInfo s) => fetch()
|
bool have(ServerPrivateInfo s) => box.get(s.id) != null;
|
||||||
.indexWhere((e) => e.ip == s.ip && e.port == s.port && e.user == e.user);
|
|
||||||
|
|
||||||
bool have(ServerPrivateInfo s) => index(s) != -1;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,4 +7,7 @@ class SettingStore extends PersistentStore {
|
|||||||
StoreProperty<int> get serverStatusUpdateInterval =>
|
StoreProperty<int> get serverStatusUpdateInterval =>
|
||||||
property('serverStatusUpdateInterval', defaultValue: 2);
|
property('serverStatusUpdateInterval', defaultValue: 2);
|
||||||
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
||||||
|
|
||||||
|
StoreProperty<int> get storeVersion =>
|
||||||
|
property('storeVersion', defaultValue: 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,24 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
import 'package:toolbox/data/model/server/snippet.dart';
|
import 'package:toolbox/data/model/server/snippet.dart';
|
||||||
|
|
||||||
class SnippetStore extends PersistentStore {
|
class SnippetStore extends PersistentStore {
|
||||||
void put(Snippet snippet) {
|
void put(Snippet snippet) {
|
||||||
final ss = fetch();
|
box.put(snippet.name, snippet);
|
||||||
if (!have(snippet)) ss.add(snippet);
|
|
||||||
box.put('snippet', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Snippet> fetch() {
|
List<Snippet> fetch() {
|
||||||
return getSnippetList(json.decode(box.get('snippet', defaultValue: '[]')!));
|
final keys = box.keys;
|
||||||
|
final ss = <Snippet>[];
|
||||||
|
for (final key in keys) {
|
||||||
|
final s = box.get(key);
|
||||||
|
if (s != null) {
|
||||||
|
ss.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete(Snippet s) {
|
void delete(Snippet s) {
|
||||||
final ss = fetch();
|
box.delete(s.name);
|
||||||
ss.removeAt(index(s));
|
|
||||||
box.put('snippet', json.encode(ss));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(Snippet old, Snippet newInfo) {
|
|
||||||
final ss = fetch();
|
|
||||||
ss[index(old)] = newInfo;
|
|
||||||
box.put('snippet', json.encode(ss));
|
|
||||||
}
|
|
||||||
|
|
||||||
int index(Snippet s) => fetch().indexWhere((e) => e.name == s.name);
|
|
||||||
|
|
||||||
bool have(Snippet s) => index(s) != -1;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"import": MessageLookupByLibrary.simpleMessage("Import"),
|
"import": MessageLookupByLibrary.simpleMessage("Import"),
|
||||||
"importAndExport":
|
"importAndExport":
|
||||||
MessageLookupByLibrary.simpleMessage("Import and Export"),
|
MessageLookupByLibrary.simpleMessage("Import and Export"),
|
||||||
|
"inputDomainHere":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Input Domain here"),
|
||||||
"install": MessageLookupByLibrary.simpleMessage("install"),
|
"install": MessageLookupByLibrary.simpleMessage("install"),
|
||||||
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
||||||
"Please https://docs.docker.com/engine/install docker first."),
|
"Please https://docs.docker.com/engine/install docker first."),
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"httpFailedWithCode": m5,
|
"httpFailedWithCode": m5,
|
||||||
"import": MessageLookupByLibrary.simpleMessage("导入"),
|
"import": MessageLookupByLibrary.simpleMessage("导入"),
|
||||||
"importAndExport": MessageLookupByLibrary.simpleMessage("导入或导出"),
|
"importAndExport": MessageLookupByLibrary.simpleMessage("导入或导出"),
|
||||||
|
"inputDomainHere": MessageLookupByLibrary.simpleMessage("在这里输入域名"),
|
||||||
"install": MessageLookupByLibrary.simpleMessage("安装"),
|
"install": MessageLookupByLibrary.simpleMessage("安装"),
|
||||||
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
||||||
"请先 https://docs.docker.com/engine/install docker"),
|
"请先 https://docs.docker.com/engine/install docker"),
|
||||||
|
|||||||
@@ -1340,6 +1340,16 @@ class S {
|
|||||||
args: [],
|
args: [],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// `Input Domain here`
|
||||||
|
String get inputDomainHere {
|
||||||
|
return Intl.message(
|
||||||
|
'Input Domain here',
|
||||||
|
name: 'inputDomainHere',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
||||||
|
|||||||
@@ -127,5 +127,6 @@
|
|||||||
"clickSee": "Click here",
|
"clickSee": "Click here",
|
||||||
"feedback": "Feedback",
|
"feedback": "Feedback",
|
||||||
"feedbackOnGithub": "If you have any questions, please feedback on Github.",
|
"feedbackOnGithub": "If you have any questions, please feedback on Github.",
|
||||||
"update": "Update"
|
"update": "Update",
|
||||||
|
"inputDomainHere": "Input Domain here"
|
||||||
}
|
}
|
||||||
@@ -127,5 +127,6 @@
|
|||||||
"clickSee": "点击查看",
|
"clickSee": "点击查看",
|
||||||
"feedback": "反馈",
|
"feedback": "反馈",
|
||||||
"feedbackOnGithub": "如果你有任何问题,请在GitHub反馈",
|
"feedbackOnGithub": "如果你有任何问题,请在GitHub反馈",
|
||||||
"update": "更新"
|
"update": "更新",
|
||||||
|
"inputDomainHere": "在这里输入域名"
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,10 @@ import 'package:logging/logging.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:toolbox/app.dart';
|
import 'package:toolbox/app.dart';
|
||||||
import 'package:toolbox/core/analysis.dart';
|
import 'package:toolbox/core/analysis.dart';
|
||||||
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
|
import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||||
|
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||||
|
import 'package:toolbox/data/model/server/snippet.dart';
|
||||||
import 'package:toolbox/data/provider/app.dart';
|
import 'package:toolbox/data/provider/app.dart';
|
||||||
import 'package:toolbox/data/provider/apt.dart';
|
import 'package:toolbox/data/provider/apt.dart';
|
||||||
import 'package:toolbox/data/provider/debug.dart';
|
import 'package:toolbox/data/provider/debug.dart';
|
||||||
@@ -14,11 +18,17 @@ import 'package:toolbox/data/provider/private_key.dart';
|
|||||||
import 'package:toolbox/data/provider/server.dart';
|
import 'package:toolbox/data/provider/server.dart';
|
||||||
import 'package:toolbox/data/provider/sftp_download.dart';
|
import 'package:toolbox/data/provider/sftp_download.dart';
|
||||||
import 'package:toolbox/data/provider/snippet.dart';
|
import 'package:toolbox/data/provider/snippet.dart';
|
||||||
|
import 'package:toolbox/data/store/private_key.dart';
|
||||||
|
import 'package:toolbox/data/store/server.dart';
|
||||||
|
import 'package:toolbox/data/store/setting.dart';
|
||||||
|
import 'package:toolbox/data/store/snippet.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
|
|
||||||
Future<void> initApp() async {
|
Future<void> initApp() async {
|
||||||
await Hive.initFlutter();
|
await initHive();
|
||||||
await setupLocator();
|
await setupLocator();
|
||||||
|
await upgradeStore();
|
||||||
|
|
||||||
locator<SnippetProvider>().loadData();
|
locator<SnippetProvider>().loadData();
|
||||||
locator<PrivateKeyProvider>().loadData();
|
locator<PrivateKeyProvider>().loadData();
|
||||||
|
|
||||||
@@ -30,6 +40,27 @@ Future<void> initApp() async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> initHive() async {
|
||||||
|
await Hive.initFlutter();
|
||||||
|
Hive.registerAdapter(SnippetAdapter());
|
||||||
|
Hive.registerAdapter(PrivateKeyInfoAdapter());
|
||||||
|
Hive.registerAdapter(ServerPrivateInfoAdapter());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> upgradeStore() async {
|
||||||
|
final setting = locator<SettingStore>();
|
||||||
|
final version = setting.storeVersion.fetch();
|
||||||
|
if (version == 0) {
|
||||||
|
final snippet = locator<SnippetStore>();
|
||||||
|
final key = locator<PrivateKeyStore>();
|
||||||
|
final spi = locator<ServerStore>();
|
||||||
|
for (final s in <PersistentStore>[snippet, key, spi]) {
|
||||||
|
await s.box.deleteAll(s.box.keys);
|
||||||
|
}
|
||||||
|
setting.storeVersion.put(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void runInZone(dynamic Function() body) {
|
void runInZone(dynamic Function() body) {
|
||||||
final zoneSpec = ZoneSpecification(
|
final zoneSpec = ZoneSpecification(
|
||||||
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
|
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:clipboard/clipboard.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:toolbox/core/utils.dart';
|
import 'package:toolbox/core/utils.dart';
|
||||||
import 'package:toolbox/data/res/color.dart';
|
import 'package:toolbox/data/res/color.dart';
|
||||||
import 'package:toolbox/generated/l10n.dart';
|
import 'package:toolbox/generated/l10n.dart';
|
||||||
@@ -44,22 +44,20 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: GestureDetector(
|
body: SingleChildScrollView(
|
||||||
child: SingleChildScrollView(
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
controller: ScrollController(),
|
||||||
controller: ScrollController(),
|
child: Column(children: [
|
||||||
child: Column(children: [
|
const SizedBox(height: 13),
|
||||||
const SizedBox(height: 13),
|
_buildInputTop(),
|
||||||
_buildInputTop(),
|
_buildTypeOption(),
|
||||||
_buildTypeOption(),
|
_buildResult(),
|
||||||
_buildResult(),
|
])),
|
||||||
])),
|
|
||||||
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
try {
|
try {
|
||||||
_textEditingControllerResult.text = doConvert();
|
_textEditingControllerResult.text = doConvert();
|
||||||
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showSnackBar(context, Text('Error: \n$e'));
|
showSnackBar(context, Text('Error: \n$e'));
|
||||||
}
|
}
|
||||||
@@ -89,8 +87,7 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
Widget _buildInputTop() {
|
Widget _buildInputTop() {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: _media.size.height * 0.33,
|
height: _media.size.height * 0.33,
|
||||||
child: buildInput(context, _textEditingController,
|
child: buildInput(context, _textEditingController),
|
||||||
onSubmitted: (_) => _textEditingControllerResult.text = doConvert()),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,10 +120,12 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
||||||
child: Icon(Icons.copy, semanticLabel: s.copy),
|
child: Icon(Icons.copy, semanticLabel: s.copy),
|
||||||
onPressed: () => FlutterClipboard.copy(
|
onPressed: () => Clipboard.setData(
|
||||||
_textEditingControllerResult.text == ''
|
ClipboardData(
|
||||||
? ' '
|
text: _textEditingControllerResult.text == ''
|
||||||
: _textEditingControllerResult.text),
|
? ' '
|
||||||
|
: _textEditingControllerResult.text),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -157,8 +156,8 @@ class _ConvertPageState extends State<ConvertPage>
|
|||||||
title: Text(
|
title: Text(
|
||||||
e,
|
e,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color: _theme.textTheme.bodyText2!.color!.withAlpha(177),
|
||||||
_theme.textTheme.bodyText2!.color!.withAlpha(177)),
|
),
|
||||||
),
|
),
|
||||||
trailing: _buildRadio(typeOption.indexOf(e)),
|
trailing: _buildRadio(typeOption.indexOf(e)),
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:toolbox/core/utils.dart';
|
import 'package:toolbox/core/utils.dart';
|
||||||
@@ -152,49 +151,31 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
|
|
||||||
Widget _buildMoreBtn(bool running, String containerId) {
|
Widget _buildMoreBtn(bool running, String containerId) {
|
||||||
final item = running ? DockerMenuItems.stop : DockerMenuItems.start;
|
final item = running ? DockerMenuItems.stop : DockerMenuItems.start;
|
||||||
return DropdownButtonHideUnderline(
|
return buildPopuopMenu(
|
||||||
child: DropdownButton2(
|
items: [
|
||||||
customButton: const Padding(
|
PopupMenuItem<DropdownBtnItem>(
|
||||||
padding: EdgeInsets.only(left: 7),
|
value: item,
|
||||||
child: Icon(
|
child: item.build,
|
||||||
Icons.more_vert,
|
|
||||||
size: 17,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
customItemsHeight: 8,
|
PopupMenuItem<DropdownBtnItem>(
|
||||||
items: [
|
value: DockerMenuItems.rm,
|
||||||
DropdownMenuItem<DropdownBtnItem>(
|
child: DockerMenuItems.rm.build,
|
||||||
value: item,
|
|
||||||
child: item.build,
|
|
||||||
),
|
|
||||||
DropdownMenuItem<DropdownBtnItem>(
|
|
||||||
value: DockerMenuItems.rm,
|
|
||||||
child: DockerMenuItems.rm.build,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
onChanged: (value) {
|
|
||||||
final item = value as DropdownBtnItem;
|
|
||||||
switch (item) {
|
|
||||||
case DockerMenuItems.rm:
|
|
||||||
_docker.delete(containerId);
|
|
||||||
break;
|
|
||||||
case DockerMenuItems.start:
|
|
||||||
_docker.start(containerId);
|
|
||||||
break;
|
|
||||||
case DockerMenuItems.stop:
|
|
||||||
_docker.stop(containerId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemHeight: 37,
|
|
||||||
itemPadding: const EdgeInsets.only(left: 17, right: 17),
|
|
||||||
dropdownWidth: 133,
|
|
||||||
dropdownDecoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(7),
|
|
||||||
),
|
),
|
||||||
dropdownElevation: 8,
|
],
|
||||||
offset: const Offset(0, 8),
|
onSelected: (value) {
|
||||||
),
|
final item = value as DropdownBtnItem;
|
||||||
|
switch (item) {
|
||||||
|
case DockerMenuItems.rm:
|
||||||
|
_docker.delete(containerId);
|
||||||
|
break;
|
||||||
|
case DockerMenuItems.start:
|
||||||
|
_docker.start(containerId);
|
||||||
|
break;
|
||||||
|
case DockerMenuItems.stop:
|
||||||
|
_docker.stop(containerId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:after_layout/after_layout.dart';
|
import 'package:after_layout/after_layout.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_advanced_drawer/flutter_advanced_drawer.dart';
|
|
||||||
import 'package:get_it/get_it.dart';
|
import 'package:get_it/get_it.dart';
|
||||||
import 'package:toolbox/core/analysis.dart';
|
import 'package:toolbox/core/analysis.dart';
|
||||||
import 'package:toolbox/core/build_mode.dart';
|
import 'package:toolbox/core/build_mode.dart';
|
||||||
@@ -46,7 +45,6 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
WidgetsBindingObserver {
|
WidgetsBindingObserver {
|
||||||
late final ServerProvider _serverProvider;
|
late final ServerProvider _serverProvider;
|
||||||
late final PageController _pageController;
|
late final PageController _pageController;
|
||||||
late final AdvancedDrawerController _advancedDrawerController;
|
|
||||||
late int _selectIndex;
|
late int _selectIndex;
|
||||||
late double _width;
|
late double _width;
|
||||||
late S s;
|
late S s;
|
||||||
@@ -58,7 +56,6 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
_selectIndex = locator<SettingStore>().launchPage.fetch()!;
|
_selectIndex = locator<SettingStore>().launchPage.fetch()!;
|
||||||
_pageController = PageController(initialPage: _selectIndex);
|
_pageController = PageController(initialPage: _selectIndex);
|
||||||
_advancedDrawerController = AdvancedDrawerController();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -92,8 +89,9 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
child: _buildMain(context),
|
child: _buildMain(context),
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
if (_advancedDrawerController.value.visible) {
|
final scaffold = Scaffold.of(context);
|
||||||
_advancedDrawerController.hideDrawer();
|
if (scaffold.isDrawerOpen) {
|
||||||
|
scaffold.closeDrawer();
|
||||||
return Future.value(false);
|
return Future.value(false);
|
||||||
}
|
}
|
||||||
return Future.value(true);
|
return Future.value(true);
|
||||||
@@ -101,63 +99,31 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMain(BuildContext context) {
|
Widget _buildMain(BuildContext context) {
|
||||||
return AdvancedDrawer(
|
return Scaffold(
|
||||||
controller: _advancedDrawerController,
|
drawer: _buildDrawer(),
|
||||||
animationCurve: Curves.easeInOut,
|
appBar: AppBar(
|
||||||
animationDuration: const Duration(milliseconds: 300),
|
title: Text(tabTitleName(context, _selectIndex), style: size18),
|
||||||
animateChildDecoration: true,
|
actions: [
|
||||||
rtlOpening: false,
|
IconButton(
|
||||||
childDecoration: const BoxDecoration(
|
icon: const Icon(Icons.developer_mode, size: 23),
|
||||||
// NOTICE: Uncomment if you want to add shadow behind the page.
|
tooltip: s.debug,
|
||||||
// Keep in mind that it may cause animation jerks.
|
onPressed: () =>
|
||||||
// boxShadow: <BoxShadow>[
|
AppRoute(const DebugPage(), 'Debug Page').go(context),
|
||||||
// BoxShadow(
|
|
||||||
// color: Colors.black12,
|
|
||||||
// blurRadius: 0.0,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
||||||
),
|
|
||||||
drawer: _buildDrawer(),
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(tabTitleName(context, _selectIndex), style: size18),
|
|
||||||
actions: [
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.developer_mode, size: 23),
|
|
||||||
tooltip: s.debug,
|
|
||||||
onPressed: () =>
|
|
||||||
AppRoute(const DebugPage(), 'Debug Page').go(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
leading: IconButton(
|
|
||||||
onPressed: () => _advancedDrawerController.showDrawer(),
|
|
||||||
icon: ValueListenableBuilder<AdvancedDrawerValue>(
|
|
||||||
valueListenable: _advancedDrawerController,
|
|
||||||
builder: (_, value, __) {
|
|
||||||
return AnimatedSwitcher(
|
|
||||||
duration: const Duration(milliseconds: 250),
|
|
||||||
child: Icon(
|
|
||||||
value.visible ? Icons.clear : Icons.menu,
|
|
||||||
key: ValueKey<bool>(value.visible),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
body: PageView(
|
],
|
||||||
physics: const ClampingScrollPhysics(),
|
),
|
||||||
controller: _pageController,
|
body: PageView(
|
||||||
onPageChanged: (i) {
|
physics: const ClampingScrollPhysics(),
|
||||||
FocusScope.of(context).unfocus();
|
controller: _pageController,
|
||||||
_selectIndex = i;
|
onPageChanged: (i) {
|
||||||
setState(() {});
|
FocusScope.of(context).unfocus();
|
||||||
},
|
_selectIndex = i;
|
||||||
children: const [ServerPage(), ConvertPage(), PingPage()],
|
setState(() {});
|
||||||
),
|
},
|
||||||
bottomNavigationBar: _buildBottom(context),
|
children: const [ServerPage(), ConvertPage(), PingPage()],
|
||||||
));
|
),
|
||||||
|
bottomNavigationBar: _buildBottom(context),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildItem(int idx, NavigationItem item, bool isSelected) {
|
Widget _buildItem(int idx, NavigationItem item, bool isSelected) {
|
||||||
@@ -208,7 +174,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDrawer() {
|
Widget _buildDrawer() {
|
||||||
return SafeArea(
|
return Drawer(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ import 'package:toolbox/locator.dart';
|
|||||||
import 'package:toolbox/view/widget/input_field.dart';
|
import 'package:toolbox/view/widget/input_field.dart';
|
||||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||||
|
|
||||||
|
final doaminReg =
|
||||||
|
RegExp(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$');
|
||||||
|
final ipv4Reg =
|
||||||
|
RegExp(r'^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$');
|
||||||
|
final ipv6Reg = RegExp(r'^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$');
|
||||||
|
|
||||||
class PingPage extends StatefulWidget {
|
class PingPage extends StatefulWidget {
|
||||||
const PingPage({Key? key}) : super(key: key);
|
const PingPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@@ -44,27 +50,35 @@ class _PingPageState extends State<PingPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: GestureDetector(
|
body: SingleChildScrollView(
|
||||||
child: SingleChildScrollView(
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
child: Column(children: [
|
||||||
child: Column(children: [
|
const SizedBox(height: 13),
|
||||||
const SizedBox(height: 13),
|
buildInput(context, _textEditingController,
|
||||||
buildInput(context, _textEditingController,
|
hint: s.inputDomainHere,
|
||||||
maxLines: 1, onSubmitted: (_) => doPing()),
|
maxLines: 1,
|
||||||
_buildControl(),
|
onSubmitted: (_) => doPing()),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: _media.size.height * 0.6,
|
height: _media.size.height * 0.6,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
controller: ScrollController(),
|
controller: ScrollController(),
|
||||||
itemCount: _results.length,
|
itemCount: _results.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final result = _results[index];
|
final result = _results[index];
|
||||||
return _buildResultItem(result);
|
return _buildResultItem(result);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
])),
|
])),
|
||||||
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
|
floatingActionButton: FloatingActionButton(
|
||||||
|
child: const Icon(Icons.play_arrow),
|
||||||
|
onPressed: () {
|
||||||
|
try {
|
||||||
|
doPing();
|
||||||
|
} catch (e) {
|
||||||
|
showSnackBar(context, Text('Error: \n$e'));
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -112,67 +126,25 @@ class _PingPageState extends State<PingPage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Future.wait(_serverProvider.servers.map((e) async {
|
if (!doaminReg.hasMatch(target) &&
|
||||||
if (e.client == null) {
|
!ipv4Reg.hasMatch(target) &&
|
||||||
return;
|
!ipv6Reg.hasMatch(target)) {
|
||||||
}
|
showSnackBar(context, Text(s.pingInputIP));
|
||||||
final result = await e.client!.run('ping -c 3 $target').string;
|
return;
|
||||||
_results.add(PingResult.parse(e.info.name, result));
|
}
|
||||||
setState(() {});
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildControl() {
|
try {
|
||||||
return SizedBox(
|
await Future.wait(_serverProvider.servers.map((e) async {
|
||||||
height: 57,
|
if (e.client == null) {
|
||||||
child: RoundRectCard(
|
return;
|
||||||
InkWell(
|
}
|
||||||
onTap: () => FocusScope.of(context).unfocus(),
|
final result = await e.client!.run('ping -c 3 $target').string;
|
||||||
child: Row(
|
_results.add(PingResult.parse(e.info.name, result));
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
setState(() {});
|
||||||
children: [
|
}));
|
||||||
TextButton(
|
} catch (e) {
|
||||||
style: ButtonStyle(
|
showSnackBar(context, Text(e.toString()));
|
||||||
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
}
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.delete),
|
|
||||||
const SizedBox(
|
|
||||||
width: 7,
|
|
||||||
),
|
|
||||||
Text(s.clear)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
_results.clear();
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
foregroundColor: MaterialStateProperty.all(primaryColor)),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.play_arrow),
|
|
||||||
const SizedBox(
|
|
||||||
width: 7,
|
|
||||||
),
|
|
||||||
Text(s.start)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
try {
|
|
||||||
doPing();
|
|
||||||
} catch (e) {
|
|
||||||
showSnackBar(context, Text('Error: \n$e'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
Widget _buildLinuxIcon(String sysVer) {
|
Widget _buildLinuxIcon(String sysVer) {
|
||||||
final iconPath = linuxIcons.search(sysVer);
|
final iconPath = linuxIcons.search(sysVer);
|
||||||
if (iconPath == null) return const SizedBox();
|
if (iconPath == null) return const SizedBox();
|
||||||
return SizedBox(
|
return ConstrainedBox(
|
||||||
height: _media.size.height * 0.15, child: Image.asset(iconPath));
|
constraints: BoxConstraints(
|
||||||
|
maxHeight: _media.size.height * 0.12,
|
||||||
|
maxWidth: _media.size.width * 0.6),
|
||||||
|
child: Image.asset(iconPath),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCPUView(ServerStatus ss) {
|
Widget _buildCPUView(ServerStatus ss) {
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import 'package:after_layout/after_layout.dart';
|
import 'package:after_layout/after_layout.dart';
|
||||||
import 'package:circle_chart/circle_chart.dart';
|
import 'package:circle_chart/circle_chart.dart';
|
||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get_it/get_it.dart';
|
import 'package:get_it/get_it.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
||||||
import 'package:toolbox/core/route.dart';
|
import 'package:toolbox/core/route.dart';
|
||||||
import 'package:toolbox/core/utils.dart';
|
import 'package:toolbox/core/utils.dart';
|
||||||
import 'package:toolbox/data/model/app/menu_item.dart';
|
import 'package:toolbox/data/model/app/menu_item.dart';
|
||||||
@@ -36,16 +34,17 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
late MediaQueryData _media;
|
late MediaQueryData _media;
|
||||||
late ThemeData _theme;
|
late ThemeData _theme;
|
||||||
late Color _primaryColor;
|
late Color _primaryColor;
|
||||||
late RefreshController _refreshController;
|
|
||||||
|
|
||||||
late ServerProvider _serverProvider;
|
late ServerProvider _serverProvider;
|
||||||
late S s;
|
late S s;
|
||||||
|
late bool autoUpdate;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_serverProvider = locator<ServerProvider>();
|
_serverProvider = locator<ServerProvider>();
|
||||||
_refreshController = RefreshController();
|
autoUpdate =
|
||||||
|
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -60,8 +59,6 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
final autoUpdate =
|
|
||||||
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
|
|
||||||
final child = Consumer<ServerProvider>(builder: (_, pro, __) {
|
final child = Consumer<ServerProvider>(builder: (_, pro, __) {
|
||||||
if (pro.servers.isEmpty) {
|
if (pro.servers.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
@@ -89,13 +86,9 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: autoUpdate
|
body: autoUpdate
|
||||||
? child
|
? child
|
||||||
: SmartRefresher(
|
: RefreshIndicator(
|
||||||
controller: _refreshController,
|
|
||||||
child: child,
|
child: child,
|
||||||
onRefresh: () async {
|
onRefresh: () async => _serverProvider.refreshData(),
|
||||||
await _serverProvider.refreshData();
|
|
||||||
_refreshController.refreshCompleted();
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
@@ -206,72 +199,42 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMoreBtn(ServerPrivateInfo spi) {
|
Widget _buildMoreBtn(ServerPrivateInfo spi) {
|
||||||
return DropdownButtonHideUnderline(
|
return buildPopuopMenu(
|
||||||
child: DropdownButton2(
|
items: <PopupMenuEntry>[
|
||||||
customButton: const Padding(
|
...ServerTabMenuItems.firstItems.map(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 1.7),
|
(item) => PopupMenuItem<DropdownBtnItem>(
|
||||||
child: Icon(
|
value: item,
|
||||||
Icons.more_vert,
|
child: item.build,
|
||||||
size: 17,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
customItemsIndexes: [ServerTabMenuItems.firstItems.length],
|
const PopupMenuDivider(height: 1),
|
||||||
customItemsHeight: 8,
|
...ServerTabMenuItems.secondItems.map(
|
||||||
items: [
|
(item) => PopupMenuItem<DropdownBtnItem>(
|
||||||
...ServerTabMenuItems.firstItems.map(
|
value: item,
|
||||||
(item) => DropdownMenuItem<DropdownBtnItem>(
|
child: item.build,
|
||||||
value: item,
|
|
||||||
child: item.build,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const DropdownMenuItem<Divider>(enabled: false, child: Divider()),
|
|
||||||
...ServerTabMenuItems.secondItems.map(
|
|
||||||
(item) => DropdownMenuItem<DropdownBtnItem>(
|
|
||||||
value: item,
|
|
||||||
child: item.build,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
onChanged: (value) {
|
|
||||||
final item = value as DropdownBtnItem;
|
|
||||||
switch (item) {
|
|
||||||
case ServerTabMenuItems.apt:
|
|
||||||
AppRoute(AptManagePage(spi), 'apt manage page').go(context);
|
|
||||||
break;
|
|
||||||
case ServerTabMenuItems.sftp:
|
|
||||||
AppRoute(SFTPPage(spi), 'SFTP').go(context);
|
|
||||||
break;
|
|
||||||
case ServerTabMenuItems.snippet:
|
|
||||||
AppRoute(
|
|
||||||
SnippetListPage(
|
|
||||||
spi: spi,
|
|
||||||
),
|
|
||||||
'snippet list')
|
|
||||||
.go(context);
|
|
||||||
break;
|
|
||||||
case ServerTabMenuItems.edit:
|
|
||||||
AppRoute(
|
|
||||||
ServerEditPage(
|
|
||||||
spi: spi,
|
|
||||||
),
|
|
||||||
'Edit server info page')
|
|
||||||
.go(context);
|
|
||||||
break;
|
|
||||||
case ServerTabMenuItems.docker:
|
|
||||||
AppRoute(DockerManagePage(spi), 'Docker manage page').go(context);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
itemHeight: 37,
|
|
||||||
itemPadding: const EdgeInsets.only(left: 17, right: 17),
|
|
||||||
dropdownWidth: 160,
|
|
||||||
dropdownPadding: const EdgeInsets.symmetric(vertical: 7),
|
|
||||||
dropdownDecoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(7),
|
|
||||||
),
|
),
|
||||||
dropdownElevation: 8,
|
],
|
||||||
offset: const Offset(0, 8),
|
onSelected: (value) {
|
||||||
),
|
final item = value as DropdownBtnItem;
|
||||||
|
switch (item) {
|
||||||
|
case ServerTabMenuItems.apt:
|
||||||
|
AppRoute(AptManagePage(spi), 'apt manage').go(context);
|
||||||
|
break;
|
||||||
|
case ServerTabMenuItems.sftp:
|
||||||
|
AppRoute(SFTPPage(spi), 'SFTP').go(context);
|
||||||
|
break;
|
||||||
|
case ServerTabMenuItems.snippet:
|
||||||
|
AppRoute(SnippetListPage(spi: spi), 'snippet list').go(context);
|
||||||
|
break;
|
||||||
|
case ServerTabMenuItems.edit:
|
||||||
|
AppRoute(ServerEditPage(spi: spi), 'Edit server info').go(context);
|
||||||
|
break;
|
||||||
|
case ServerTabMenuItems.docker:
|
||||||
|
AppRoute(DockerManagePage(spi), 'Docker manage').go(context);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -420,14 +420,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -550,14 +550,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@@ -574,14 +574,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 153;
|
CURRENT_PROJECT_VERSION = 159;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.153;
|
MARKETING_VERSION = 1.0.159;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ Future<void> flutterBuild(
|
|||||||
buildType,
|
buildType,
|
||||||
];
|
];
|
||||||
// No sksl cache for macos
|
// No sksl cache for macos
|
||||||
if ('macos' != buildType) {
|
final skslPath = '$buildType$skslFileSuffix';
|
||||||
args.add('--bundle-sksl-path=$buildType$skslFileSuffix');
|
if (await File(skslPath).exists()) {
|
||||||
|
args.add('--bundle-sksl-path=$skslPath');
|
||||||
}
|
}
|
||||||
final isAndroid = 'apk' == buildType;
|
final isAndroid = 'apk' == buildType;
|
||||||
// [--target-platform] only for Android
|
// [--target-platform] only for Android
|
||||||
|
|||||||
257
pubspec.lock
257
pubspec.lock
@@ -1,6 +1,13 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
_fe_analyzer_shared:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: _fe_analyzer_shared
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "50.0.0"
|
||||||
after_layout:
|
after_layout:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -8,6 +15,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
|
analyzer:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: analyzer
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.2.0"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -43,6 +57,62 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
build:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
|
build_config:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build_config
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
|
build_daemon:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build_daemon
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
build_resolvers:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build_resolvers
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
build_runner:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: build_runner
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
|
build_runner_core:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: build_runner_core
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "7.2.7"
|
||||||
|
built_collection:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: built_collection
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.1"
|
||||||
|
built_value:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: built_value
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "8.4.2"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -50,6 +120,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.2.1"
|
||||||
|
checked_yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: checked_yaml
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
circle_chart:
|
circle_chart:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -59,13 +136,6 @@ packages:
|
|||||||
url: "https://github.com/LollipopKit/circle_chart"
|
url: "https://github.com/LollipopKit/circle_chart"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.3"
|
version: "0.0.3"
|
||||||
clipboard:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: clipboard
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.3"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -73,6 +143,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
|
code_builder:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: code_builder
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.3.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -110,6 +187,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
dart_style:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: dart_style
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.4"
|
||||||
dartssh2:
|
dartssh2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -124,13 +208,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.6"
|
version: "4.0.6"
|
||||||
dropdown_button2:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: dropdown_button2
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.5.2"
|
|
||||||
easy_isolate:
|
easy_isolate:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -173,18 +250,18 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.2"
|
version: "6.1.2"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_advanced_drawer:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_advanced_drawer
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.2"
|
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -228,6 +305,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
frontend_server_client:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: frontend_server_client
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
get_it:
|
get_it:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -235,8 +319,22 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.2.0"
|
version: "7.2.0"
|
||||||
|
glob:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: glob
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
graphs:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: graphs
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
hive:
|
hive:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: hive
|
name: hive
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
@@ -249,6 +347,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
hive_generator:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: hive_generator
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -263,6 +368,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.2"
|
||||||
|
http_multi_server:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_multi_server
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.1"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -284,6 +396,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.17.0"
|
version: "0.17.0"
|
||||||
|
io:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: io
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -291,6 +410,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.4"
|
version: "0.6.4"
|
||||||
|
json_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_annotation
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.7.0"
|
||||||
lint:
|
lint:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -347,6 +473,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
package_config:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: package_config
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -445,6 +578,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.0"
|
version: "3.6.0"
|
||||||
|
pool:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pool
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.5.1"
|
||||||
process:
|
process:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -459,13 +599,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.3"
|
version: "6.0.3"
|
||||||
pull_to_refresh:
|
pub_semver:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pull_to_refresh
|
name: pub_semver
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.2"
|
||||||
|
pubspec_parse:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pubspec_parse
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.1"
|
||||||
r_upgrade:
|
r_upgrade:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -515,11 +662,39 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.0"
|
||||||
|
shelf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shelf
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
|
shelf_web_socket:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shelf_web_socket
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.99"
|
||||||
|
source_gen:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: source_gen
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.6"
|
||||||
|
source_helper:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: source_helper
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.3"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -541,6 +716,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
stream_transform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stream_transform
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -562,6 +744,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.12"
|
version: "0.4.12"
|
||||||
|
timing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: timing
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -639,6 +828,20 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
|
watcher:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: watcher
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
|
web_socket_channel:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web_socket_channel
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -668,5 +871,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.17.0 <3.0.0"
|
dart: ">=2.18.0 <3.0.0"
|
||||||
flutter: ">=3.0.0"
|
flutter: ">=3.0.0"
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
provider: ^6.0.0
|
provider: ^6.0.0
|
||||||
get_it: ^7.2.0
|
get_it: ^7.2.0
|
||||||
hive: ^2.0.0
|
|
||||||
hive_flutter: ^1.0.0
|
hive_flutter: ^1.0.0
|
||||||
dio: ^4.0.0
|
dio: ^4.0.0
|
||||||
after_layout: ^1.1.0
|
after_layout: ^1.1.0
|
||||||
@@ -51,11 +50,7 @@ dependencies:
|
|||||||
url: https://github.com/LollipopKit/circle_chart
|
url: https://github.com/LollipopKit/circle_chart
|
||||||
ref: main
|
ref: main
|
||||||
# path: ../circle_chart
|
# path: ../circle_chart
|
||||||
clipboard: ^0.1.3
|
|
||||||
r_upgrade: ^0.3.6
|
r_upgrade: ^0.3.6
|
||||||
pull_to_refresh: ^2.0.0
|
|
||||||
dropdown_button2: ^1.1.1
|
|
||||||
flutter_advanced_drawer: ^1.3.0
|
|
||||||
path_provider: ^2.0.9
|
path_provider: ^2.0.9
|
||||||
easy_isolate: ^1.3.0
|
easy_isolate: ^1.3.0
|
||||||
share_plus: ^4.0.4
|
share_plus: ^4.0.4
|
||||||
@@ -63,6 +58,8 @@ dependencies:
|
|||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_native_splash: ^2.1.6
|
flutter_native_splash: ^2.1.6
|
||||||
|
hive_generator: ^2.0.0
|
||||||
|
build_runner: ^2.3.2
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
@@ -94,6 +91,7 @@ flutter:
|
|||||||
- assets/linux/fedora.png
|
- assets/linux/fedora.png
|
||||||
- assets/linux/opensuse.png
|
- assets/linux/opensuse.png
|
||||||
- assets/linux/wrt.png
|
- assets/linux/wrt.png
|
||||||
|
- assets/linux/armbian.png
|
||||||
# - images/a_dot_burr.jpeg
|
# - images/a_dot_burr.jpeg
|
||||||
# - images/a_dot_ham.jpeg
|
# - images/a_dot_ham.jpeg
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
|||||||
Reference in New Issue
Block a user