From d5ce11c788c1e63b49794e4f98187486bb068d6b Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Wed, 20 Mar 2024 14:24:05 +0800 Subject: [PATCH] new: docker icon --- .gitignore | 2 +- ios/Runner.xcodeproj/project.pbxproj | 36 +++++++-------- lib/data/model/app/menu/server_func.dart | 29 ++++++++---- lib/data/provider/pve.dart | 3 +- lib/data/res/build_data.dart | 6 +-- lib/view/page/server/detail.dart | 2 +- lib/view/widget/server_func_btns.dart | 8 ++-- macos/Runner.xcodeproj/project.pbxproj | 12 ++--- pubspec.lock | 56 ++++++++++++++++++++++++ pubspec.yaml | 1 + 10 files changed, 111 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 18ec26d5..d6499532 100644 --- a/.gitignore +++ b/.gitignore @@ -56,7 +56,7 @@ test.dart .dart_tool # Linux release -ServerBox.AppDir +linux.AppDir ServerBox-x86_64.AppImage untranlated.json diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 81b4ad70..91540a3c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -660,7 +660,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -670,7 +670,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -796,7 +796,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -806,7 +806,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -824,7 +824,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -834,7 +834,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -855,7 +855,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -868,7 +868,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -894,7 +894,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -907,7 +907,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -930,7 +930,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -943,7 +943,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -966,7 +966,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -978,7 +978,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -1007,7 +1007,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1019,7 +1019,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -1045,7 +1045,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1057,7 +1057,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/data/model/app/menu/server_func.dart b/lib/data/model/app/menu/server_func.dart index 1901a51c..902963d8 100644 --- a/lib/data/model/app/menu/server_func.dart +++ b/lib/data/model/app/menu/server_func.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:hive_flutter/hive_flutter.dart'; +import 'package:icons_plus/icons_plus.dart'; import 'package:toolbox/core/extension/context/locale.dart'; part 'server_func.g.dart'; @@ -24,15 +25,25 @@ enum ServerFuncBtn { pve, ; - IconData get icon => switch (this) { - sftp => Icons.insert_drive_file, - snippet => Icons.code, - pkg => Icons.system_security_update, - container => Icons.view_agenda, - process => Icons.list_alt_outlined, - terminal => Icons.terminal, - iperf => Icons.speed, - pve => Icons.computer, + static const defaultFuncs = [ + terminal, + sftp, + container, + process, + pkg, + snippet, + pve, + ]; + + Icon get icon => switch (this) { + sftp => const Icon(Icons.insert_drive_file, size: 15), + snippet => const Icon(Icons.code, size: 15), + pkg => const Icon(Icons.system_security_update, size: 15), + container => const Icon(FontAwesome.docker_brand, size: 14), + process => const Icon(Icons.list_alt_outlined, size: 15), + terminal => const Icon(Icons.terminal, size: 15), + iperf => const Icon(Icons.speed, size: 15), + pve => const Icon(FontAwesome.server_solid, size: 13), }; String get toStr => switch (this) { diff --git a/lib/data/provider/pve.dart b/lib/data/provider/pve.dart index 3764585d..c7983406 100644 --- a/lib/data/provider/pve.dart +++ b/lib/data/provider/pve.dart @@ -102,7 +102,8 @@ final class PveProvider extends ChangeNotifier { try { final resp = await session.get('$addr/api2/json/cluster/resources'); final res = resp.data['data'] as List; - final result = await Computer.shared.start(PveRes.parse, (res, data.value)); + final result = + await Computer.shared.start(PveRes.parse, (res, data.value)); data.value = result; } catch (e) { Loggers.app.warning('PVE list failed', e); diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 0396eea6..894d01ee 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 811; + static const int build = 817; static const String engine = "3.19.3"; - static const String buildAt = "2024-03-16 16:31:54"; - static const int modifications = 6; + static const String buildAt = "2024-03-19 16:44:04"; + static const int modifications = 4; static const int script = 41; } diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index 186401f0..14339885 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -116,7 +116,7 @@ class _ServerDetailPageState extends State itemCount: buildFuncs ? _cardsOrder.length + 1 : _cardsOrder.length, itemBuilder: (context, index) { if (index == 0 && buildFuncs) { - return ServerFuncBtns(spi: widget.spi, iconSize: 19); + return ServerFuncBtns(spi: widget.spi); } if (buildFuncs) index--; return _cardBuildMap[_cardsOrder[index]]?.call(si.status); diff --git a/lib/view/widget/server_func_btns.dart b/lib/view/widget/server_func_btns.dart index 00da60bc..e5dcba8d 100644 --- a/lib/view/widget/server_func_btns.dart +++ b/lib/view/widget/server_func_btns.dart @@ -41,7 +41,7 @@ class ServerFuncBtnsTopRight extends StatelessWidget { value: e, child: Row( children: [ - Icon(e.icon), + e.icon, const SizedBox( width: 10, ), @@ -60,11 +60,9 @@ class ServerFuncBtns extends StatelessWidget { const ServerFuncBtns({ super.key, required this.spi, - this.iconSize, }); final ServerPrivateInfo spi; - final double? iconSize; @override Widget build(BuildContext context) { @@ -86,7 +84,7 @@ class ServerFuncBtns extends StatelessWidget { onPressed: () => _onTapMoreBtns(e, spi, context), padding: EdgeInsets.zero, tooltip: e.toStr, - icon: Icon(e.icon, size: iconSize ?? 15), + icon: e.icon, ) : Padding( padding: const EdgeInsets.only(bottom: 13), @@ -96,7 +94,7 @@ class ServerFuncBtns extends StatelessWidget { IconButton( onPressed: () => _onTapMoreBtns(e, spi, context), padding: EdgeInsets.zero, - icon: Icon(e.icon, size: iconSize ?? 15), + icon: e.icon, ), Text(e.toStr, style: UIs.text11Grey) ], diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 1ba8149f..f7497c9f 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -467,7 +467,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -477,7 +477,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -604,7 +604,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -614,7 +614,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -634,7 +634,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 811; + CURRENT_PROJECT_VERSION = 817; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; @@ -645,7 +645,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.811; + MARKETING_VERSION = 1.0.817; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.lock b/pubspec.lock index 00e96952..67739608 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -429,6 +429,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.17" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + url: "https://pub.dev" + source: hosted + version: "2.0.10+1" flutter_test: dependency: "direct dev" description: flutter @@ -511,6 +519,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.15.4" + http: + dependency: transitive + description: + name: http + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + url: "https://pub.dev" + source: hosted + version: "1.2.0" http_multi_server: dependency: transitive description: @@ -535,6 +551,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" + icons_plus: + dependency: "direct main" + description: + name: icons_plus + sha256: "8e2f601b8605d45dd55b106a0da084a1809125077a49574ca22e8bcd5b6e86f0" + url: "https://pub.dev" + source: hosted + version: "5.0.0" image: dependency: transitive description: @@ -727,6 +751,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" path_provider: dependency: "direct main" description: @@ -1156,6 +1188,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.3.3" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 53ea14b3..6e4b230b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,6 +72,7 @@ dependencies: ref: master url: https://github.com/lollipopkit/dart_computer flutter_background_service: ^5.0.5 + icons_plus: ^5.0.0 dev_dependencies: flutter_native_splash: ^2.1.6