mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-15 04:34:34 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5e22cbc65 | ||
|
|
7926a4d4a6 | ||
|
|
39a3e0800b | ||
|
|
cd3c094af0 | ||
|
|
8589b3b4d7 | ||
|
|
7693e30cbf | ||
|
|
874d28be12 | ||
|
|
06070c29b9 | ||
|
|
bb0ada12e6 | ||
|
|
9ceeaf7cc4 | ||
|
|
29a57ad742 | ||
|
|
2c495a44c3 | ||
|
|
cc300c141a | ||
|
|
26efb8e185 | ||
|
|
06ed38ff45 | ||
|
|
7c35abe30e | ||
|
|
78ef181d4a | ||
|
|
3f15caeaf2 | ||
|
|
6458e736fa | ||
|
|
99fda8b747 | ||
|
|
c5cbb12ac3 |
2
.github/workflows/analysis.yml
vendored
2
.github/workflows/analysis.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
|
||||
159
.github/workflows/release.yml
vendored
159
.github/workflows/release.yml
vendored
@@ -9,23 +9,24 @@ on:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
# Set by fl_build
|
||||
# env:
|
||||
# APP_NAME: ServerBox
|
||||
# BUILD_NUMBER: ${{ github.ref_name }}
|
||||
env:
|
||||
APP_NAME: ServerBox
|
||||
RELEASE_TAG: ${{ github.ref_name }}
|
||||
|
||||
jobs:
|
||||
releaseAndroid:
|
||||
name: Release android
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
flutter-version: "3.38.0"
|
||||
flutter-version: "3.38.7"
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "zulu"
|
||||
@@ -37,26 +38,39 @@ jobs:
|
||||
- name: Build
|
||||
run: dart run fl_build -p android
|
||||
- name: Rename for fdroid
|
||||
shell: bash
|
||||
run: |
|
||||
mv build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_arm64.apk build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_arm64.apk
|
||||
mv build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_arm.apk build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_arm.apk
|
||||
mv build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.apk build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_amd64.apk
|
||||
APK_DIR="build/app/outputs/flutter-apk"
|
||||
shopt -s nullglob
|
||||
|
||||
for arch in arm64 arm amd64; do
|
||||
matches=("$APK_DIR"/"${APP_NAME}"_*_"${arch}".apk)
|
||||
if [ ${#matches[@]} -ne 1 ]; then
|
||||
echo "Error: expected 1 APK for ${arch}, found ${#matches[@]}"
|
||||
echo "APK_DIR: $APK_DIR"
|
||||
ls -la "$APK_DIR" || true
|
||||
exit 1
|
||||
fi
|
||||
mv "${matches[0]}" "$APK_DIR/${APP_NAME}_${RELEASE_TAG}_${arch}.apk"
|
||||
done
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_arm64.apk
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_arm.apk
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_v1.0.${{ env.BUILD_NUMBER }}_amd64.apk
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_arm64.apk
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_arm.apk
|
||||
build/app/outputs/flutter-apk/${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_amd64.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
releaseLinux:
|
||||
name: Release linux
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Install dependencies
|
||||
@@ -69,11 +83,22 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
dart run fl_build -p linux
|
||||
- name: Rename for release
|
||||
shell: bash
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
matches=("${APP_NAME}"_*_amd64.AppImage)
|
||||
if [ ${#matches[@]} -ne 1 ]; then
|
||||
echo "Error: expected 1 AppImage, found ${#matches[@]}"
|
||||
ls -la || true
|
||||
exit 1
|
||||
fi
|
||||
mv "${matches[0]}" "${APP_NAME}_${RELEASE_TAG}_amd64.AppImage"
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.AppImage
|
||||
${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_amd64.AppImage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -82,33 +107,97 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
run: dart run fl_build -p windows
|
||||
- name: Rename for release
|
||||
shell: bash
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
matches=("${APP_NAME}"_*_windows_amd64.zip)
|
||||
if [ ${#matches[@]} -ne 1 ]; then
|
||||
echo "Error: expected 1 zip, found ${#matches[@]}"
|
||||
ls -la || true
|
||||
exit 1
|
||||
fi
|
||||
mv "${matches[0]}" "${APP_NAME}_${RELEASE_TAG}_windows_amd64.zip"
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_windows_amd64.zip
|
||||
${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_windows_amd64.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# releaseApple:
|
||||
# name: Release ios and macos
|
||||
# runs-on: macos-latest
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# - name: Install Flutter
|
||||
# uses: subosito/flutter-action@v2
|
||||
# - name: Build
|
||||
# run: dart run fl_build -p ios
|
||||
# - name: Create Release
|
||||
# uses: softprops/action-gh-release@v2
|
||||
# with:
|
||||
# files: |
|
||||
# ${{ env.APP_NAME }}_universal.ipa
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
releaseIOS:
|
||||
name: Release iOS
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
run: |
|
||||
dart run fl_build -p ios -- --no-codesign
|
||||
shopt -s nullglob
|
||||
IPA_FILES=(build/ios/ipa/*.ipa)
|
||||
if [ ${#IPA_FILES[@]} -ne 1 ]; then
|
||||
echo "Error: expected 1 IPA, found ${#IPA_FILES[@]}"
|
||||
ls -la build/ios/ipa || true
|
||||
exit 1
|
||||
fi
|
||||
IPA_FILE="${IPA_FILES[0]}"
|
||||
echo "Found IPA: $IPA_FILE"
|
||||
cp "$IPA_FILE" "${APP_NAME}_${RELEASE_TAG}_ios.ipa"
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_ios.ipa
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
releaseMacOS:
|
||||
name: Release macOS
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
run: |
|
||||
dart run fl_build -p macos -- --no-codesign
|
||||
- name: Package
|
||||
run: |
|
||||
RELEASE_DIR="$GITHUB_WORKSPACE/build/macos/Build/Products/Release"
|
||||
APP_DIR="$RELEASE_DIR/$APP_NAME.app"
|
||||
OUT_ZIP="$GITHUB_WORKSPACE/${APP_NAME}_${RELEASE_TAG}_macos.zip"
|
||||
|
||||
if [ ! -d "$RELEASE_DIR" ]; then
|
||||
echo "Error: macOS release directory not found: $RELEASE_DIR"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$APP_DIR" ]; then
|
||||
echo "Error: macOS app bundle not found: $APP_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$RELEASE_DIR"
|
||||
zip -ry "$OUT_ZIP" "$APP_NAME.app"
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
${{ env.APP_NAME }}_${{ env.RELEASE_TAG }}_macos.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
|
||||
|
||||
@@ -19,7 +19,7 @@ pluginManagement {
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version '8.6.0' apply false
|
||||
id "com.android.application" version '8.9.1' apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.1.21" apply false
|
||||
}
|
||||
|
||||
|
||||
@@ -88,19 +88,19 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
app_links: 3dbc685f76b1693c66a6d9dd1e9ab6f73d97dc0a
|
||||
camera_avfoundation: be3be85408cd4126f250386828e9b1dfa40ab436
|
||||
camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741
|
||||
file_picker: fb04e739ae6239a76ce1f571863a196a922c87d4
|
||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
||||
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
|
||||
icloud_storage: e55639f0c0d7cb2b0ba9c0b3d5968ccca9cd9aa2
|
||||
local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19
|
||||
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
|
||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
|
||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||
plain_notification_token: 047876b9d80a5b93565ddcc13a487a7e7b906f7d
|
||||
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
|
||||
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
|
||||
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
|
||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
||||
wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
|
||||
watch_connectivity: 88e5bea25b473e66ef8d3f960954d154ed0356d6
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -758,7 +758,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -884,7 +884,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -894,7 +894,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -912,7 +912,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -922,7 +922,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -943,7 +943,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -956,7 +956,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
@@ -982,7 +982,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -995,7 +995,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1018,7 +1018,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -1031,7 +1031,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1054,7 +1054,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -1066,7 +1066,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
|
||||
@@ -1095,7 +1095,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -1107,7 +1107,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
|
||||
PRODUCT_NAME = ServerBox;
|
||||
@@ -1133,7 +1133,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -1145,7 +1145,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
|
||||
PRODUCT_NAME = ServerBox;
|
||||
|
||||
23
lib/app.dart
23
lib/app.dart
@@ -25,6 +25,7 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_setup(context);
|
||||
|
||||
return ListenableBuilder(
|
||||
listenable: RNodes.app,
|
||||
builder: (context, _) {
|
||||
@@ -39,6 +40,7 @@ class _MyAppState extends State<MyApp> {
|
||||
|
||||
Widget _build(BuildContext context) {
|
||||
final colorSeed = Color(Stores.setting.colorSeed.fetch());
|
||||
|
||||
UIs.colorSeed = colorSeed;
|
||||
UIs.primaryColor = colorSeed;
|
||||
|
||||
@@ -61,14 +63,31 @@ class _MyAppState extends State<MyApp> {
|
||||
Widget _buildDynamicColor(BuildContext context) {
|
||||
return DynamicColorBuilder(
|
||||
builder: (light, dark) {
|
||||
final lightTheme = ThemeData(useMaterial3: true, colorScheme: light);
|
||||
final darkTheme = ThemeData(useMaterial3: true, brightness: Brightness.dark, colorScheme: dark);
|
||||
final lightSeed = light?.primary;
|
||||
final darkSeed = dark?.primary;
|
||||
|
||||
final lightTheme = ThemeData(
|
||||
useMaterial3: true,
|
||||
colorSchemeSeed: lightSeed,
|
||||
appBarTheme: AppBarTheme(scrolledUnderElevation: 0.0),
|
||||
);
|
||||
final darkTheme = ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
colorSchemeSeed: darkSeed,
|
||||
appBarTheme: AppBarTheme(scrolledUnderElevation: 0.0),
|
||||
);
|
||||
|
||||
if (context.isDark && dark != null) {
|
||||
UIs.primaryColor = dark.primary;
|
||||
UIs.colorSeed = dark.primary;
|
||||
} else if (!context.isDark && light != null) {
|
||||
UIs.primaryColor = light.primary;
|
||||
UIs.colorSeed = light.primary;
|
||||
} else {
|
||||
final fallbackColor = Color(Stores.setting.colorSeed.fetch());
|
||||
UIs.primaryColor = fallbackColor;
|
||||
UIs.colorSeed = fallbackColor;
|
||||
}
|
||||
|
||||
return _buildApp(context, light: lightTheme, dark: darkTheme);
|
||||
|
||||
@@ -35,8 +35,8 @@ abstract final class MethodChans {
|
||||
try {
|
||||
Loggers.app.info('Updating Android sessions: $payload');
|
||||
await _channel.invokeMethod('updateSessions', payload);
|
||||
} catch (_) {
|
||||
// ignore
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to update Android sessions', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ abstract final class MethodChans {
|
||||
try {
|
||||
final res = await _channel.invokeMethod('isServiceRunning');
|
||||
return res == true;
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to check if Android service is running', e, s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +58,9 @@ abstract final class MethodChans {
|
||||
try {
|
||||
Loggers.app.info('Starting iOS Live Activity: $payload');
|
||||
await _channel.invokeMethod('startLiveActivity', payload);
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to start iOS Live Activity', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> updateLiveActivity(String payload) async {
|
||||
@@ -65,7 +68,9 @@ abstract final class MethodChans {
|
||||
try {
|
||||
Loggers.app.info('Updating iOS Live Activity: $payload');
|
||||
await _channel.invokeMethod('updateLiveActivity', payload);
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to update iOS Live Activity', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> stopLiveActivity() async {
|
||||
@@ -73,7 +78,9 @@ abstract final class MethodChans {
|
||||
try {
|
||||
Loggers.app.info('Stopping iOS Live Activity');
|
||||
await _channel.invokeMethod('stopLiveActivity');
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to stop iOS Live Activity', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
/// Register a handler for native -> Flutter callbacks.
|
||||
|
||||
@@ -112,7 +112,7 @@ extension SSHClientX on SSHClient {
|
||||
return (session, result.takeBytes().string);
|
||||
}
|
||||
|
||||
Future<int?> execWithPwd(
|
||||
Future<(int?, String)> execWithPwd(
|
||||
String script, {
|
||||
String? entry,
|
||||
BuildContext? context,
|
||||
@@ -121,7 +121,7 @@ extension SSHClientX on SSHClient {
|
||||
required String id,
|
||||
}) async {
|
||||
var isRequestingPwd = false;
|
||||
final (session, _) = await exec(
|
||||
final (session, output) = await exec(
|
||||
(sess) {
|
||||
sess.stdin.add('$script\n'.uint8List);
|
||||
sess.stdin.close();
|
||||
@@ -147,7 +147,7 @@ extension SSHClientX on SSHClient {
|
||||
onStdout: onStdout,
|
||||
entry: entry,
|
||||
);
|
||||
return session.exitCode;
|
||||
return (session.exitCode, output);
|
||||
}
|
||||
|
||||
Future<String> execForOutput(
|
||||
|
||||
@@ -74,7 +74,8 @@ class SshDiscoveryService {
|
||||
// Some tools return non-zero but still have useful output
|
||||
if (out.trim().isNotEmpty) return out;
|
||||
return null;
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to run command: $exe ${args.join(' ')}', e, s);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +110,7 @@ class SshDiscoveryService {
|
||||
}
|
||||
}
|
||||
if (matchCount == 0) {
|
||||
lprint(
|
||||
Loggers.app.warning(
|
||||
'[ssh_discovery] Warning: No ARP entries parsed on macOS. Output may be unexpected or localized. Output sample: ${s.length > 100 ? '${s.substring(0, 100)}...' : s}',
|
||||
);
|
||||
}
|
||||
@@ -176,8 +177,7 @@ class SshDiscoveryService {
|
||||
r'inet\s+(\d+\.\d+\.\d+\.\d+)\s+netmask\s+0x([0-9a-fA-F]+)(?:\s+broadcast\s+(\d+\.\d+\.\d+\.\d+))?',
|
||||
).firstMatch(line);
|
||||
if (ipm == null) {
|
||||
// Log unexpected format but continue processing other lines
|
||||
lprint('[ssh_discovery] Warning: Unexpected ifconfig line format: $line');
|
||||
Loggers.app.warning('[ssh_discovery] Warning: Unexpected ifconfig line format: $line');
|
||||
continue;
|
||||
}
|
||||
final ip = InternetAddress(ipm.group(1)!);
|
||||
@@ -190,7 +190,7 @@ class SshDiscoveryService {
|
||||
final brd = InternetAddress(ipm.group(3) ?? _broadcastAddress(ip, mask).address);
|
||||
res.add(_Cidr(ip, prefix, mask, net, brd));
|
||||
} catch (e) {
|
||||
lprint('[ssh_discovery] Error parsing ifconfig output: $e, line: $line');
|
||||
Loggers.app.warning('[ssh_discovery] Error parsing ifconfig output: $e, line: $line');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,9 @@ class SshDiscoveryService {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to discover mDNS SSH candidates on macOS', e, s);
|
||||
}
|
||||
} else if (_isLinux) {
|
||||
final s = await _run('/usr/bin/avahi-browse', ['-rat', '_ssh._tcp']);
|
||||
if (s != null) {
|
||||
@@ -335,7 +337,8 @@ class _Scanner {
|
||||
);
|
||||
final banner = await c.future.timeout(timeout, onTimeout: () => null);
|
||||
return _ScanResult(ip, banner);
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to probe SSH at ${ip.address}', e, s);
|
||||
return null;
|
||||
} finally {
|
||||
sub?.cancel();
|
||||
|
||||
@@ -26,7 +26,8 @@ final class BakSyncer extends SyncIface {
|
||||
return MergeableUtils.fromJsonString(content, pwd).$1;
|
||||
}
|
||||
return MergeableUtils.fromJsonString(content).$1;
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to parse backup file with password, trying without password', e, s);
|
||||
// Fallback: try without password if detection failed
|
||||
return MergeableUtils.fromJsonString(content).$1;
|
||||
}
|
||||
|
||||
@@ -149,10 +149,12 @@ abstract final class SSHConfig {
|
||||
|
||||
/// Extract jump host from ProxyJump or ProxyCommand
|
||||
static String? _extractJumpHost(String value) {
|
||||
if (value.isEmpty) return null;
|
||||
// For ProxyJump, the format is usually: user@host:port
|
||||
// For ProxyCommand, it's more complex and might need custom parsing
|
||||
if (value.contains('@')) {
|
||||
return value.split(' ').first;
|
||||
final parts = value.split(' ');
|
||||
return parts.isNotEmpty ? parts[0] : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ class BackupService {
|
||||
await _confirmAndRestore(context, backup);
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
// Saved password failed, will prompt for manual input
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to restore with saved password, will prompt for manual input', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ enum ContainerErrType {
|
||||
parsePs,
|
||||
parseImages,
|
||||
parseStats,
|
||||
podmanDetected,
|
||||
}
|
||||
|
||||
class ContainerErr extends Err<ContainerErrType> {
|
||||
|
||||
119
lib/data/model/app/menu/platform.dart
Normal file
119
lib/data/model/app/menu/platform.dart
Normal file
@@ -0,0 +1,119 @@
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
import 'package:server_box/data/model/app/tab.dart';
|
||||
import 'package:server_box/data/res/store.dart';
|
||||
import 'package:server_box/data/res/url.dart';
|
||||
import 'package:server_box/generated/l10n/l10n.dart';
|
||||
import 'package:server_box/view/page/setting/entry.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
/// macOS Menu Bar
|
||||
class MacOSMenuBarManager {
|
||||
static List<PlatformMenu> buildMenuBar(BuildContext context, Function(int) onTabChanged) {
|
||||
final l10n = context.l10n;
|
||||
final homeTabs = Stores.setting.homeTabs.fetch();
|
||||
return [
|
||||
PlatformMenu(
|
||||
label: 'Server Box',
|
||||
menus: [
|
||||
PlatformMenuItem(
|
||||
label: libL10n.about,
|
||||
onSelected: () => _showAboutDialog(context),
|
||||
),
|
||||
PlatformMenuItem(
|
||||
label: l10n.menuSettings,
|
||||
shortcut: const SingleActivator(LogicalKeyboardKey.comma, meta: true),
|
||||
onSelected: () => _openSettings(context),
|
||||
),
|
||||
PlatformMenuItem(
|
||||
label: l10n.menuQuit,
|
||||
shortcut: const SingleActivator(LogicalKeyboardKey.keyQ, meta: true),
|
||||
onSelected: () => SystemNavigator.pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
PlatformMenu(
|
||||
label: l10n.menuNavigate,
|
||||
menus: _buildNavigateMenuItems(l10n, homeTabs, onTabChanged),
|
||||
),
|
||||
PlatformMenu(
|
||||
label: l10n.menuInfo,
|
||||
menus: [
|
||||
PlatformMenuItem(
|
||||
label: l10n.menuGitHubRepository,
|
||||
onSelected: () => _openURL(Urls.thisRepo),
|
||||
),
|
||||
PlatformMenuItem(
|
||||
label: l10n.menuWiki,
|
||||
onSelected: () => _openURL(Urls.appWiki),
|
||||
),
|
||||
PlatformMenuItem(
|
||||
label: l10n.menuHelp,
|
||||
onSelected: () => _openURL(Urls.appHelp),
|
||||
),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
static List<PlatformMenuItem> _buildNavigateMenuItems(
|
||||
AppLocalizations l10n,
|
||||
List<AppTab> homeTabs,
|
||||
Function(int) onTabChanged,
|
||||
) {
|
||||
final menuItems = <PlatformMenuItem>[];
|
||||
final tabLabels = {
|
||||
AppTab.server: l10n.server,
|
||||
AppTab.ssh: 'SSH',
|
||||
AppTab.file: libL10n.file,
|
||||
AppTab.snippet: l10n.snippet,
|
||||
};
|
||||
for (var i = 0; i < homeTabs.length; i++) {
|
||||
final tab = homeTabs[i];
|
||||
final label = tabLabels[tab];
|
||||
if (label == null) continue;
|
||||
final shortcutKey = _getShortcutKeyForIndex(i);
|
||||
menuItems.add(PlatformMenuItem(
|
||||
label: label,
|
||||
shortcut: shortcutKey != null
|
||||
? SingleActivator(shortcutKey, meta: true)
|
||||
: null,
|
||||
onSelected: () => onTabChanged(i),
|
||||
));
|
||||
}
|
||||
return menuItems;
|
||||
}
|
||||
|
||||
static LogicalKeyboardKey? _getShortcutKeyForIndex(int index) {
|
||||
const keys = [
|
||||
LogicalKeyboardKey.digit1,
|
||||
LogicalKeyboardKey.digit2,
|
||||
LogicalKeyboardKey.digit3,
|
||||
LogicalKeyboardKey.digit4,
|
||||
LogicalKeyboardKey.digit5,
|
||||
LogicalKeyboardKey.digit6,
|
||||
LogicalKeyboardKey.digit7,
|
||||
LogicalKeyboardKey.digit8,
|
||||
LogicalKeyboardKey.digit9,
|
||||
];
|
||||
return index < keys.length ? keys[index] : null;
|
||||
}
|
||||
|
||||
static Future<void> _showAboutDialog(BuildContext context) async {
|
||||
const channel = MethodChannel('about');
|
||||
await channel.invokeMethod('showAboutPanel');
|
||||
}
|
||||
|
||||
static void _openSettings(BuildContext context) {
|
||||
SettingsPage.route.go(context);
|
||||
}
|
||||
|
||||
static Future<void> _openURL(String url) async {
|
||||
final uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ sealed class ContainerPs {
|
||||
|
||||
factory ContainerPs.fromRaw(String s, ContainerType typ) => typ.ps(s);
|
||||
|
||||
void parseStats(String s);
|
||||
void parseStats(String s, [String? version]);
|
||||
}
|
||||
|
||||
final class PodmanPs implements ContainerPs {
|
||||
@@ -55,7 +55,7 @@ final class PodmanPs implements ContainerPs {
|
||||
ContainerStatus get status => ContainerStatus.fromPodmanExited(exited);
|
||||
|
||||
@override
|
||||
void parseStats(String s) {
|
||||
void parseStats(String s, [String? version]) {
|
||||
final stats = json.decode(s);
|
||||
final cpuD = (stats['CPU'] as double? ?? 0).toStringAsFixed(1);
|
||||
final cpuAvgD = (stats['AvgCPU'] as double? ?? 0).toStringAsFixed(1);
|
||||
@@ -63,12 +63,32 @@ final class PodmanPs implements ContainerPs {
|
||||
final memLimit = (stats['MemLimit'] as int? ?? 0).bytes2Str;
|
||||
final memUsage = (stats['MemUsage'] as int? ?? 0).bytes2Str;
|
||||
mem = '$memUsage / $memLimit';
|
||||
final netIn = (stats['NetInput'] as int? ?? 0).bytes2Str;
|
||||
final netOut = (stats['NetOutput'] as int? ?? 0).bytes2Str;
|
||||
net = '↓ $netIn / ↑ $netOut';
|
||||
|
||||
int netIn = 0;
|
||||
int netOut = 0;
|
||||
final majorVersion = version?.split('.').firstOrNull;
|
||||
final majorVersionNum = majorVersion != null ? int.tryParse(majorVersion) : null;
|
||||
|
||||
// Podman 4.x and earlier use top-level NetInput/NetOutput fields.
|
||||
// Podman 5.x changed network backend (Netavark) and uses nested
|
||||
// Network.{iface}.RxBytes/TxBytes structure instead.
|
||||
if (majorVersionNum == null || majorVersionNum <= 4) {
|
||||
netIn = stats['NetInput'] as int? ?? 0;
|
||||
netOut = stats['NetOutput'] as int? ?? 0;
|
||||
} else if (majorVersionNum >= 5) {
|
||||
final network = stats['Network'] as Map<String, dynamic>?;
|
||||
if (network != null) {
|
||||
for (final interface in network.values) {
|
||||
netIn += interface['RxBytes'] as int? ?? 0;
|
||||
netOut += interface['TxBytes'] as int? ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
net = '↓ ${netIn.bytes2Str} / ↑ ${netOut.bytes2Str}';
|
||||
|
||||
final diskIn = (stats['BlockInput'] as int? ?? 0).bytes2Str;
|
||||
final diskOut = (stats['BlockOutput'] as int? ?? 0).bytes2Str;
|
||||
disk = '${l10n.read} $diskOut / ${l10n.write} $diskIn';
|
||||
disk = '${l10n.read} $diskIn / ${l10n.write} $diskOut';
|
||||
}
|
||||
|
||||
factory PodmanPs.fromRawJson(String str) => PodmanPs.fromJson(json.decode(str));
|
||||
@@ -125,12 +145,18 @@ final class DockerPs implements ContainerPs {
|
||||
ContainerStatus get status => ContainerStatus.fromDockerState(state);
|
||||
|
||||
@override
|
||||
void parseStats(String s) {
|
||||
void parseStats(String s, [String? version]) {
|
||||
final stats = json.decode(s);
|
||||
cpu = stats['CPUPerc'];
|
||||
mem = stats['MemUsage'];
|
||||
net = stats['NetIO'];
|
||||
disk = stats['BlockIO'];
|
||||
|
||||
final netIO = stats['NetIO'] as String? ?? '0B / 0B';
|
||||
final netParts = netIO.split(' / ');
|
||||
net = '↓ ${netParts.firstOrNull ?? '0B'} / ↑ ${netParts.length > 1 ? netParts[1] : '0B'}';
|
||||
|
||||
final blockIO = stats['BlockIO'] as String? ?? '0B / 0B';
|
||||
final blockParts = blockIO.split(' / ');
|
||||
disk = '${l10n.read} ${blockParts.firstOrNull ?? '0B'} / ${l10n.write} ${blockParts.length > 1 ? blockParts[1] : '0B'}';
|
||||
}
|
||||
|
||||
/// CONTAINER ID NAMES IMAGE STATUS
|
||||
|
||||
@@ -62,6 +62,7 @@ class UpgradePkgInfo {
|
||||
|
||||
void _parsePacman(String raw) {
|
||||
final parts = raw.split(' ');
|
||||
if (parts.length < 4) throw Exception('Invalid pacman output format');
|
||||
package = parts[0];
|
||||
nowVersion = parts[1];
|
||||
newVersion = parts[3];
|
||||
@@ -70,6 +71,7 @@ class UpgradePkgInfo {
|
||||
|
||||
void _parseOpkg(String raw) {
|
||||
final parts = raw.split(' - ');
|
||||
if (parts.length < 3) throw Exception('Invalid opkg output format');
|
||||
package = parts[0];
|
||||
nowVersion = parts[1];
|
||||
newVersion = parts[2];
|
||||
@@ -80,6 +82,7 @@ class UpgradePkgInfo {
|
||||
void _parseApk(String raw) {
|
||||
final parts = raw.split(' ');
|
||||
final len = parts.length;
|
||||
if (len < 2) throw Exception('Invalid apk output format');
|
||||
newVersion = parts[len - 1];
|
||||
nowVersion = parts[0];
|
||||
newVersion = newVersion.substring(0, newVersion.length - 1);
|
||||
|
||||
@@ -33,9 +33,11 @@ class Cpus extends TimeSeq<SingleCpuCore> {
|
||||
double usedPercent({int coreIdx = 0}) {
|
||||
if (now.length != pre.length) return 0;
|
||||
if (now.isEmpty) return 0;
|
||||
if (coreIdx >= now.length) return 0;
|
||||
try {
|
||||
final idleDelta = now[coreIdx].idle - pre[coreIdx].idle;
|
||||
final totalDelta = now[coreIdx].total - pre[coreIdx].total;
|
||||
if (totalDelta == 0) return 0;
|
||||
final used = idleDelta / totalDelta;
|
||||
return used.isNaN ? 0 : 100 - used * 100;
|
||||
} catch (e, s) {
|
||||
@@ -164,6 +166,7 @@ class SingleCpuCore extends TimeSeqIface<SingleCpuCore> {
|
||||
final id = item.split(' ').firstOrNull;
|
||||
if (id == null) continue;
|
||||
final matches = item.replaceFirst(id, '').trim().split(' ');
|
||||
if (matches.length < 7) continue;
|
||||
cpus.add(
|
||||
SingleCpuCore(
|
||||
id,
|
||||
|
||||
@@ -164,7 +164,8 @@ class NetSpeed extends TimeSeq<NetSpeedPart> {
|
||||
final bytesIn = BigInt.parse(bytes.first);
|
||||
final bytesOut = BigInt.parse(bytes[8]);
|
||||
results.add(NetSpeedPart(device, bytesIn, bytesOut, time));
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to parse net speed data: $item', e, s);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ class Proc {
|
||||
}
|
||||
|
||||
String get binary {
|
||||
final parts = command.split(' ');
|
||||
return parts[0];
|
||||
final parts = command.trim().split(' ').where((e) => e.isNotEmpty).toList();
|
||||
return parts.isNotEmpty ? parts[0] : '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ void _parseWindowsTemperatures(Temperatures temps, String raw) {
|
||||
if (typeLines.isNotEmpty && valueLines.isNotEmpty) {
|
||||
temps.parse(typeLines.join('\n'), valueLines.join('\n'));
|
||||
}
|
||||
} catch (e) {
|
||||
// If JSON parsing fails, ignore temperature data
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to parse Windows temperature data', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ class SftpReq {
|
||||
}
|
||||
try {
|
||||
knownHostFingerprints = Map<String, String>.from(Stores.setting.sshKnownHostFingerprints.get());
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to load SSH known host fingerprints', e, s);
|
||||
knownHostFingerprints = null;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +37,7 @@ class SftpReqStatus {
|
||||
late SftpWorker worker;
|
||||
final Completer? completer;
|
||||
|
||||
String get fileName => req.localPath.split('/').last;
|
||||
String get fileName => req.localPath.split(Pfs.seperator).last;
|
||||
|
||||
// status of the download
|
||||
double? progress;
|
||||
|
||||
@@ -70,7 +70,7 @@ Future<void> _download(SftpReq req, SendPort mainSendPort, SendErrorFunction sen
|
||||
mainSendPort.send(SftpWorkerStatus.sshConnectted);
|
||||
|
||||
/// Create the directory if not exists
|
||||
final dirPath = req.localPath.substring(0, req.localPath.lastIndexOf('/'));
|
||||
final dirPath = req.localPath.substring(0, req.localPath.lastIndexOf(Pfs.seperator));
|
||||
await Directory(dirPath).create(recursive: true);
|
||||
|
||||
/// Use [FileMode.write] to overwrite the file
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
import 'package:server_box/core/extension/ssh_client.dart';
|
||||
import 'package:server_box/data/model/app/error.dart';
|
||||
import 'package:server_box/data/model/app/scripts/script_consts.dart';
|
||||
@@ -18,6 +19,7 @@ part 'container.freezed.dart';
|
||||
part 'container.g.dart';
|
||||
|
||||
final _dockerNotFound = RegExp(r"command not found|Unknown command|Command '\w+' not found");
|
||||
final _podmanEmulationMsg = 'Emulate Docker CLI using podman';
|
||||
|
||||
@freezed
|
||||
abstract class ContainerState with _$ContainerState {
|
||||
@@ -84,21 +86,51 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
}
|
||||
final includeStats = Stores.setting.containerParseStat.fetch();
|
||||
|
||||
var raw = '';
|
||||
final cmd = _wrap(ContainerCmdType.execAll(state.type, sudo: sudo, includeStats: includeStats));
|
||||
final code = await client?.execWithPwd(
|
||||
cmd,
|
||||
context: context,
|
||||
onStdout: (data, _) => raw = '$raw$data',
|
||||
id: hostId,
|
||||
);
|
||||
int? code;
|
||||
String raw = '';
|
||||
final errs = <String>[];
|
||||
if (client != null) {
|
||||
(code, raw) = await client!.execWithPwd(cmd, context: context, id: hostId);
|
||||
} else {
|
||||
state = state.copyWith(
|
||||
isBusy: false,
|
||||
error: ContainerErr(type: ContainerErrType.noClient),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ref.mounted) return;
|
||||
state = state.copyWith(isBusy: false);
|
||||
|
||||
if (!context.mounted) return;
|
||||
|
||||
/// Code 127 means command not found
|
||||
if (code == 127 || raw.contains(_dockerNotFound)) {
|
||||
if (code == 127 || raw.contains(_dockerNotFound) || errs.join().contains(_dockerNotFound)) {
|
||||
state = state.copyWith(error: ContainerErr(type: ContainerErrType.notInstalled));
|
||||
return;
|
||||
}
|
||||
|
||||
/// Pre-parse Podman detection
|
||||
if (raw.contains(_podmanEmulationMsg)) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(
|
||||
type: ContainerErrType.podmanDetected,
|
||||
message: l10n.podmanDockerEmulationDetected,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
/// Filter out sudo password prompt from output
|
||||
if (errs.any((e) => e.contains('[sudo] password'))) {
|
||||
raw = raw.split('\n').where((line) => !line.contains('[sudo] password')).join('\n');
|
||||
}
|
||||
|
||||
/// Detect Podman not installed when using Podman mode
|
||||
if (state.type == ContainerType.podman &&
|
||||
(errs.any((e) => e.contains('podman: not found')) ||
|
||||
raw.contains('podman: not found'))) {
|
||||
state = state.copyWith(error: ContainerErr(type: ContainerErrType.notInstalled));
|
||||
return;
|
||||
}
|
||||
@@ -122,9 +154,11 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
final version = json.decode(verRaw)['Client']['Version'];
|
||||
state = state.copyWith(version: version, error: null);
|
||||
} catch (e, trace) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.invalidVersion, message: '$e'),
|
||||
);
|
||||
if (state.error == null) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.invalidVersion, message: '$e'),
|
||||
);
|
||||
}
|
||||
Loggers.app.warning('Container version failed', e, trace);
|
||||
}
|
||||
|
||||
@@ -140,9 +174,11 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
final items = lines.map((e) => ContainerPs.fromRaw(e, state.type)).toList();
|
||||
state = state.copyWith(items: items);
|
||||
} catch (e, trace) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parsePs, message: '$e'),
|
||||
);
|
||||
if (state.error == null) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parsePs, message: '$e'),
|
||||
);
|
||||
}
|
||||
Loggers.app.warning('Container ps failed', e, trace);
|
||||
}
|
||||
|
||||
@@ -162,9 +198,11 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
}
|
||||
state = state.copyWith(images: images);
|
||||
} catch (e, trace) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parseImages, message: '$e'),
|
||||
);
|
||||
if (state.error == null) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parseImages, message: '$e'),
|
||||
);
|
||||
}
|
||||
Loggers.app.warning('Container images failed', e, trace);
|
||||
}
|
||||
|
||||
@@ -186,12 +224,14 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
(element) => element.contains(id.substring(0, 5)),
|
||||
);
|
||||
if (statsLine == null) continue;
|
||||
item.parseStats(statsLine);
|
||||
item.parseStats(statsLine, state.version);
|
||||
}
|
||||
} catch (e, trace) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parseStats, message: '$e'),
|
||||
);
|
||||
if (state.error == null) {
|
||||
state = state.copyWith(
|
||||
error: ContainerErr(type: ContainerErrType.parseStats, message: '$e'),
|
||||
);
|
||||
}
|
||||
Loggers.app.warning('Parse docker stats: $statsRaw', e, trace);
|
||||
}
|
||||
}
|
||||
@@ -227,6 +267,10 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
}
|
||||
|
||||
Future<ContainerErr?> run(String cmd, {bool autoRefresh = true}) async {
|
||||
if (client == null) {
|
||||
return ContainerErr(type: ContainerErrType.noClient);
|
||||
}
|
||||
|
||||
cmd = switch (state.type) {
|
||||
ContainerType.docker => 'docker $cmd',
|
||||
ContainerType.podman => 'podman $cmd',
|
||||
@@ -234,7 +278,7 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
|
||||
state = state.copyWith(runLog: '');
|
||||
final errs = <String>[];
|
||||
final code = await client?.execWithPwd(
|
||||
final (code, _) = await client?.execWithPwd(
|
||||
_wrap((await sudoCompleter.future) ? 'sudo -S $cmd' : cmd),
|
||||
context: context,
|
||||
onStdout: (data, _) {
|
||||
@@ -242,7 +286,7 @@ class ContainerNotifier extends _$ContainerNotifier {
|
||||
},
|
||||
onStderr: (data, _) => errs.add(data),
|
||||
id: hostId,
|
||||
);
|
||||
) ?? (null, null);
|
||||
state = state.copyWith(runLog: null);
|
||||
|
||||
if (code != 0) {
|
||||
@@ -280,7 +324,7 @@ enum ContainerCmdType {
|
||||
return switch (this) {
|
||||
ContainerCmdType.version => '$prefix version $_jsonFmt',
|
||||
ContainerCmdType.ps => switch (type) {
|
||||
/// TODO: Rollback to json format when permformance recovers.
|
||||
/// TODO: Rollback to json format when performance recovers.
|
||||
/// Use [_jsonFmt] in Docker will cause the operation to slow down.
|
||||
ContainerType.docker =>
|
||||
'$prefix ps -a --format "table {{printf \\"'
|
||||
|
||||
@@ -58,7 +58,7 @@ final class ContainerNotifierProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$containerNotifierHash() => r'fea65e66499234b0a59bffff8d69c4ab8c93b2fd';
|
||||
String _$containerNotifierHash() => r'85457ec75264199c284572ee45beeaccba2044a1';
|
||||
|
||||
final class ContainerNotifierFamily extends $Family
|
||||
with
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:dartssh2/dartssh2.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
@@ -108,7 +107,7 @@ class PveNotifier extends _$PveNotifier {
|
||||
final newUrl = Uri.parse(
|
||||
addr,
|
||||
).replace(host: 'localhost', port: _localPort).toString();
|
||||
debugPrint('Forwarding $newUrl to $addr');
|
||||
dprint('Forwarding $newUrl to $addr');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,11 +234,15 @@ class PveNotifier extends _$PveNotifier {
|
||||
Future<void> dispose() async {
|
||||
try {
|
||||
await _serverSocket.close();
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to close server socket', e, s);
|
||||
}
|
||||
for (final forward in _forwards) {
|
||||
try {
|
||||
forward.close();
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to close forward', e, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ final class PveNotifierProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$pveNotifierHash() => r'ba5f2d6cb47c33735f7cc09b771b4a86501b86c6';
|
||||
String _$pveNotifierHash() => r'1e71faadee074b9c07bee731ef4ae6505e791967';
|
||||
|
||||
final class PveNotifierFamily extends $Family
|
||||
with $ClassFamilyOverride<PveNotifier, PveState, PveState, PveState, Spi> {
|
||||
|
||||
@@ -103,37 +103,44 @@ class ServersNotifier extends _$ServersNotifier {
|
||||
return;
|
||||
}
|
||||
|
||||
await Future.wait(
|
||||
state.servers.entries.map((entry) async {
|
||||
final serverId = entry.key;
|
||||
final spi = entry.value;
|
||||
final serversToRefresh = <MapEntry<String, Spi>>[];
|
||||
final idsToResetLimiter = <String>[];
|
||||
|
||||
if (onlyFailed) {
|
||||
final serverState = ref.read(serverProvider(serverId));
|
||||
if (serverState.conn != ServerConn.failed) return;
|
||||
TryLimiter.reset(serverId);
|
||||
}
|
||||
for (final entry in state.servers.entries) {
|
||||
final serverId = entry.key;
|
||||
final spi = entry.value;
|
||||
|
||||
if (state.manualDisconnectedIds.contains(serverId)) return;
|
||||
if (state.manualDisconnectedIds.contains(serverId)) continue;
|
||||
|
||||
final serverState = ref.read(serverProvider(serverId));
|
||||
if (serverState.conn == ServerConn.disconnected && !spi.autoConnect) {
|
||||
return;
|
||||
}
|
||||
final serverState = ref.read(serverProvider(serverId));
|
||||
|
||||
final serverNotifier = ref.read(serverProvider(serverId).notifier);
|
||||
await serverNotifier.refresh();
|
||||
}),
|
||||
);
|
||||
if (onlyFailed) {
|
||||
if (serverState.conn != ServerConn.failed) continue;
|
||||
idsToResetLimiter.add(serverId);
|
||||
}
|
||||
|
||||
if (serverState.conn == ServerConn.disconnected && !spi.autoConnect) continue;
|
||||
|
||||
serversToRefresh.add(entry);
|
||||
}
|
||||
|
||||
for (final id in idsToResetLimiter) {
|
||||
TryLimiter.reset(id);
|
||||
}
|
||||
|
||||
for (final entry in serversToRefresh) {
|
||||
final serverNotifier = ref.read(serverProvider(entry.key).notifier);
|
||||
serverNotifier.refresh().ignore();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> startAutoRefresh() async {
|
||||
var duration = Stores.setting.serverStatusUpdateInterval.fetch();
|
||||
stopAutoRefresh();
|
||||
if (duration == 0) return;
|
||||
if (duration < 0 || duration > 10 || duration == 1) {
|
||||
duration = 3;
|
||||
if (duration <= 1 || duration > 10) {
|
||||
Loggers.app.warning('Invalid duration: $duration, use default 3');
|
||||
duration = 3;
|
||||
}
|
||||
final timer = Timer.periodic(Duration(seconds: duration), (_) async {
|
||||
await refresh();
|
||||
@@ -145,8 +152,8 @@ class ServersNotifier extends _$ServersNotifier {
|
||||
final timer = state.autoRefreshTimer;
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
state = state.copyWith(autoRefreshTimer: null);
|
||||
}
|
||||
state = state.copyWith(autoRefreshTimer: null);
|
||||
}
|
||||
|
||||
bool get isAutoRefreshOn => state.autoRefreshTimer != null;
|
||||
|
||||
@@ -41,7 +41,7 @@ final class ServersNotifierProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$serversNotifierHash() => r'3292bdce7d602ff64687b05ff81d120e71761ec2';
|
||||
String _$serversNotifierHash() => r'dc5da44f9bd8d8dcfba3e6e932cca3e2f379e582';
|
||||
|
||||
abstract class _$ServersNotifier extends $Notifier<ServersState> {
|
||||
ServersState build();
|
||||
|
||||
@@ -35,7 +35,6 @@ abstract class ServerState with _$ServerState {
|
||||
required ServerStatus status,
|
||||
@Default(ServerConn.disconnected) ServerConn conn,
|
||||
SSHClient? client,
|
||||
Future<void>? updateFuture,
|
||||
}) = _ServerState;
|
||||
}
|
||||
|
||||
@@ -81,19 +80,16 @@ class ServerNotifier extends _$ServerNotifier {
|
||||
}
|
||||
|
||||
// Refresh server status
|
||||
bool _isRefreshing = false;
|
||||
|
||||
Future<void> refresh() async {
|
||||
if (state.updateFuture != null) {
|
||||
await state.updateFuture;
|
||||
return;
|
||||
}
|
||||
|
||||
final updateFuture = _updateServer();
|
||||
state = state.copyWith(updateFuture: updateFuture);
|
||||
if (_isRefreshing) return;
|
||||
|
||||
_isRefreshing = true;
|
||||
try {
|
||||
await updateFuture;
|
||||
await _updateServer();
|
||||
} finally {
|
||||
state = state.copyWith(updateFuture: null);
|
||||
_isRefreshing = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +288,7 @@ class ServerNotifier extends _$ServerNotifier {
|
||||
|
||||
try {
|
||||
final statusCmd = ShellFunc.status.exec(spi.id, systemType: state.status.system, customDir: spi.custom?.scriptDir);
|
||||
Loggers.app.info('Running status command for ${spi.name} (${state.status.system.name}): $statusCmd');
|
||||
// Loggers.app.info('Running status command for ${spi.name} (${state.status.system.name}): $statusCmd');
|
||||
final execResult = await state.client?.run(statusCmd);
|
||||
if (execResult != null) {
|
||||
raw = SSHDecoder.decode(
|
||||
@@ -300,7 +296,7 @@ class ServerNotifier extends _$ServerNotifier {
|
||||
isWindows: state.status.system == SystemType.windows,
|
||||
context: 'GetStatus<${spi.name}>',
|
||||
);
|
||||
Loggers.app.info('Status response length for ${spi.name}: ${raw.length} bytes');
|
||||
// Loggers.app.info('Status response length for ${spi.name}: ${raw.length} bytes');
|
||||
} else {
|
||||
raw = '';
|
||||
Loggers.app.warning('No status result from ${spi.name}');
|
||||
|
||||
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$ServerState {
|
||||
|
||||
Spi get spi; ServerStatus get status; ServerConn get conn; SSHClient? get client; Future<void>? get updateFuture;
|
||||
Spi get spi; ServerStatus get status; ServerConn get conn; SSHClient? get client;
|
||||
/// Create a copy of ServerState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -25,16 +25,16 @@ $ServerStateCopyWith<ServerState> get copyWith => _$ServerStateCopyWithImpl<Serv
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ServerState&&(identical(other.spi, spi) || other.spi == spi)&&(identical(other.status, status) || other.status == status)&&(identical(other.conn, conn) || other.conn == conn)&&(identical(other.client, client) || other.client == client)&&(identical(other.updateFuture, updateFuture) || other.updateFuture == updateFuture));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ServerState&&(identical(other.spi, spi) || other.spi == spi)&&(identical(other.status, status) || other.status == status)&&(identical(other.conn, conn) || other.conn == conn)&&(identical(other.client, client) || other.client == client));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,spi,status,conn,client,updateFuture);
|
||||
int get hashCode => Object.hash(runtimeType,spi,status,conn,client);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ServerState(spi: $spi, status: $status, conn: $conn, client: $client, updateFuture: $updateFuture)';
|
||||
return 'ServerState(spi: $spi, status: $status, conn: $conn, client: $client)';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract mixin class $ServerStateCopyWith<$Res> {
|
||||
factory $ServerStateCopyWith(ServerState value, $Res Function(ServerState) _then) = _$ServerStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
Spi spi, ServerStatus status, ServerConn conn, SSHClient? client, Future<void>? updateFuture
|
||||
Spi spi, ServerStatus status, ServerConn conn, SSHClient? client
|
||||
});
|
||||
|
||||
|
||||
@@ -62,14 +62,13 @@ class _$ServerStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of ServerState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? spi = null,Object? status = null,Object? conn = null,Object? client = freezed,Object? updateFuture = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? spi = null,Object? status = null,Object? conn = null,Object? client = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
spi: null == spi ? _self.spi : spi // ignore: cast_nullable_to_non_nullable
|
||||
as Spi,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as ServerStatus,conn: null == conn ? _self.conn : conn // ignore: cast_nullable_to_non_nullable
|
||||
as ServerConn,client: freezed == client ? _self.client : client // ignore: cast_nullable_to_non_nullable
|
||||
as SSHClient?,updateFuture: freezed == updateFuture ? _self.updateFuture : updateFuture // ignore: cast_nullable_to_non_nullable
|
||||
as Future<void>?,
|
||||
as SSHClient?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of ServerState
|
||||
@@ -163,10 +162,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client, Future<void>? updateFuture)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ServerState() when $default != null:
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFuture);case _:
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -184,10 +183,10 @@ return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFutur
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client, Future<void>? updateFuture) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ServerState():
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFuture);case _:
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -204,10 +203,10 @@ return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFutur
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client, Future<void>? updateFuture)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( Spi spi, ServerStatus status, ServerConn conn, SSHClient? client)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ServerState() when $default != null:
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFuture);case _:
|
||||
return $default(_that.spi,_that.status,_that.conn,_that.client);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -219,14 +218,13 @@ return $default(_that.spi,_that.status,_that.conn,_that.client,_that.updateFutur
|
||||
|
||||
|
||||
class _ServerState implements ServerState {
|
||||
const _ServerState({required this.spi, required this.status, this.conn = ServerConn.disconnected, this.client, this.updateFuture});
|
||||
const _ServerState({required this.spi, required this.status, this.conn = ServerConn.disconnected, this.client});
|
||||
|
||||
|
||||
@override final Spi spi;
|
||||
@override final ServerStatus status;
|
||||
@override@JsonKey() final ServerConn conn;
|
||||
@override final SSHClient? client;
|
||||
@override final Future<void>? updateFuture;
|
||||
|
||||
/// Create a copy of ServerState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -238,16 +236,16 @@ _$ServerStateCopyWith<_ServerState> get copyWith => __$ServerStateCopyWithImpl<_
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ServerState&&(identical(other.spi, spi) || other.spi == spi)&&(identical(other.status, status) || other.status == status)&&(identical(other.conn, conn) || other.conn == conn)&&(identical(other.client, client) || other.client == client)&&(identical(other.updateFuture, updateFuture) || other.updateFuture == updateFuture));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ServerState&&(identical(other.spi, spi) || other.spi == spi)&&(identical(other.status, status) || other.status == status)&&(identical(other.conn, conn) || other.conn == conn)&&(identical(other.client, client) || other.client == client));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,spi,status,conn,client,updateFuture);
|
||||
int get hashCode => Object.hash(runtimeType,spi,status,conn,client);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ServerState(spi: $spi, status: $status, conn: $conn, client: $client, updateFuture: $updateFuture)';
|
||||
return 'ServerState(spi: $spi, status: $status, conn: $conn, client: $client)';
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +256,7 @@ abstract mixin class _$ServerStateCopyWith<$Res> implements $ServerStateCopyWith
|
||||
factory _$ServerStateCopyWith(_ServerState value, $Res Function(_ServerState) _then) = __$ServerStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
Spi spi, ServerStatus status, ServerConn conn, SSHClient? client, Future<void>? updateFuture
|
||||
Spi spi, ServerStatus status, ServerConn conn, SSHClient? client
|
||||
});
|
||||
|
||||
|
||||
@@ -275,14 +273,13 @@ class __$ServerStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of ServerState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? spi = null,Object? status = null,Object? conn = null,Object? client = freezed,Object? updateFuture = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? spi = null,Object? status = null,Object? conn = null,Object? client = freezed,}) {
|
||||
return _then(_ServerState(
|
||||
spi: null == spi ? _self.spi : spi // ignore: cast_nullable_to_non_nullable
|
||||
as Spi,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as ServerStatus,conn: null == conn ? _self.conn : conn // ignore: cast_nullable_to_non_nullable
|
||||
as ServerConn,client: freezed == client ? _self.client : client // ignore: cast_nullable_to_non_nullable
|
||||
as SSHClient?,updateFuture: freezed == updateFuture ? _self.updateFuture : updateFuture // ignore: cast_nullable_to_non_nullable
|
||||
as Future<void>?,
|
||||
as SSHClient?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ final class ServerNotifierProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$serverNotifierHash() => r'185c6b4546c3bc526f5b2ca79d16aed665818863';
|
||||
String _$serverNotifierHash() => r'04b1beef4d96242fd10d5b523c6f5f17eb774bae';
|
||||
|
||||
final class ServerNotifierFamily extends $Family
|
||||
with
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
abstract class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 1276;
|
||||
static const int build = 1297;
|
||||
static const int script = 70;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ abstract final class GithubIds {
|
||||
'MasedMSD',
|
||||
'GitGitro',
|
||||
'Shin-suechtig',
|
||||
'GT-610'
|
||||
};
|
||||
|
||||
static const participants = <GhId>{
|
||||
|
||||
@@ -1885,6 +1885,60 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'After connecting to the server, a script will be written to `~/.config/server_box` \n | `/tmp/server_box` to monitor the system status. You can review the script content.'**
|
||||
String get writeScriptTip;
|
||||
|
||||
/// No description provided for @menuSettings.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Setting'**
|
||||
String get menuSettings;
|
||||
|
||||
/// No description provided for @menuQuit.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Quit'**
|
||||
String get menuQuit;
|
||||
|
||||
/// No description provided for @menuNavigate.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Navigate'**
|
||||
String get menuNavigate;
|
||||
|
||||
/// No description provided for @menuInfo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Info'**
|
||||
String get menuInfo;
|
||||
|
||||
/// No description provided for @menuGitHubRepository.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'GitHub Repository'**
|
||||
String get menuGitHubRepository;
|
||||
|
||||
/// No description provided for @menuWiki.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Wiki'**
|
||||
String get menuWiki;
|
||||
|
||||
/// No description provided for @menuHelp.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Help'**
|
||||
String get menuHelp;
|
||||
|
||||
/// No description provided for @logs.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Logs'**
|
||||
String get logs;
|
||||
|
||||
/// No description provided for @podmanDockerEmulationDetected.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Podman Docker emulation detected. Please switch to Podman in settings.'**
|
||||
String get podmanDockerEmulationDetected;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -1007,4 +1007,32 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Nach der Verbindung mit dem Server wird ein Skript in `~/.config/server_box` \n | `/tmp/server_box` geschrieben, um den Systemstatus zu überwachen. Sie können den Skriptinhalt überprüfen.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Protokolle';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Podman Docker-Emulation erkannt. Bitte wechseln Sie in den Einstellungen zu Podman.';
|
||||
}
|
||||
|
||||
@@ -998,4 +998,32 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'After connecting to the server, a script will be written to `~/.config/server_box` \n | `/tmp/server_box` to monitor the system status. You can review the script content.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Logs';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Podman Docker emulation detected. Please switch to Podman in settings.';
|
||||
}
|
||||
|
||||
@@ -1009,4 +1009,32 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Después de conectarse al servidor, se escribirá un script en `~/.config/server_box` \n | `/tmp/server_box` para monitorear el estado del sistema. Puedes revisar el contenido del script.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Registros';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Detectada emulación de Podman Docker. Por favor, cambie a Podman en la configuración.';
|
||||
}
|
||||
|
||||
@@ -1012,4 +1012,32 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Après la connexion au serveur, un script sera écrit dans `~/.config/server_box` \n | `/tmp/server_box` pour surveiller l\'état du système. Vous pouvez examiner le contenu du script.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Journaux';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Émulation Podman Docker détectée. Veuillez passer à Podman dans les paramètres.';
|
||||
}
|
||||
|
||||
@@ -998,4 +998,32 @@ class AppLocalizationsId extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Setelah terhubung ke server, sebuah skrip akan ditulis ke `~/.config/server_box` \n | `/tmp/server_box` untuk memantau status sistem. Anda dapat meninjau konten skrip tersebut.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Log';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Emulasi Podman Docker terdeteksi. Silakan beralih ke Podman di pengaturan.';
|
||||
}
|
||||
|
||||
@@ -967,5 +967,33 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'サーバーに接続すると、システムの状態を監視するためのスクリプトが `~/.config/server_box` \n | `/tmp/server_box` に書き込まれます。スクリプトの内容を確認できます。';
|
||||
'サーバーへの接続後、システムステータスを監視するスクリプトが `~/.config/server_box` \n | `/tmp/server_box` に書き込まれます。スクリプトの内容を確認できます。';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'ログ';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Podman Docker エミュレーションが検出されました。設定で Podman に切り替えてください。';
|
||||
}
|
||||
|
||||
@@ -1005,4 +1005,32 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Na het verbinden met de server wordt een script geschreven naar `~/.config/server_box` \n | `/tmp/server_box` om de systeemstatus te monitoren. U kunt de inhoud van het script controleren.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Logboeken';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Podman Docker-emulatie gedetecteerd. Schakel over naar Podman in de instellingen.';
|
||||
}
|
||||
|
||||
@@ -1000,4 +1000,32 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Após conectar ao servidor, um script será escrito em `~/.config/server_box` \n | `/tmp/server_box` para monitorar o status do sistema. Você pode revisar o conteúdo do script.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Logs';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Emulação Podman Docker detectada. Por favor, alterne para Podman nas configurações.';
|
||||
}
|
||||
|
||||
@@ -1004,4 +1004,32 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'После подключения к серверу скрипт будет записан в `~/.config/server_box` \n | `/tmp/server_box` для мониторинга состояния системы. Вы можете проверить содержимое скрипта.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Журналы';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Обнаружена эмуляция Podman Docker. Пожалуйста, переключитесь на Podman в настройках.';
|
||||
}
|
||||
|
||||
@@ -999,4 +999,32 @@ class AppLocalizationsTr extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Sunucuya bağlandıktan sonra, sistem durumunu izlemek için `~/.config/server_box` \n | `/tmp/server_box` dizinine bir betik yazılacak. Betik içeriğini inceleyebilirsiniz.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Günlükler';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Podman Docker emülasyonu tespit edildi. Lütfen ayarlarda Podman\'a geçin.';
|
||||
}
|
||||
|
||||
@@ -1004,4 +1004,32 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'Після підключення до сервера скрипт буде записано у `~/.config/server_box` \n | `/tmp/server_box` для моніторингу стану системи. Ви можете переглянути вміст скрипта.';
|
||||
|
||||
@override
|
||||
String get menuSettings => 'Setting';
|
||||
|
||||
@override
|
||||
String get menuQuit => 'Quit';
|
||||
|
||||
@override
|
||||
String get menuNavigate => 'Navigate';
|
||||
|
||||
@override
|
||||
String get menuInfo => 'Info';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub Repository';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => 'Help';
|
||||
|
||||
@override
|
||||
String get logs => 'Журнали';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'Виявлено емуляцію Podman Docker. Будь ласка, переключіться на Podman у налаштуваннях.';
|
||||
}
|
||||
|
||||
@@ -953,6 +953,34 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'在连接服务器后,会向 `~/.config/server_box` \n | `/tmp/server_box` 写入脚本来监测系统状态,你可以审查脚本内容。';
|
||||
|
||||
@override
|
||||
String get menuSettings => '设置';
|
||||
|
||||
@override
|
||||
String get menuQuit => '退出';
|
||||
|
||||
@override
|
||||
String get menuNavigate => '导航';
|
||||
|
||||
@override
|
||||
String get menuInfo => '信息';
|
||||
|
||||
@override
|
||||
String get menuGitHubRepository => 'GitHub 仓库';
|
||||
|
||||
@override
|
||||
String get menuWiki => 'Wiki';
|
||||
|
||||
@override
|
||||
String get menuHelp => '帮助';
|
||||
|
||||
@override
|
||||
String get logs => '日志';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'检测到 Podman Docker 仿真。请在设置中切换到 Podman。';
|
||||
}
|
||||
|
||||
/// The translations for Chinese, as used in Taiwan (`zh_TW`).
|
||||
@@ -1904,4 +1932,11 @@ class AppLocalizationsZhTw extends AppLocalizationsZh {
|
||||
@override
|
||||
String get writeScriptTip =>
|
||||
'連線到伺服器後,將會在 `~/.config/server_box` \n | `/tmp/server_box` 中寫入一個腳本來監測系統狀態。你可以審查腳本內容。';
|
||||
|
||||
@override
|
||||
String get logs => '日誌';
|
||||
|
||||
@override
|
||||
String get podmanDockerEmulationDetected =>
|
||||
'檢測到 Podman Docker 仿真。請在設定中切換到 Podman。';
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Nach der Konfiguration von WOL (Wake-on-LAN) wird jedes Mal, wenn der Server verbunden wird, eine WOL-Anfrage gesendet.",
|
||||
"write": "Schreiben",
|
||||
"writeScriptFailTip": "Das Schreiben des Skripts ist fehlgeschlagen, möglicherweise aufgrund fehlender Berechtigungen oder das Verzeichnis existiert nicht.",
|
||||
"writeScriptTip": "Nach der Verbindung mit dem Server wird ein Skript in `~/.config/server_box` \n | `/tmp/server_box` geschrieben, um den Systemstatus zu überwachen. Sie können den Skriptinhalt überprüfen."
|
||||
"writeScriptTip": "Nach der Verbindung mit dem Server wird ein Skript in `~/.config/server_box` \n | `/tmp/server_box` geschrieben, um den Systemstatus zu überwachen. Sie können den Skriptinhalt überprüfen.",
|
||||
"logs": "Protokolle",
|
||||
"podmanDockerEmulationDetected": "Podman Docker-Emulation erkannt. Bitte wechseln Sie in den Einstellungen zu Podman."
|
||||
}
|
||||
|
||||
@@ -296,5 +296,14 @@
|
||||
"wolTip": "After configuring WOL (Wake-on-LAN), a WOL request is sent each time the server is connected.",
|
||||
"write": "Write",
|
||||
"writeScriptFailTip": "Writing to the script failed, possibly due to lack of permissions or the directory does not exist.",
|
||||
"writeScriptTip": "After connecting to the server, a script will be written to `~/.config/server_box` \n | `/tmp/server_box` to monitor the system status. You can review the script content."
|
||||
"writeScriptTip": "After connecting to the server, a script will be written to `~/.config/server_box` \n | `/tmp/server_box` to monitor the system status. You can review the script content.",
|
||||
"menuSettings": "Setting",
|
||||
"menuQuit": "Quit",
|
||||
"menuNavigate": "Navigate",
|
||||
"menuInfo": "Info",
|
||||
"menuGitHubRepository": "GitHub Repository",
|
||||
"menuWiki": "Wiki",
|
||||
"menuHelp": "Help",
|
||||
"logs": "Logs",
|
||||
"podmanDockerEmulationDetected": "Podman Docker emulation detected. Please switch to Podman in settings."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Después de configurar WOL (Wake-on-LAN), se envía una solicitud de WOL cada vez que se conecta el servidor.",
|
||||
"write": "Escribir",
|
||||
"writeScriptFailTip": "La escritura en el script falló, posiblemente por falta de permisos o porque el directorio no existe.",
|
||||
"writeScriptTip": "Después de conectarse al servidor, se escribirá un script en `~/.config/server_box` \n | `/tmp/server_box` para monitorear el estado del sistema. Puedes revisar el contenido del script."
|
||||
"writeScriptTip": "Después de conectarse al servidor, se escribirá un script en `~/.config/server_box` \n | `/tmp/server_box` para monitorear el estado del sistema. Puedes revisar el contenido del script.",
|
||||
"logs": "Registros",
|
||||
"podmanDockerEmulationDetected": "Detectada emulación de Podman Docker. Por favor, cambie a Podman en la configuración."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Après avoir configuré le WOL (Wake-on-LAN), une requête WOL est envoyée chaque fois que le serveur est connecté.",
|
||||
"write": "Écrire",
|
||||
"writeScriptFailTip": "Échec de l'écriture dans le script, probablement en raison d'un manque de permissions ou que le répertoire n'existe pas.",
|
||||
"writeScriptTip": "Après la connexion au serveur, un script sera écrit dans `~/.config/server_box` \n | `/tmp/server_box` pour surveiller l'état du système. Vous pouvez examiner le contenu du script."
|
||||
"writeScriptTip": "Après la connexion au serveur, un script sera écrit dans `~/.config/server_box` \n | `/tmp/server_box` pour surveiller l'état du système. Vous pouvez examiner le contenu du script.",
|
||||
"logs": "Journaux",
|
||||
"podmanDockerEmulationDetected": "Émulation Podman Docker détectée. Veuillez passer à Podman dans les paramètres."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Setelah mengonfigurasi WOL (Wake-on-LAN), permintaan WOL dikirim setiap kali server terhubung.",
|
||||
"write": "Tulis",
|
||||
"writeScriptFailTip": "Penulisan ke skrip gagal, mungkin karena tidak ada izin atau direktori tidak ada.",
|
||||
"writeScriptTip": "Setelah terhubung ke server, sebuah skrip akan ditulis ke `~/.config/server_box` \n | `/tmp/server_box` untuk memantau status sistem. Anda dapat meninjau konten skrip tersebut."
|
||||
"writeScriptTip": "Setelah terhubung ke server, sebuah skrip akan ditulis ke `~/.config/server_box` \n | `/tmp/server_box` untuk memantau status sistem. Anda dapat meninjau konten skrip tersebut.",
|
||||
"logs": "Log",
|
||||
"podmanDockerEmulationDetected": "Emulasi Podman Docker terdeteksi. Silakan beralih ke Podman di pengaturan."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "WOL(Wake-on-LAN)を設定した後、サーバーに接続するたびにWOLリクエストが送信されます。",
|
||||
"write": "書き込み",
|
||||
"writeScriptFailTip": "スクリプトの書き込みに失敗しました。権限がないかディレクトリが存在しない可能性があります。",
|
||||
"writeScriptTip": "サーバーに接続すると、システムの状態を監視するためのスクリプトが `~/.config/server_box` \n | `/tmp/server_box` に書き込まれます。スクリプトの内容を確認できます。"
|
||||
"writeScriptTip": "サーバーへの接続後、システムステータスを監視するスクリプトが `~/.config/server_box` \n | `/tmp/server_box` に書き込まれます。スクリプトの内容を確認できます。",
|
||||
"logs": "ログ",
|
||||
"podmanDockerEmulationDetected": "Podman Docker エミュレーションが検出されました。設定で Podman に切り替えてください。"
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Na het configureren van WOL (Wake-on-LAN), wordt elke keer dat de server wordt verbonden een WOL-verzoek verzonden.",
|
||||
"write": "Schrijven",
|
||||
"writeScriptFailTip": "Het schrijven naar het script is mislukt, mogelijk door gebrek aan rechten of omdat de map niet bestaat.",
|
||||
"writeScriptTip": "Na het verbinden met de server wordt een script geschreven naar `~/.config/server_box` \n | `/tmp/server_box` om de systeemstatus te monitoren. U kunt de inhoud van het script controleren."
|
||||
"writeScriptTip": "Na het verbinden met de server wordt een script geschreven naar `~/.config/server_box` \n | `/tmp/server_box` om de systeemstatus te monitoren. U kunt de inhoud van het script controleren.",
|
||||
"logs": "Logboeken",
|
||||
"podmanDockerEmulationDetected": "Podman Docker-emulatie gedetecteerd. Schakel over naar Podman in de instellingen."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Após configurar o WOL (Wake-on-LAN), um pedido de WOL é enviado cada vez que o servidor é conectado.",
|
||||
"write": "Escrita",
|
||||
"writeScriptFailTip": "Falha ao escrever no script, possivelmente devido à falta de permissões ou o diretório não existe.",
|
||||
"writeScriptTip": "Após conectar ao servidor, um script será escrito em `~/.config/server_box` \n | `/tmp/server_box` para monitorar o status do sistema. Você pode revisar o conteúdo do script."
|
||||
"writeScriptTip": "Após conectar ao servidor, um script será escrito em `~/.config/server_box` \n | `/tmp/server_box` para monitorar o status do sistema. Você pode revisar o conteúdo do script.",
|
||||
"logs": "Logs",
|
||||
"podmanDockerEmulationDetected": "Emulação Podman Docker detectada. Por favor, alterne para Podman nas configurações."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "После настройки WOL (Wake-on-LAN) при каждом подключении к серверу отправляется запрос WOL.",
|
||||
"write": "Запись",
|
||||
"writeScriptFailTip": "Запись скрипта не удалась, возможно, из-за отсутствия прав или потому что, директории не существует.",
|
||||
"writeScriptTip": "После подключения к серверу скрипт будет записан в `~/.config/server_box` \n | `/tmp/server_box` для мониторинга состояния системы. Вы можете проверить содержимое скрипта."
|
||||
"writeScriptTip": "После подключения к серверу скрипт будет записан в `~/.config/server_box` \n | `/tmp/server_box` для мониторинга состояния системы. Вы можете проверить содержимое скрипта.",
|
||||
"logs": "Журналы",
|
||||
"podmanDockerEmulationDetected": "Обнаружена эмуляция Podman Docker. Пожалуйста, переключитесь на Podman в настройках."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "WOL (Wake-on-LAN) yapılandırıldıktan sonra, sunucuya her bağlanıldığında bir WOL isteği gönderilir.",
|
||||
"write": "Yaz",
|
||||
"writeScriptFailTip": "Betik yazma başarısız oldu, muhtemelen izin eksikliği veya dizin mevcut değil.",
|
||||
"writeScriptTip": "Sunucuya bağlandıktan sonra, sistem durumunu izlemek için `~/.config/server_box` \n | `/tmp/server_box` dizinine bir betik yazılacak. Betik içeriğini inceleyebilirsiniz."
|
||||
"writeScriptTip": "Sunucuya bağlandıktan sonra, sistem durumunu izlemek için `~/.config/server_box` \n | `/tmp/server_box` dizinine bir betik yazılacak. Betik içeriğini inceleyebilirsiniz.",
|
||||
"logs": "Günlükler",
|
||||
"podmanDockerEmulationDetected": "Podman Docker emülasyonu tespit edildi. Lütfen ayarlarda Podman'a geçin."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "Після налаштування WOL (Wake-on-LAN), при кожному підключенні до сервера відправляється запит WOL.",
|
||||
"write": "Записати",
|
||||
"writeScriptFailTip": "Запис у скрипт не вдався, можливо, через брак дозволів або каталог не існує.",
|
||||
"writeScriptTip": "Після підключення до сервера скрипт буде записано у `~/.config/server_box` \n | `/tmp/server_box` для моніторингу стану системи. Ви можете переглянути вміст скрипта."
|
||||
"writeScriptTip": "Після підключення до сервера скрипт буде записано у `~/.config/server_box` \n | `/tmp/server_box` для моніторингу стану системи. Ви можете переглянути вміст скрипта.",
|
||||
"logs": "Журнали",
|
||||
"podmanDockerEmulationDetected": "Виявлено емуляцію Podman Docker. Будь ласка, переключіться на Podman у налаштуваннях."
|
||||
}
|
||||
|
||||
@@ -293,5 +293,14 @@
|
||||
"wolTip": "配置 WOL 后,每次连接服务器时将自动发送唤醒请求",
|
||||
"write": "写",
|
||||
"writeScriptFailTip": "写入脚本失败,可能是没有权限/目录不存在等",
|
||||
"writeScriptTip": "在连接服务器后,会向 `~/.config/server_box` \n | `/tmp/server_box` 写入脚本来监测系统状态,你可以审查脚本内容。"
|
||||
"writeScriptTip": "在连接服务器后,会向 `~/.config/server_box` \n | `/tmp/server_box` 写入脚本来监测系统状态,你可以审查脚本内容。",
|
||||
"menuSettings": "设置",
|
||||
"menuQuit": "退出",
|
||||
"menuNavigate": "导航",
|
||||
"menuInfo": "信息",
|
||||
"menuGitHubRepository": "GitHub 仓库",
|
||||
"menuWiki": "Wiki",
|
||||
"menuHelp": "帮助",
|
||||
"logs": "日志",
|
||||
"podmanDockerEmulationDetected": "检测到 Podman Docker 仿真。请在设置中切换到 Podman。"
|
||||
}
|
||||
|
||||
@@ -293,5 +293,7 @@
|
||||
"wolTip": "設定 WOL 後,每次連線伺服器時將自動發送喚醒請求",
|
||||
"write": "寫入",
|
||||
"writeScriptFailTip": "寫入腳本失敗,可能是沒有權限/目錄不存在等。",
|
||||
"writeScriptTip": "連線到伺服器後,將會在 `~/.config/server_box` \n | `/tmp/server_box` 中寫入一個腳本來監測系統狀態。你可以審查腳本內容。"
|
||||
"writeScriptTip": "連線到伺服器後,將會在 `~/.config/server_box` \n | `/tmp/server_box` 中寫入一個腳本來監測系統狀態。你可以審查腳本內容。",
|
||||
"logs": "日誌",
|
||||
"podmanDockerEmulationDetected": "檢測到 Podman Docker 仿真。請在設定中切換到 Podman。"
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ void _setupDebug() {
|
||||
Logger.root.level = Level.ALL;
|
||||
Logger.root.onRecord.listen((record) {
|
||||
DebugProvider.addLog(record);
|
||||
lprint(record);
|
||||
if (record.error != null) print(record.error);
|
||||
if (record.stackTrace != null) print(record.stackTrace);
|
||||
});
|
||||
|
||||
@@ -219,7 +219,7 @@ extension on _ContainerPageState {
|
||||
'${switch (_containerState.type) {
|
||||
ContainerType.podman => 'podman',
|
||||
ContainerType.docker => 'docker',
|
||||
}} exec -it ${dItem.id} sh',
|
||||
}} exec -it ${dItem.id} sh -c "command -v bash && exec bash || command -v ash && exec ash || exec sh"',
|
||||
);
|
||||
SSHPage.route.go(context, args);
|
||||
break;
|
||||
|
||||
@@ -234,7 +234,7 @@ class _ContainerPageState extends ConsumerState<ContainerPage> {
|
||||
if (item.cpu == null || item.mem == null) return UIs.placeholder;
|
||||
return LayoutBuilder(
|
||||
builder: (_, cons) {
|
||||
final width = cons.maxWidth / 2 - 41;
|
||||
final width = cons.maxWidth / 2 - 6.5;
|
||||
return Column(
|
||||
children: [
|
||||
UIs.height13,
|
||||
@@ -264,10 +264,17 @@ class _ContainerPageState extends ConsumerState<ContainerPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(icon, size: 12, color: Colors.grey),
|
||||
UIs.width7,
|
||||
Text(value ?? l10n.unknown, style: UIs.text11Grey),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value ?? l10n.unknown,
|
||||
style: UIs.text11Grey,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/foundation.dart' show kReleaseMode;
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -5,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:server_box/core/chan.dart';
|
||||
import 'package:server_box/core/sync.dart';
|
||||
import 'package:server_box/data/model/app/menu/platform.dart';
|
||||
import 'package:server_box/data/model/app/tab.dart';
|
||||
import 'package:server_box/data/provider/server/all.dart';
|
||||
import 'package:server_box/data/res/build_data.dart';
|
||||
@@ -134,7 +137,7 @@ class _HomePageState extends ConsumerState<HomePage>
|
||||
super.build(context);
|
||||
final isMobile = ResponsiveBreakpoints.of(context).isMobile;
|
||||
|
||||
return Scaffold(
|
||||
final Widget mainContent = Scaffold(
|
||||
appBar: _AppBar(MediaQuery.paddingOf(context).top),
|
||||
body: Row(
|
||||
children: [
|
||||
@@ -157,6 +160,16 @@ class _HomePageState extends ConsumerState<HomePage>
|
||||
),
|
||||
bottomNavigationBar: isMobile ? _buildBottomBar() : null,
|
||||
);
|
||||
|
||||
if (Platform.isMacOS) {
|
||||
return PlatformMenuBar(
|
||||
menus: MacOSMenuBarManager.buildMenuBar(context, (int index) {
|
||||
_onDestinationSelected(index);
|
||||
}),
|
||||
child: mainContent,
|
||||
);
|
||||
}
|
||||
return mainContent;
|
||||
}
|
||||
|
||||
Widget _buildBottomBar() {
|
||||
|
||||
@@ -63,6 +63,9 @@ class _ServerDetailPageState extends ConsumerState<ServerDetailPage> with Single
|
||||
final _netSortType = ValueNotifier(_NetSortType.device);
|
||||
late final _collapse = _settings.collapseUIDefault.fetch();
|
||||
late final _textFactor = TextScaler.linear(_settings.textFactor.fetch());
|
||||
late final _cpuViewAsProgress = _settings.cpuViewAsProgress.fetch();
|
||||
late final _moveServerFuncs = _settings.moveServerFuncs.fetch();
|
||||
late final _displayCpuIndex = _settings.displayCpuIndex.fetch();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -97,7 +100,7 @@ class _ServerDetailPageState extends ConsumerState<ServerDetailPage> with Single
|
||||
}
|
||||
|
||||
Widget _buildMainPage(ServerState si) {
|
||||
final buildFuncs = !Stores.setting.moveServerFuncs.fetch();
|
||||
final buildFuncs = !_moveServerFuncs;
|
||||
final logo = _buildLogo(si);
|
||||
final children = <Widget>[if (logo != null) logo, if (buildFuncs) ServerFuncBtns(spi: si.spi)];
|
||||
for (final card in _cardsOrder) {
|
||||
@@ -197,7 +200,7 @@ class _ServerDetailPageState extends ConsumerState<ServerDetailPage> with Single
|
||||
]);
|
||||
}
|
||||
|
||||
final List<Widget> children = Stores.setting.cpuViewAsProgress.fetch()
|
||||
final List<Widget> children = _cpuViewAsProgress
|
||||
? _buildCPUProgress(ss.cpu)
|
||||
: [_buildCPUChart(ss)];
|
||||
|
||||
@@ -258,7 +261,7 @@ class _ServerDetailPageState extends ConsumerState<ServerDetailPage> with Single
|
||||
const kRowThreshold = 4;
|
||||
const kCoresCountThreshold = kMaxColumn * kRowThreshold;
|
||||
final children = <Widget>[];
|
||||
final displayCpuIndexSetting = Stores.setting.displayCpuIndex.fetch();
|
||||
final displayCpuIndexSetting = _displayCpuIndex;
|
||||
|
||||
if (cs.coresCount > kCoresCountThreshold) {
|
||||
final numCoresToDisplay = cs.coresCount - 1;
|
||||
|
||||
@@ -346,6 +346,6 @@ class _ServerPageState extends ConsumerState<ServerPage>
|
||||
|
||||
static const _kCardHeightMin = 23.0;
|
||||
static const _kCardHeightFlip = 99.0;
|
||||
static const _kCardHeightNormal = 108.0;
|
||||
static const _kCardHeightNormal = 110.0;
|
||||
static const _kCardHeightMoveOutFuncs = 135.0;
|
||||
}
|
||||
|
||||
@@ -49,11 +49,12 @@ extension _Operation on _ServerPageState {
|
||||
await context.showRoundDialog(title: libL10n.attention, child: Text(l10n.suspendTip));
|
||||
Stores.setting.showSuspendTip.put(false);
|
||||
}
|
||||
srv.client?.execWithPwd(
|
||||
await srv.client?.execWithPwd(
|
||||
ShellFunc.suspend.exec(srv.spi.id, systemType: srv.status.system, customDir: null),
|
||||
context: context,
|
||||
id: srv.id,
|
||||
);
|
||||
) ??
|
||||
(null, '');
|
||||
},
|
||||
typ: l10n.suspend,
|
||||
name: srv.spi.name,
|
||||
@@ -62,11 +63,13 @@ extension _Operation on _ServerPageState {
|
||||
|
||||
void _onTapShutdown(ServerState srv) {
|
||||
_askFor(
|
||||
func: () => srv.client?.execWithPwd(
|
||||
ShellFunc.shutdown.exec(srv.spi.id, systemType: srv.status.system, customDir: null),
|
||||
context: context,
|
||||
id: srv.id,
|
||||
),
|
||||
func: () async {
|
||||
await srv.client?.execWithPwd(
|
||||
ShellFunc.shutdown.exec(srv.spi.id, systemType: srv.status.system, customDir: null),
|
||||
context: context,
|
||||
id: srv.id,
|
||||
);
|
||||
},
|
||||
typ: l10n.shutdown,
|
||||
name: srv.spi.name,
|
||||
);
|
||||
@@ -74,11 +77,14 @@ extension _Operation on _ServerPageState {
|
||||
|
||||
void _onTapReboot(ServerState srv) {
|
||||
_askFor(
|
||||
func: () => srv.client?.execWithPwd(
|
||||
ShellFunc.reboot.exec(srv.spi.id, systemType: srv.status.system, customDir: null),
|
||||
context: context,
|
||||
id: srv.id,
|
||||
),
|
||||
func: () async {
|
||||
await srv.client?.execWithPwd(
|
||||
ShellFunc.reboot.exec(srv.spi.id, systemType: srv.status.system, customDir: null),
|
||||
context: context,
|
||||
id: srv.id,
|
||||
) ??
|
||||
(null, '');
|
||||
},
|
||||
typ: l10n.reboot,
|
||||
name: srv.spi.name,
|
||||
);
|
||||
|
||||
@@ -94,19 +94,33 @@ extension _App on _AppSettingsPageState {
|
||||
}),
|
||||
onTap: () {
|
||||
withTextFieldController((ctrl) async {
|
||||
ctrl.text = Color(_setting.colorSeed.fetch()).toHex;
|
||||
await context.showRoundDialog(
|
||||
title: libL10n.primaryColorSeed,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
final children = <Widget>[
|
||||
/// Plugin [dynamic_color] is not supported on iOS
|
||||
if (!isIOS)
|
||||
ListTile(
|
||||
title: Text(l10n.followSystem),
|
||||
trailing: StoreSwitch(
|
||||
prop: _setting.useSystemPrimaryColor,
|
||||
callback: (_) => setState(() {}),
|
||||
),
|
||||
DynamicColorBuilder(
|
||||
builder: (light, dark) {
|
||||
final supported = light != null || dark != null;
|
||||
if (!supported) {
|
||||
if (!_setting.useSystemPrimaryColor.fetch()) {
|
||||
_setting.useSystemPrimaryColor.put(false);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return ListTile(
|
||||
title: Text(l10n.followSystem),
|
||||
trailing: StoreSwitch(
|
||||
prop: _setting.useSystemPrimaryColor,
|
||||
callback: (_) => setState(() {}),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
];
|
||||
if (!_setting.useSystemPrimaryColor.fetch()) {
|
||||
@@ -129,12 +143,22 @@ extension _App on _AppSettingsPageState {
|
||||
|
||||
void _onSaveColor(String s) {
|
||||
final color = s.fromColorHex;
|
||||
|
||||
if (color == null) {
|
||||
context.showSnackBar(libL10n.fail);
|
||||
return;
|
||||
}
|
||||
UIs.colorSeed = color;
|
||||
|
||||
// Save the color seed to settings
|
||||
_setting.colorSeed.put(color.value255);
|
||||
|
||||
// Only update UIs colors if we're not in system mode
|
||||
if (!_setting.useSystemPrimaryColor.fetch()) {
|
||||
UIs.primaryColor = color;
|
||||
UIs.colorSeed = color;
|
||||
}
|
||||
|
||||
RNodes.app.notify();
|
||||
context.pop();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_highlight/theme_map.dart';
|
||||
@@ -28,6 +29,7 @@ import 'package:server_box/view/page/setting/seq/srv_seq.dart';
|
||||
import 'package:server_box/view/page/setting/seq/virt_key.dart';
|
||||
|
||||
part 'about.dart';
|
||||
part 'entries/ai.dart';
|
||||
part 'entries/app.dart';
|
||||
part 'entries/container.dart';
|
||||
part 'entries/editor.dart';
|
||||
@@ -35,7 +37,6 @@ part 'entries/full_screen.dart';
|
||||
part 'entries/server.dart';
|
||||
part 'entries/sftp.dart';
|
||||
part 'entries/ssh.dart';
|
||||
part 'entries/ai.dart';
|
||||
|
||||
const _kIconSize = 23.0;
|
||||
|
||||
@@ -71,9 +72,9 @@ class _SettingsPageState extends ConsumerState<SettingsPage> with SingleTickerPr
|
||||
),
|
||||
actions: [
|
||||
Btn.text(
|
||||
text: 'Logs',
|
||||
text: context.l10n.logs,
|
||||
onTap: () =>
|
||||
DebugPage.route.go(context, args: const DebugPageArgs(title: 'Logs(${BuildData.build})')),
|
||||
DebugPage.route.go(context, args: DebugPageArgs(title: '${context.l10n.logs}(${BuildData.build})')),
|
||||
),
|
||||
Btn.icon(
|
||||
icon: const Icon(Icons.delete),
|
||||
|
||||
@@ -62,6 +62,7 @@ class _SnippetListPageState extends ConsumerState<SnippetListPage> with Automati
|
||||
tags: snippetState.tags.vn,
|
||||
onTagChanged: (tag) => _tag.value = tag,
|
||||
initTag: _tag.value,
|
||||
singleLine: true,
|
||||
),
|
||||
body: _buildSnippetList(snippets, tag),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
|
||||
@@ -84,6 +84,7 @@ class _AskAiSheetState extends ConsumerState<_AskAiSheet> {
|
||||
String? _streamingContent;
|
||||
String? _error;
|
||||
bool _isStreaming = false;
|
||||
bool _isMinimized = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -250,6 +251,13 @@ class _AskAiSheetState extends ConsumerState<_AskAiSheet> {
|
||||
context.showSnackBar(libL10n.success);
|
||||
}
|
||||
|
||||
Future<void> _copyText(BuildContext context, String text) async {
|
||||
if (text.trim().isEmpty) return;
|
||||
await Clipboard.setData(ClipboardData(text: text));
|
||||
if (!mounted) return;
|
||||
context.showSnackBar(libL10n.success);
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
if (_isStreaming) return;
|
||||
final text = _inputController.text.trim();
|
||||
@@ -310,7 +318,23 @@ class _AskAiSheetState extends ConsumerState<_AskAiSheet> {
|
||||
streaming ? l10n.askAiAwaitingResponse : l10n.askAiNoResponse,
|
||||
style: theme.textTheme.bodySmall,
|
||||
)
|
||||
: SimpleMarkdown(data: content);
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SimpleMarkdown(data: content),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton.icon(
|
||||
onPressed: () => _copyText(context, content),
|
||||
icon: const Icon(Icons.copy, size: 18),
|
||||
label: Text(libL10n.copy),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: CardX(
|
||||
@@ -364,12 +388,23 @@ class _AskAiSheetState extends ConsumerState<_AskAiSheet> {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final bottomPadding = MediaQuery.viewInsetsOf(context).bottom;
|
||||
final heightFactor = _isMinimized ? 0.18 : 0.85;
|
||||
|
||||
return FractionallySizedBox(
|
||||
heightFactor: 0.85,
|
||||
return TweenAnimationBuilder<double>(
|
||||
tween: Tween<double>(end: heightFactor),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeOutCubic,
|
||||
builder: (context, animatedHeightFactor, child) {
|
||||
return ClipRect(
|
||||
child: FractionallySizedBox(
|
||||
heightFactor: animatedHeightFactor,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
|
||||
child: Row(
|
||||
@@ -379,83 +414,96 @@ class _AskAiSheetState extends ConsumerState<_AskAiSheet> {
|
||||
if (_isStreaming)
|
||||
const SizedBox(height: 16, width: 16, child: CircularProgressIndicator(strokeWidth: 2)),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(_isMinimized ? Icons.unfold_more : Icons.unfold_less),
|
||||
tooltip: libL10n.fold,
|
||||
onPressed: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
setState(() {
|
||||
_isMinimized = !_isMinimized;
|
||||
});
|
||||
},
|
||||
),
|
||||
IconButton(icon: const Icon(Icons.close), onPressed: () => Navigator.of(context).pop()),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Scrollbar(
|
||||
controller: _scrollController,
|
||||
child: ListView(
|
||||
if (!_isMinimized) ...[
|
||||
Expanded(
|
||||
child: Scrollbar(
|
||||
controller: _scrollController,
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
|
||||
children: [
|
||||
Text(context.l10n.askAiSelectedContent, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 6),
|
||||
CardX(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: SelectableText(
|
||||
widget.selection,
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(context.l10n.askAiConversation, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 6),
|
||||
..._buildConversationWidgets(context, theme),
|
||||
if (_error != null) ...[
|
||||
const SizedBox(height: 16),
|
||||
child: ListView(
|
||||
controller: _scrollController,
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
|
||||
children: [
|
||||
Text(context.l10n.askAiSelectedContent, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 6),
|
||||
CardX(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(_error!, style: TextStyle(color: theme.colorScheme.error)),
|
||||
child: SelectableText(
|
||||
widget.selection,
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(context.l10n.askAiConversation, style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 6),
|
||||
..._buildConversationWidgets(context, theme),
|
||||
if (_error != null) ...[
|
||||
const SizedBox(height: 16),
|
||||
CardX(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Text(_error!, style: TextStyle(color: theme.colorScheme.error)),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (_isStreaming) ...[const SizedBox(height: 16), const LinearProgressIndicator()],
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
if (_isStreaming) ...[const SizedBox(height: 16), const LinearProgressIndicator()],
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
|
||||
child: Text(
|
||||
context.l10n.askAiDisclaimer,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.error,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, 8, 16, 16 + bottomPadding),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Input(
|
||||
controller: _inputController,
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
hint: context.l10n.askAiFollowUpHint,
|
||||
action: TextInputAction.send,
|
||||
onSubmitted: (_) => _sendMessage(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Btn.icon(
|
||||
onTap: _isStreaming || _inputController.text.trim().isEmpty ? null : _sendMessage,
|
||||
icon: const Icon(Icons.send, size: 18),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
|
||||
child: Text(
|
||||
context.l10n.askAiDisclaimer,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.error,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, 8, 16, 16 + bottomPadding),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Input(
|
||||
controller: _inputController,
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
hint: context.l10n.askAiFollowUpHint,
|
||||
action: TextInputAction.send,
|
||||
onSubmitted: (_) => _sendMessage(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Btn.icon(
|
||||
onTap: _isStreaming || _inputController.text.trim().isEmpty ? null : _sendMessage,
|
||||
icon: const Icon(Icons.send, size: 18),
|
||||
),
|
||||
],
|
||||
).cardx,
|
||||
),
|
||||
] else
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
).cardx,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ class SSHPageState extends ConsumerState<SSHPage>
|
||||
deleteDetection: isMobile,
|
||||
autofocus: false,
|
||||
keyboardAppearance: _isDark ? Brightness.dark : Brightness.light,
|
||||
showToolbar: isMobile,
|
||||
showToolbar: true,
|
||||
viewOffset: Offset(2 * _horizonPadding, CustomAppBar.sysStatusBarHeight),
|
||||
hideScrollBar: false,
|
||||
focusNode: widget.args.focusNode,
|
||||
@@ -355,7 +355,7 @@ class SSHPageState extends ConsumerState<SSHPage>
|
||||
onTapUp: (_) => _virtKeyLongPressTimer?.cancel(),
|
||||
child: SizedBox(
|
||||
width: virtKeyWidth,
|
||||
height: _virtKeysHeight / _virtKeysList.length,
|
||||
height: _horizonVirtKeys ? _virtKeysHeight : _virtKeysHeight / _virtKeysList.length,
|
||||
child: Center(child: child),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -123,7 +123,7 @@ class _LocalFilePageState extends ConsumerState<LocalFilePage> with AutomaticKee
|
||||
|
||||
final item = items![index];
|
||||
final file = item.$1;
|
||||
final fileName = file.path.split('/').last;
|
||||
final fileName = file.path.split(Pfs.seperator).last;
|
||||
final stat = item.$2;
|
||||
final isDir = stat.type == FileSystemEntityType.directory;
|
||||
|
||||
@@ -140,11 +140,23 @@ class _LocalFilePageState extends ConsumerState<LocalFilePage> with AutomaticKee
|
||||
required FileStat stat,
|
||||
required bool isDir,
|
||||
}) {
|
||||
final isServerFolder = isDir && file.parent.path == Paths.file;
|
||||
String? serverName;
|
||||
if (isServerFolder) {
|
||||
final servers = ref.read(serversProvider).servers;
|
||||
final server = servers[fileName];
|
||||
if (server != null) {
|
||||
serverName = server.name;
|
||||
}
|
||||
}
|
||||
|
||||
return CardX(
|
||||
child: ListTile(
|
||||
leading: isDir ? const Icon(Icons.folder_open) : const Icon(Icons.insert_drive_file),
|
||||
title: Text(fileName),
|
||||
subtitle: isDir ? null : Text(stat.size.bytes2Str, style: UIs.textGrey),
|
||||
title: Text(serverName ?? fileName),
|
||||
subtitle: isDir
|
||||
? (serverName != null ? Text(fileName, style: UIs.textGrey) : null)
|
||||
: Text(stat.size.bytes2Str, style: UIs.textGrey),
|
||||
trailing: Text(stat.modified.ymdhms(), style: UIs.textGrey),
|
||||
onLongPress: () {
|
||||
if (isDir) {
|
||||
@@ -216,7 +228,7 @@ extension _Actions on _LocalFilePageState {
|
||||
}
|
||||
|
||||
Future<void> _showFileActionDialog(FileSystemEntity file) async {
|
||||
final fileName = file.path.split('/').lastOrNull ?? '';
|
||||
final fileName = file.path.split(Pfs.seperator).lastOrNull ?? '';
|
||||
if (isPickFile) {
|
||||
context.showRoundDialog(
|
||||
title: libL10n.file,
|
||||
@@ -308,7 +320,7 @@ extension _Actions on _LocalFilePageState {
|
||||
}
|
||||
|
||||
void _showDeleteDialog(FileSystemEntity file) {
|
||||
final fileName = file.path.split('/').last;
|
||||
final fileName = file.path.split(Pfs.seperator).last;
|
||||
context.showRoundDialog(
|
||||
title: libL10n.delete,
|
||||
child: Text(libL10n.askContinue('${libL10n.delete} $fileName')),
|
||||
|
||||
@@ -177,32 +177,56 @@ extension _UI on _SftpPageState {
|
||||
|
||||
Widget _buildItem(SftpName file, {VoidCallback? beforeTap}) {
|
||||
final isDir = file.attr.isDirectory;
|
||||
final trailing = Text(
|
||||
'${_getTime(file.attr.modifyTime)}\n${file.attr.mode?.str ?? ''}',
|
||||
style: UIs.textGrey,
|
||||
textAlign: TextAlign.right,
|
||||
);
|
||||
return CardX(
|
||||
child: ListTile(
|
||||
leading: Icon(isDir ? Icons.folder_outlined : Icons.insert_drive_file),
|
||||
title: Text(file.filename),
|
||||
trailing: trailing,
|
||||
subtitle: isDir ? null : Text((file.attr.size ?? 0).bytes2Str, style: UIs.textGrey),
|
||||
onTap: () {
|
||||
beforeTap?.call();
|
||||
if (isDir) {
|
||||
_status.path.path = file.filename;
|
||||
_listDir();
|
||||
} else {
|
||||
_onItemPress(file, true);
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
beforeTap?.call();
|
||||
_onItemPress(file, !isDir);
|
||||
},
|
||||
),
|
||||
);
|
||||
final double screenWidth = MediaQuery.sizeOf(context).width;
|
||||
if (screenWidth < 350) {
|
||||
return CardX(
|
||||
child: ListTile(
|
||||
leading: Icon(isDir ? Icons.folder_outlined : Icons.insert_drive_file),
|
||||
title: Text(file.filename),
|
||||
subtitle: isDir ? Text('${_getTime(file.attr.modifyTime)}\n${file.attr.mode?.str ?? ''}', style: UIs.textGrey) :
|
||||
Text('${(file.attr.size ?? 0).bytes2Str}\n${_getTime(file.attr.modifyTime)}\n${file.attr.mode?.str ?? ''}', style: UIs.textGrey),
|
||||
onTap: () {
|
||||
beforeTap?.call();
|
||||
if (isDir) {
|
||||
_status.path.path = file.filename;
|
||||
_listDir();
|
||||
} else {
|
||||
_onItemPress(file, true);
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
beforeTap?.call();
|
||||
_onItemPress(file, !isDir);
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return CardX(
|
||||
child: ListTile(
|
||||
leading: Icon(isDir ? Icons.folder_outlined : Icons.insert_drive_file),
|
||||
title: Text(file.filename),
|
||||
trailing: Text(
|
||||
'${_getTime(file.attr.modifyTime)}\n${file.attr.mode?.str ?? ''}',
|
||||
style: UIs.textGrey,
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
subtitle: isDir ? null : Text((file.attr.size ?? 0).bytes2Str, style: UIs.textGrey),
|
||||
onTap: () {
|
||||
beforeTap?.call();
|
||||
if (isDir) {
|
||||
_status.path.path = file.filename;
|
||||
_listDir();
|
||||
} else {
|
||||
_onItemPress(file, true);
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
beforeTap?.call();
|
||||
_onItemPress(file, !isDir);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +585,11 @@ extension _Actions on _SftpPageState {
|
||||
|
||||
/// Local file dir + server id + remote path
|
||||
String _getLocalPath(String remotePath) {
|
||||
return Paths.file.joinPath(widget.args.spi.oldId).joinPath(remotePath);
|
||||
var normalizedPath = remotePath.replaceAll('/', Pfs.seperator);
|
||||
if (normalizedPath.startsWith(Pfs.seperator)) {
|
||||
normalizedPath = normalizedPath.substring(1);
|
||||
}
|
||||
return Paths.file.joinPath(widget.args.spi.id).joinPath(normalizedPath);
|
||||
}
|
||||
|
||||
/// Only return true if the path is changed
|
||||
|
||||
@@ -471,7 +471,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
||||
@@ -481,7 +481,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "Server Box";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -608,7 +608,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
||||
@@ -618,7 +618,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "Server Box";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -638,7 +638,7 @@
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1276;
|
||||
CURRENT_PROJECT_VERSION = 1297;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -649,7 +649,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MARKETING_VERSION = 1.0.1276;
|
||||
MARKETING_VERSION = 1.0.1297;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "Server Box";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
||||
@@ -10,4 +10,19 @@ class AppDelegate: FlutterAppDelegate {
|
||||
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
if let controller = mainFlutterWindow?.contentViewController as? FlutterViewController {
|
||||
let channel = FlutterMethodChannel(name: "about", binaryMessenger: controller.engine.binaryMessenger)
|
||||
channel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) in
|
||||
if call.method == "showAboutPanel" {
|
||||
NSApp.orderFrontStandardAboutPanel(nil)
|
||||
result(nil)
|
||||
} else {
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
super.applicationDidFinishLaunching(notification)
|
||||
}
|
||||
}
|
||||
|
||||
30
pubspec.lock
30
pubspec.lock
@@ -205,10 +205,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: camera_web
|
||||
sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f"
|
||||
sha256: "57f49a635c8bf249d07fb95eb693d7e4dda6796dedb3777f9127fb54847beba7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.5"
|
||||
version: "0.3.5+3"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -440,10 +440,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
|
||||
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
version: "2.1.5"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -472,8 +472,8 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
path: "."
|
||||
ref: "v1.0.52"
|
||||
resolved-ref: "38e7d41ccd71bf44e286d86b4ad656f05c5c2548"
|
||||
ref: "v1.0.53"
|
||||
resolved-ref: "61ee37ea6f082592f5be56340b7746dce4ffbfda"
|
||||
url: "https://github.com/lppcg/fl_build.git"
|
||||
source: git
|
||||
version: "1.0.0"
|
||||
@@ -727,18 +727,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: hive_ce
|
||||
sha256: "81d39a03c4c0ba5938260a8c3547d2e71af59defecea21793d57fc3551f0d230"
|
||||
sha256: "29f8791bf13fa6cf7435a58f1f82a7c9706973c867affa77c34d91e105762664"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.15.1"
|
||||
version: "2.17.0"
|
||||
hive_ce_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: hive_ce_flutter
|
||||
sha256: "26d656c9e8974f0732f1d09020e2d7b08ba841b8961a02dbfb6caf01474b0e9a"
|
||||
sha256: "2677e95a333ff15af43ccd06af7eb7abbf1a4f154ea071997f3de4346cae913a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.3"
|
||||
version: "2.3.4"
|
||||
hive_ce_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -831,10 +831,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: isolate_channel
|
||||
sha256: f3d36f783b301e6b312c3450eeb2656b0e7d1db81331af2a151d9083a3f6b18d
|
||||
sha256: "68191008e3a219bc87cc8cddbcd1e29810bd9f3a0fdc2108b574ccbd9aafda08"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2+1"
|
||||
version: "0.3.0"
|
||||
isolate_contactor:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1602,7 +1602,7 @@ packages:
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
url_launcher:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
|
||||
@@ -1750,10 +1750,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a"
|
||||
sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.4"
|
||||
version: "1.2.1"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: server_box
|
||||
description: server status & toolbox app.
|
||||
publish_to: "none"
|
||||
version: 1.0.1276+1276
|
||||
version: 1.0.1297+1297
|
||||
|
||||
environment:
|
||||
sdk: ">=3.9.0"
|
||||
@@ -38,6 +38,7 @@ dependencies:
|
||||
wake_on_lan: ^4.1.1+3
|
||||
webdav_client_plus: ^1.0.2
|
||||
xml: ^6.4.2 # for parsing nvidia-smi
|
||||
url_launcher: ^6.2.6
|
||||
dartssh2:
|
||||
git:
|
||||
url: https://github.com/lollipopkit/dartssh2
|
||||
@@ -102,7 +103,7 @@ dev_dependencies:
|
||||
fl_build:
|
||||
git:
|
||||
url: https://github.com/lppcg/fl_build.git
|
||||
ref: v1.0.52
|
||||
ref: v1.0.53
|
||||
|
||||
flutter:
|
||||
generate: true
|
||||
|
||||
Reference in New Issue
Block a user