mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: use cdn as default
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 793;
|
static const int build = 796;
|
||||||
static const String engine = "3.19.2";
|
static const String engine = "3.19.2";
|
||||||
static const String buildAt = "2024-03-08 15:18:32";
|
static const String buildAt = "2024-03-09 16:45:22";
|
||||||
static const int modifications = 2;
|
static const int modifications = 1;
|
||||||
static const int script = 40;
|
static const int script = 40;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
abstract final class Urls {
|
abstract final class Urls {
|
||||||
static const resBase = 'https://res.lolli.tech/serverbox';
|
|
||||||
static const cdnBase = 'https://cdn.lolli.tech/serverbox';
|
static const cdnBase = 'https://cdn.lolli.tech/serverbox';
|
||||||
static const myGithub = 'https://github.com/lollipopkit';
|
static const myGithub = 'https://github.com/lollipopkit';
|
||||||
static const appHelp = '$myGithub/flutter_server_box#-help';
|
static const appHelp = '$myGithub/flutter_server_box#-help';
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:toolbox/data/res/store.dart';
|
|
||||||
|
|
||||||
import '../model/app/update.dart';
|
import '../model/app/update.dart';
|
||||||
import '../res/url.dart';
|
import '../res/url.dart';
|
||||||
|
|
||||||
class AppService {
|
class AppService {
|
||||||
Future<AppUpdate> getUpdate() async {
|
Future<AppUpdate> getUpdate() async {
|
||||||
final useCDN = Stores.setting.useCdn.fetch() == 1;
|
final resp = await Dio().get('${Urls.cdnBase}/update.json');
|
||||||
final resp =
|
|
||||||
await Dio().get('${useCDN ? Urls.cdnBase : Urls.resBase}/update.json');
|
|
||||||
return AppUpdate.fromJson(resp.data);
|
return AppUpdate.fromJson(resp.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,11 +251,6 @@ class SettingStore extends PersistentStore {
|
|||||||
/// when building traffic view on server tab
|
/// when building traffic view on server tab
|
||||||
late final ignoreLocalNet = property('ignoreLocalNetIface', true);
|
late final ignoreLocalNet = property('ignoreLocalNetIface', true);
|
||||||
|
|
||||||
/// Use cdn
|
|
||||||
/// It's recommended to use cdn for non-China users
|
|
||||||
/// 0: unset, 1: use, 2: not use
|
|
||||||
late final useCdn = property('useCdn', 0);
|
|
||||||
|
|
||||||
/// Index of terminal cursor type
|
/// Index of terminal cursor type
|
||||||
late final termCursor =
|
late final termCursor =
|
||||||
property('termCursor', TerminalCursorType.block.index);
|
property('termCursor', TerminalCursorType.block.index);
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import 'package:flutter_markdown/flutter_markdown.dart';
|
|||||||
import 'package:get_it/get_it.dart';
|
import 'package:get_it/get_it.dart';
|
||||||
import 'package:toolbox/core/channel/bg_run.dart';
|
import 'package:toolbox/core/channel/bg_run.dart';
|
||||||
import 'package:toolbox/core/channel/home_widget.dart';
|
import 'package:toolbox/core/channel/home_widget.dart';
|
||||||
import 'package:toolbox/core/extension/context/common.dart';
|
|
||||||
import 'package:toolbox/core/extension/context/dialog.dart';
|
import 'package:toolbox/core/extension/context/dialog.dart';
|
||||||
import 'package:toolbox/core/extension/context/locale.dart';
|
import 'package:toolbox/core/extension/context/locale.dart';
|
||||||
import 'package:toolbox/core/persistant_store.dart';
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
@@ -326,32 +325,6 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
|||||||
await GetIt.I.allReady();
|
await GetIt.I.allReady();
|
||||||
await Pros.server.load();
|
await Pros.server.load();
|
||||||
await Pros.server.refresh();
|
await Pros.server.refresh();
|
||||||
|
|
||||||
_notifyUseCDN();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _notifyUseCDN() async {
|
|
||||||
final useCDN = Stores.setting.useCdn.fetch();
|
|
||||||
if (useCDN != 0) return;
|
|
||||||
final use = await context.showRoundDialog(
|
|
||||||
title: Text(l10n.useCdn),
|
|
||||||
child: Text(l10n.useCdnTip),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => context.pop(true),
|
|
||||||
child: Text(l10n.ok),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => context.pop(false),
|
|
||||||
child: Text(l10n.cancel, style: UIs.textRed),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
if (use == true) {
|
|
||||||
Stores.setting.useCdn.put(1);
|
|
||||||
} else if (use == false) {
|
|
||||||
Stores.setting.useCdn.put(2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onLongPressSetting() async {
|
Future<void> _onLongPressSetting() async {
|
||||||
|
|||||||
@@ -467,7 +467,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 793;
|
CURRENT_PROJECT_VERSION = 796;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
||||||
@@ -477,7 +477,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
MARKETING_VERSION = 1.0.793;
|
MARKETING_VERSION = 1.0.796;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "Server Box";
|
PRODUCT_NAME = "Server Box";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -604,7 +604,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 793;
|
CURRENT_PROJECT_VERSION = 796;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
INFOPLIST_KEY_CFBundleDisplayName = "Server Box";
|
||||||
@@ -614,7 +614,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
MARKETING_VERSION = 1.0.793;
|
MARKETING_VERSION = 1.0.796;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "Server Box";
|
PRODUCT_NAME = "Server Box";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -634,7 +634,7 @@
|
|||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application";
|
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 793;
|
CURRENT_PROJECT_VERSION = 796;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
"DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6;
|
"DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -645,7 +645,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
MARKETING_VERSION = 1.0.793;
|
MARKETING_VERSION = 1.0.796;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "Server Box";
|
PRODUCT_NAME = "Server Box";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user