Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

add ghproxy switcher

Predidit2b2c92b196a1
diff --git a/lib/pages/plugin_editor/plugin_module.dart b/lib/pages/plugin_editor/plugin_module.dart
index 940d491d..80180a7e 100644
--- a/lib/pages/plugin_editor/plugin_module.dart
+++ b/lib/pages/plugin_editor/plugin_module.dart
@@ -2,7 +2,6 @@ import 'dart:io';
import 'package:kazumi/pages/plugin_editor/plugin_view_page.dart';
import 'package:kazumi/pages/plugin_editor/plugin_editor_page.dart';
import 'package:kazumi/pages/plugin_editor/plugin_shop_page.dart';
-import 'package:kazumi/plugins/plugins.dart';
import 'package:flutter_modular/flutter_modular.dart';
class PluginModule extends Module {
diff --git a/lib/pages/plugin_editor/plugin_shop_page.dart b/lib/pages/plugin_editor/plugin_shop_page.dart
index 1c698007..925a6304 100644
--- a/lib/pages/plugin_editor/plugin_shop_page.dart
+++ b/lib/pages/plugin_editor/plugin_shop_page.dart
@@ -7,6 +7,8 @@ import 'package:kazumi/plugins/plugins_controller.dart';
import 'package:kazumi/bean/appbar/sys_app_bar.dart';
import 'package:kazumi/pages/menu/menu.dart';
import 'package:kazumi/pages/menu/side_menu.dart';
+import 'package:hive/hive.dart';
+import 'package:kazumi/utils/storage.dart';
import 'package:provider/provider.dart';
class PluginShopPage extends StatefulWidget {
@@ -18,6 +20,8 @@ class PluginShopPage extends StatefulWidget {
class _PluginShopPageState extends State<PluginShopPage> {
dynamic navigationBarState;
+ Box setting = GStorage.setting;
+ late bool enableGitProxy;
final PluginsController pluginsController = Modular.get<PluginsController>();
void onBackPressed(BuildContext context) {
@@ -27,6 +31,7 @@ class _PluginShopPageState extends State<PluginShopPage> {
@override
void initState() {
super.initState();
+ enableGitProxy = setting.get(SettingBoxKey.enableGitProxy, defaultValue: false);
if (Platform.isAndroid || Platform.isIOS) {
navigationBarState =
Provider.of<NavigationBarState>(context, listen: false);
@@ -52,8 +57,18 @@ class _PluginShopPageState extends State<PluginShopPage> {
),
body: Observer(builder: (context) {
return pluginsController.pluginHTTPList.isEmpty
- ? const Center(
- child: Text('啊咧(⊙.⊙) 没有可用规则的说'),
+ ? Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('啊咧(⊙.⊙) 无法访问远程仓库 ${enableGitProxy ? '镜像已启用' : '镜像已禁用'}'),
+ TextButton(
+ onPressed: () {
+ Modular.to.pushNamed('/tab/my/other');
+ },
+ child: Text(enableGitProxy ? '禁用镜像' : '启用镜像'))
+ ],
+ ),
)
: ListView.builder(
itemCount: pluginsController.pluginHTTPList.length,
@@ -127,6 +142,7 @@ class _PluginShopPageState extends State<PluginShopPage> {
.savePluginToJsonFile(pluginHTTPItem);
pluginsController.loadPlugins();
SmartDialog.showToast('导入成功');
+ setState(() {});
}
} catch (e) {
SmartDialog.showToast('导入规则失败');
@@ -146,6 +162,7 @@ class _PluginShopPageState extends State<PluginShopPage> {
.savePluginToJsonFile(pluginHTTPItem);
pluginsController.loadPlugins();
SmartDialog.showToast('更新成功');
+ setState(() {});
}
} catch (e) {
SmartDialog.showToast('更新规则失败');
diff --git a/lib/pages/settings/other_settings.dart b/lib/pages/settings/other_settings.dart
index e7b85609..8fcfe70e 100644
--- a/lib/pages/settings/other_settings.dart
+++ b/lib/pages/settings/other_settings.dart
@@ -58,6 +58,7 @@ class _OtherSettingsPageState extends State<OtherSettingsPage> {
title: 'Github镜像',
subTitle: '使用镜像访问规则托管仓库',
setKey: SettingBoxKey.enableGitProxy,
+ needReboot: true,
defaultVal: false,
),
),