Merge branch 'DLMS_dev' into dev
This commit is contained in:
5
.github/workflows/build-app.yml
vendored
5
.github/workflows/build-app.yml
vendored
@@ -26,11 +26,6 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'LICENSE'
|
- 'LICENSE'
|
||||||
pull_request:
|
|
||||||
branches: [ "main" ]
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
- 'LICENSE'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
5
.github/workflows/build-pre.yml
vendored
5
.github/workflows/build-pre.yml
vendored
@@ -26,11 +26,6 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'LICENSE'
|
- 'LICENSE'
|
||||||
pull_request:
|
|
||||||
branches: [ "dev" ]
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
- 'LICENSE'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ from qfluentwidgets import (
|
|||||||
FolderValidator,
|
FolderValidator,
|
||||||
BoolValidator,
|
BoolValidator,
|
||||||
RangeValidator,
|
RangeValidator,
|
||||||
|
OptionsValidator,
|
||||||
qconfig,
|
qconfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -560,12 +561,17 @@ class GlobalConfig(QConfig):
|
|||||||
notify_ServerChanKey = ConfigItem("Notify", "ServerChanKey", "")
|
notify_ServerChanKey = ConfigItem("Notify", "ServerChanKey", "")
|
||||||
notify_ServerChanChannel = ConfigItem("Notify", "ServerChanChannel", "")
|
notify_ServerChanChannel = ConfigItem("Notify", "ServerChanChannel", "")
|
||||||
notify_ServerChanTag = ConfigItem("Notify", "ServerChanTag", "")
|
notify_ServerChanTag = ConfigItem("Notify", "ServerChanTag", "")
|
||||||
notify_IfCompanyWebHookBot = ConfigItem("Notify", "IfCompanyWebHookBot", False, BoolValidator())
|
notify_IfCompanyWebHookBot = ConfigItem(
|
||||||
|
"Notify", "IfCompanyWebHookBot", False, BoolValidator()
|
||||||
|
)
|
||||||
notify_CompanyWebHookBotUrl = ConfigItem("Notify", "CompanyWebHookBotUrl", "")
|
notify_CompanyWebHookBotUrl = ConfigItem("Notify", "CompanyWebHookBotUrl", "")
|
||||||
notify_IfPushDeer = ConfigItem("Notify", "IfPushDeer", False, BoolValidator())
|
notify_IfPushDeer = ConfigItem("Notify", "IfPushDeer", False, BoolValidator())
|
||||||
notify_IfPushDeerKey = ConfigItem("Notify", "PushDeerKey", "")
|
notify_IfPushDeerKey = ConfigItem("Notify", "PushDeerKey", "")
|
||||||
|
|
||||||
update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator())
|
update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator())
|
||||||
|
update_UpdateType = OptionsConfigItem(
|
||||||
|
"Update", "UpdateType", "main", OptionsValidator(["main", "dev"])
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class QueueConfig(QConfig):
|
class QueueConfig(QConfig):
|
||||||
|
|||||||
@@ -113,13 +113,15 @@ class MaaManager(QObject):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
# 整理用户数据,筛选需代理的用户
|
# 整理用户数据,筛选需代理的用户
|
||||||
self.data = sorted(self.data, key=lambda x: (-len(x[15]), x[16]))
|
if "设置MAA" not in self.mode:
|
||||||
user_list: List[List[str, str, int]] = [
|
|
||||||
[_[0], "等待", index]
|
self.data = sorted(self.data, key=lambda x: (-len(x[15]), x[16]))
|
||||||
for index, _ in enumerate(self.data)
|
user_list: List[List[str, str, int]] = [
|
||||||
if (_[3] != 0 and _[4] == "y")
|
[_[0], "等待", index]
|
||||||
]
|
for index, _ in enumerate(self.data)
|
||||||
self.create_user_list.emit(user_list)
|
if (_[3] != 0 and _[4] == "y")
|
||||||
|
]
|
||||||
|
self.create_user_list.emit(user_list)
|
||||||
|
|
||||||
# 自动代理模式
|
# 自动代理模式
|
||||||
if self.mode == "自动代理":
|
if self.mode == "自动代理":
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class AUTO_MAA(MSFluentWindow):
|
|||||||
|
|
||||||
# 加载配置
|
# 加载配置
|
||||||
qconfig.load(Config.config_path, Config.global_config)
|
qconfig.load(Config.config_path, Config.global_config)
|
||||||
|
Config.global_config.save()
|
||||||
|
|
||||||
# 检查密码
|
# 检查密码
|
||||||
self.setting.check_PASSWORD()
|
self.setting.check_PASSWORD()
|
||||||
|
|||||||
@@ -683,6 +683,7 @@ class MaaSettingBox(QWidget):
|
|||||||
|
|
||||||
Config.cur.execute("SELECT * FROM adminx WHERE True")
|
Config.cur.execute("SELECT * FROM adminx WHERE True")
|
||||||
data = Config.cur.fetchall()
|
data = Config.cur.fetchall()
|
||||||
|
data = sorted(data, key=lambda x: (-len(x[15]), x[16]))
|
||||||
|
|
||||||
if self.user_list.pivot.currentRouteKey() == f"{self.name}_简洁用户列表":
|
if self.user_list.pivot.currentRouteKey() == f"{self.name}_简洁用户列表":
|
||||||
|
|
||||||
@@ -876,6 +877,9 @@ class MaaSettingBox(QWidget):
|
|||||||
self.user_list_simple.itemChanged.connect(
|
self.user_list_simple.itemChanged.connect(
|
||||||
lambda item: self.change_user_Item(item, "simple")
|
lambda item: self.change_user_Item(item, "simple")
|
||||||
)
|
)
|
||||||
|
self.user_list_beta.itemChanged.connect(
|
||||||
|
lambda item: self.change_user_Item(item, "beta")
|
||||||
|
)
|
||||||
|
|
||||||
self.stackedWidget.addWidget(self.user_list_simple)
|
self.stackedWidget.addWidget(self.user_list_simple)
|
||||||
self.pivot.addItem(
|
self.pivot.addItem(
|
||||||
@@ -1353,6 +1357,10 @@ class MaaSettingBox(QWidget):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if row == 0:
|
if row == 0:
|
||||||
|
logger.warning("向上移动用户时已到达最上端")
|
||||||
|
MainInfoBar.push_info_bar(
|
||||||
|
"warning", "已经是第一个用户", "无法向上移动", 5000
|
||||||
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
Config.cur.execute(
|
Config.cur.execute(
|
||||||
@@ -1450,6 +1458,10 @@ class MaaSettingBox(QWidget):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if row == current_numb - 1:
|
if row == current_numb - 1:
|
||||||
|
logger.warning("向下移动用户时已到达最下端")
|
||||||
|
MainInfoBar.push_info_bar(
|
||||||
|
"warning", "已经是最后一个用户", "无法向下移动", 5000
|
||||||
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
Config.cur.execute(
|
Config.cur.execute(
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ from qfluentwidgets import (
|
|||||||
SwitchSettingCard,
|
SwitchSettingCard,
|
||||||
ExpandGroupSettingCard,
|
ExpandGroupSettingCard,
|
||||||
PushSettingCard,
|
PushSettingCard,
|
||||||
|
ComboBoxSettingCard,
|
||||||
)
|
)
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
@@ -207,7 +208,7 @@ class Setting(QWidget):
|
|||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json"
|
f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{Config.global_config.get(Config.global_config.update_UpdateType)}/resources/version.json"
|
||||||
)
|
)
|
||||||
version_remote = response.json()
|
version_remote = response.json()
|
||||||
break
|
break
|
||||||
@@ -249,7 +250,7 @@ class Setting(QWidget):
|
|||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json"
|
f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{Config.global_config.get(Config.global_config.update_UpdateType)}/resources/version.json"
|
||||||
)
|
)
|
||||||
version_remote = response.json()
|
version_remote = response.json()
|
||||||
break
|
break
|
||||||
@@ -390,24 +391,19 @@ class FunctionSettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("功能")
|
self.setTitle("功能")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_IfAllowSleep = SwitchSettingCard(
|
self.card_IfAllowSleep = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="启动时阻止系统休眠",
|
title="启动时阻止系统休眠",
|
||||||
content="仅阻止电脑自动休眠,不会影响屏幕是否熄灭",
|
content="仅阻止电脑自动休眠,不会影响屏幕是否熄灭",
|
||||||
configItem=Config.global_config.function_IfAllowSleep,
|
configItem=Config.global_config.function_IfAllowSleep,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_IfSilence = self.SilenceSettingCard(self)
|
self.card_IfSilence = self.SilenceSettingCard(self)
|
||||||
|
|
||||||
# 添加各组到设置卡中
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_IfAllowSleep)
|
Layout.addWidget(self.card_IfAllowSleep)
|
||||||
Layout.addWidget(self.card_IfSilence)
|
Layout.addWidget(self.card_IfSilence)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
class SilenceSettingCard(ExpandGroupSettingCard):
|
class SilenceSettingCard(ExpandGroupSettingCard):
|
||||||
@@ -420,16 +416,12 @@ class FunctionSettingCard(HeaderCardWidget):
|
|||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
|
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
self.card_IfSilence = SwitchSettingCard(
|
self.card_IfSilence = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="静默模式",
|
title="静默模式",
|
||||||
content="是否启用静默模式",
|
content="是否启用静默模式",
|
||||||
configItem=Config.global_config.function_IfSilence,
|
configItem=Config.global_config.function_IfSilence,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_BossKey = LineEditSettingCard(
|
self.card_BossKey = LineEditSettingCard(
|
||||||
text="请输入安卓模拟器老版键",
|
text="请输入安卓模拟器老版键",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
@@ -438,13 +430,12 @@ class FunctionSettingCard(HeaderCardWidget):
|
|||||||
configItem=Config.global_config.function_BossKey,
|
configItem=Config.global_config.function_BossKey,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
widget = QWidget()
|
||||||
|
Layout = QVBoxLayout(widget)
|
||||||
Layout.addWidget(self.card_IfSilence)
|
Layout.addWidget(self.card_IfSilence)
|
||||||
Layout.addWidget(self.card_BossKey)
|
Layout.addWidget(self.card_BossKey)
|
||||||
|
|
||||||
# 调整内部布局
|
|
||||||
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.viewLayout.setSpacing(0)
|
self.viewLayout.setSpacing(0)
|
||||||
|
|
||||||
self.addGroupWidget(widget)
|
self.addGroupWidget(widget)
|
||||||
|
|
||||||
|
|
||||||
@@ -452,18 +443,14 @@ class StartSettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("启动")
|
self.setTitle("启动")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_IfSelfStart = SwitchSettingCard(
|
self.card_IfSelfStart = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="开机时自动启动",
|
title="开机时自动启动",
|
||||||
content="将AUTO_MAA添加到开机启动项",
|
content="将AUTO_MAA添加到开机启动项",
|
||||||
configItem=Config.global_config.start_IfSelfStart,
|
configItem=Config.global_config.start_IfSelfStart,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_IfRunDirectly = SwitchSettingCard(
|
self.card_IfRunDirectly = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="启动后直接运行",
|
title="启动后直接运行",
|
||||||
@@ -471,12 +458,9 @@ class StartSettingCard(HeaderCardWidget):
|
|||||||
configItem=Config.global_config.start_IfRunDirectly,
|
configItem=Config.global_config.start_IfRunDirectly,
|
||||||
)
|
)
|
||||||
|
|
||||||
# 添加各组到设置卡中
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(
|
Layout.addWidget(self.card_IfSelfStart)
|
||||||
self.card_IfSelfStart,
|
|
||||||
)
|
|
||||||
Layout.addWidget(self.card_IfRunDirectly)
|
Layout.addWidget(self.card_IfRunDirectly)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
|
|
||||||
@@ -484,18 +468,14 @@ class UiSettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("界面")
|
self.setTitle("界面")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_IfShowTray = SwitchSettingCard(
|
self.card_IfShowTray = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="显示托盘图标",
|
title="显示托盘图标",
|
||||||
content="常态显示托盘图标",
|
content="常态显示托盘图标",
|
||||||
configItem=Config.global_config.ui_IfShowTray,
|
configItem=Config.global_config.ui_IfShowTray,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_IfToTray = SwitchSettingCard(
|
self.card_IfToTray = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="最小化到托盘",
|
title="最小化到托盘",
|
||||||
@@ -503,10 +483,9 @@ class UiSettingCard(HeaderCardWidget):
|
|||||||
configItem=Config.global_config.ui_IfToTray,
|
configItem=Config.global_config.ui_IfToTray,
|
||||||
)
|
)
|
||||||
|
|
||||||
# 添加各组到设置卡中
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_IfShowTray)
|
Layout.addWidget(self.card_IfShowTray)
|
||||||
Layout.addWidget(self.card_IfToTray)
|
Layout.addWidget(self.card_IfToTray)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
|
|
||||||
@@ -517,31 +496,28 @@ class NotifySettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
self.setTitle("通知")
|
self.setTitle("通知")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_IfSendErrorOnly = SwitchSettingCard(
|
self.card_IfSendErrorOnly = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="仅推送异常信息",
|
title="仅推送异常信息",
|
||||||
content="仅在任务出现异常时推送通知",
|
content="仅在任务出现异常时推送通知",
|
||||||
configItem=Config.global_config.notify_IfSendErrorOnly,
|
configItem=Config.global_config.notify_IfSendErrorOnly,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_IfPushPlyer = SwitchSettingCard(
|
self.card_IfPushPlyer = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="推送系统通知",
|
title="推送系统通知",
|
||||||
content="推送系统级通知,不会在通知中心停留",
|
content="推送系统级通知,不会在通知中心停留",
|
||||||
configItem=Config.global_config.notify_IfPushPlyer,
|
configItem=Config.global_config.notify_IfPushPlyer,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_SendMail = self.SendMailSettingCard(self)
|
self.card_SendMail = self.SendMailSettingCard(self)
|
||||||
self.card_ServerChan = self.ServerChanSettingCard(self)
|
self.card_ServerChan = self.ServerChanSettingCard(self)
|
||||||
self.card_CompanyWebhookBot = self.CompanyWechatPushSettingCard(self)
|
self.card_CompanyWebhookBot = self.CompanyWechatPushSettingCard(self)
|
||||||
|
|
||||||
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_IfSendErrorOnly)
|
Layout.addWidget(self.card_IfSendErrorOnly)
|
||||||
Layout.addWidget(self.card_IfPushPlyer)
|
Layout.addWidget(self.card_IfPushPlyer)
|
||||||
Layout.addWidget(self.card_SendMail)
|
Layout.addWidget(self.card_SendMail)
|
||||||
Layout.addWidget(self.card_ServerChan)
|
Layout.addWidget(self.card_ServerChan)
|
||||||
Layout.addWidget(self.card_CompanyWebhookBot)
|
Layout.addWidget(self.card_CompanyWebhookBot)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
class SendMailSettingCard(ExpandGroupSettingCard):
|
class SendMailSettingCard(ExpandGroupSettingCard):
|
||||||
@@ -554,17 +530,13 @@ class NotifySettingCard(HeaderCardWidget):
|
|||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
|
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
self.card_IfSendMail = SwitchSettingCard(
|
self.card_IfSendMail = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="推送邮件通知",
|
title="推送邮件通知",
|
||||||
content="是否启用邮件通知功能",
|
content="是否启用邮件通知功能",
|
||||||
configItem=Config.global_config.notify_IfSendMail,
|
configItem=Config.global_config.notify_IfSendMail,
|
||||||
)
|
)
|
||||||
|
self.card_MailAddress = LineEditSettingCard(
|
||||||
self.MailAddress = LineEditSettingCard(
|
|
||||||
text="请输入邮箱地址",
|
text="请输入邮箱地址",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="邮箱地址",
|
title="邮箱地址",
|
||||||
@@ -572,88 +544,77 @@ class NotifySettingCard(HeaderCardWidget):
|
|||||||
configItem=Config.global_config.notify_MailAddress,
|
configItem=Config.global_config.notify_MailAddress,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
widget = QWidget()
|
||||||
|
Layout = QVBoxLayout(widget)
|
||||||
Layout.addWidget(self.card_IfSendMail)
|
Layout.addWidget(self.card_IfSendMail)
|
||||||
Layout.addWidget(self.MailAddress)
|
Layout.addWidget(self.card_MailAddress)
|
||||||
|
|
||||||
# 调整内部布局
|
|
||||||
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.viewLayout.setSpacing(0)
|
self.viewLayout.setSpacing(0)
|
||||||
|
|
||||||
self.addGroupWidget(widget)
|
self.addGroupWidget(widget)
|
||||||
|
|
||||||
class ServerChanSettingCard(ExpandGroupSettingCard):
|
class ServerChanSettingCard(ExpandGroupSettingCard):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
FluentIcon.SETTING,
|
FluentIcon.SETTING,
|
||||||
"ServerChan推送",
|
"推送ServerChan通知",
|
||||||
"通过ServerChan推送推送任务结果",
|
"通过ServerChan通知推送任务结果",
|
||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
|
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
self.card_IfServerChan = SwitchSettingCard(
|
self.card_IfServerChan = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="SeverChan推送",
|
title="推送SeverChan通知",
|
||||||
content="是否SeverChan推送",
|
content="是否启用SeverChan通知功能",
|
||||||
configItem=Config.global_config.notify_IfServerChan,
|
configItem=Config.global_config.notify_IfServerChan,
|
||||||
)
|
)
|
||||||
|
self.card_ServerChanKey = LineEditSettingCard(
|
||||||
self.ServerChanKey = LineEditSettingCard(
|
|
||||||
text="请输入SendKey",
|
text="请输入SendKey",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="SendKey",
|
title="SendKey",
|
||||||
content="Server酱的SendKey(SC3与SCT都可以)",
|
content="Server酱的SendKey(SC3与SCT都可以)",
|
||||||
configItem=Config.global_config.notify_ServerChanKey,
|
configItem=Config.global_config.notify_ServerChanKey,
|
||||||
)
|
)
|
||||||
|
self.card_ServerChanChannel = LineEditSettingCard(
|
||||||
self.ServerChanChannel = LineEditSettingCard(
|
text="请输入需要推送的Channel代码(SCT生效)",
|
||||||
text="请输入需要推送的Channel代码(SCT生效)",
|
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="ServerChanChannel代码",
|
title="ServerChanChannel代码",
|
||||||
content="可以留空,留空则默认。可以多个,请使用|隔开",
|
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
|
||||||
configItem=Config.global_config.notify_ServerChanChannel,
|
configItem=Config.global_config.notify_ServerChanChannel,
|
||||||
)
|
)
|
||||||
|
self.card_ServerChanTag = LineEditSettingCard(
|
||||||
self.ServerChanTag = LineEditSettingCard(
|
|
||||||
text="请输入加入推送的Tag(SC3生效)",
|
text="请输入加入推送的Tag(SC3生效)",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="Tag内容",
|
title="Tag内容",
|
||||||
content="可以留空,留空则默认。可以多个,请使用|隔开",
|
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
|
||||||
configItem=Config.global_config.notify_ServerChanTag,
|
configItem=Config.global_config.notify_ServerChanTag,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
widget = QWidget()
|
||||||
|
Layout = QVBoxLayout(widget)
|
||||||
Layout.addWidget(self.card_IfServerChan)
|
Layout.addWidget(self.card_IfServerChan)
|
||||||
Layout.addWidget(self.ServerChanKey)
|
Layout.addWidget(self.card_ServerChanKey)
|
||||||
Layout.addWidget(self.ServerChanChannel)
|
Layout.addWidget(self.card_ServerChanChannel)
|
||||||
Layout.addWidget(self.ServerChanTag)
|
Layout.addWidget(self.card_ServerChanTag)
|
||||||
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.viewLayout.setSpacing(0)
|
self.viewLayout.setSpacing(0)
|
||||||
self.addGroupWidget(widget)
|
self.addGroupWidget(widget)
|
||||||
|
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
class CompanyWechatPushSettingCard(ExpandGroupSettingCard):
|
class CompanyWechatPushSettingCard(ExpandGroupSettingCard):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
FluentIcon.SETTING,
|
FluentIcon.SETTING,
|
||||||
"企业微信机器人推送",
|
"推送企业微信机器人通知",
|
||||||
"通过企业微信机器人Webhook推送推送任务结果",
|
"通过企业微信机器人Webhook通知推送任务结果",
|
||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
|
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
self.card_IfCompanyWechat = SwitchSettingCard(
|
self.card_IfCompanyWechat = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="企业微信机器人推送",
|
title="推送企业微信机器人通知",
|
||||||
content="是否启用企业微信机器人推送",
|
content="是否启用企业微信机器人通知功能",
|
||||||
configItem=Config.global_config.notify_IfCompanyWebHookBot,
|
configItem=Config.global_config.notify_IfCompanyWebHookBot,
|
||||||
)
|
)
|
||||||
|
self.card_CompanyWebHookBotUrl = LineEditSettingCard(
|
||||||
self.CompanyWebHookBotUrl = LineEditSettingCard(
|
|
||||||
text="请输入Webhook的Url",
|
text="请输入Webhook的Url",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="WebhookUrl",
|
title="WebhookUrl",
|
||||||
@@ -661,24 +622,21 @@ class NotifySettingCard(HeaderCardWidget):
|
|||||||
configItem=Config.global_config.notify_CompanyWebHookBotUrl,
|
configItem=Config.global_config.notify_CompanyWebHookBotUrl,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
widget = QWidget()
|
||||||
|
Layout = QVBoxLayout(widget)
|
||||||
Layout.addWidget(self.card_IfCompanyWechat)
|
Layout.addWidget(self.card_IfCompanyWechat)
|
||||||
Layout.addWidget(self.CompanyWebHookBotUrl)
|
Layout.addWidget(self.card_CompanyWebHookBotUrl)
|
||||||
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
self.viewLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.viewLayout.setSpacing(0)
|
self.viewLayout.setSpacing(0)
|
||||||
self.addGroupWidget(widget)
|
self.addGroupWidget(widget)
|
||||||
widget = QWidget()
|
|
||||||
Layout = QVBoxLayout(widget)
|
|
||||||
|
|
||||||
|
|
||||||
class SecuritySettingCard(HeaderCardWidget):
|
class SecuritySettingCard(HeaderCardWidget):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("安全")
|
self.setTitle("安全")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_changePASSWORD = PushSettingCard(
|
self.card_changePASSWORD = PushSettingCard(
|
||||||
text="修改",
|
text="修改",
|
||||||
icon=FluentIcon.VPN,
|
icon=FluentIcon.VPN,
|
||||||
@@ -686,8 +644,8 @@ class SecuritySettingCard(HeaderCardWidget):
|
|||||||
content="修改用于解密用户密码的管理密钥",
|
content="修改用于解密用户密码的管理密钥",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_changePASSWORD)
|
Layout.addWidget(self.card_changePASSWORD)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
|
|
||||||
@@ -695,18 +653,21 @@ class UpdaterSettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("更新")
|
self.setTitle("更新")
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
|
||||||
|
|
||||||
self.card_IfAutoUpdate = SwitchSettingCard(
|
self.card_IfAutoUpdate = SwitchSettingCard(
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="自动检查更新",
|
title="自动检查更新",
|
||||||
content="将在启动时自动检查AUTO_MAA是否有新版本",
|
content="将在启动时自动检查AUTO_MAA是否有新版本",
|
||||||
configItem=Config.global_config.update_IfAutoUpdate,
|
configItem=Config.global_config.update_IfAutoUpdate,
|
||||||
)
|
)
|
||||||
|
self.card_UpdateType = ComboBoxSettingCard(
|
||||||
|
configItem=Config.global_config.update_UpdateType,
|
||||||
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
|
title="版本更新类别",
|
||||||
|
content="选择AUTO_MAA的更新类别",
|
||||||
|
texts=["稳定版", "公测版"],
|
||||||
|
)
|
||||||
self.card_CheckUpdate = PushSettingCard(
|
self.card_CheckUpdate = PushSettingCard(
|
||||||
text="检查更新",
|
text="检查更新",
|
||||||
icon=FluentIcon.UPDATE,
|
icon=FluentIcon.UPDATE,
|
||||||
@@ -714,9 +675,10 @@ class UpdaterSettingCard(HeaderCardWidget):
|
|||||||
content="检查AUTO_MAA是否有新版本",
|
content="检查AUTO_MAA是否有新版本",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_IfAutoUpdate)
|
Layout.addWidget(self.card_IfAutoUpdate)
|
||||||
|
Layout.addWidget(self.card_UpdateType)
|
||||||
Layout.addWidget(self.card_CheckUpdate)
|
Layout.addWidget(self.card_CheckUpdate)
|
||||||
|
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
|
|
||||||
@@ -724,7 +686,6 @@ class OtherSettingCard(HeaderCardWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self.setTitle("其他")
|
self.setTitle("其他")
|
||||||
|
|
||||||
self.card_Notice = PushSettingCard(
|
self.card_Notice = PushSettingCard(
|
||||||
@@ -733,15 +694,13 @@ class OtherSettingCard(HeaderCardWidget):
|
|||||||
title="公告",
|
title="公告",
|
||||||
content="查看AUTO_MAA的最新公告",
|
content="查看AUTO_MAA的最新公告",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_UserDocs = HyperlinkCard(
|
self.card_UserDocs = HyperlinkCard(
|
||||||
url="https://docs.qq.com/aio/DQ2NwUHRiWGtMWHBy",
|
url="https://docs.qq.com/aio/DQ2NwUHRiWGtMWHBy",
|
||||||
text="访问用户文档",
|
text="查看使用指南",
|
||||||
icon=FluentIcon.PAGE_RIGHT,
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
title="用户文档",
|
title="使用指南",
|
||||||
content="查看AUTO_MAA的使用教程和文档",
|
content="查看AUTO_MAA的使用教程和文档",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.card_Association = self.AssociationSettingCard()
|
self.card_Association = self.AssociationSettingCard()
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
Layout = QVBoxLayout()
|
||||||
@@ -760,7 +719,6 @@ class OtherSettingCard(HeaderCardWidget):
|
|||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
self.card_GitHubRepository = HyperlinkCard(
|
self.card_GitHubRepository = HyperlinkCard(
|
||||||
url="https://github.com/DLmaster361/AUTO_MAA",
|
url="https://github.com/DLmaster361/AUTO_MAA",
|
||||||
text="访问GitHub仓库",
|
text="访问GitHub仓库",
|
||||||
|
|||||||
@@ -225,12 +225,12 @@ class UpdateProcess(QThread):
|
|||||||
self.info.emit("获取远端代理信息失败,将使用默认代理地址")
|
self.info.emit("获取远端代理信息失败,将使用默认代理地址")
|
||||||
PROXY_list = [
|
PROXY_list = [
|
||||||
"",
|
"",
|
||||||
|
"https://ghfast.top",
|
||||||
"https://gitproxy.click/",
|
"https://gitproxy.click/",
|
||||||
"https://cdn.moran233.xyz/",
|
"https://cdn.moran233.xyz/",
|
||||||
"https://gh.llkk.cc/",
|
"https://gh.llkk.cc/",
|
||||||
"https://github.akams.cn/",
|
"https://github.akams.cn/",
|
||||||
"https://www.ghproxy.cn/",
|
"https://www.ghproxy.cn/",
|
||||||
"https://ghp.ci/",
|
|
||||||
]
|
]
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
@@ -333,11 +333,19 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
main_version_current = [0, 0, 0, 0]
|
main_version_current = [0, 0, 0, 0]
|
||||||
|
|
||||||
|
# 从本地配置文件获取更新类型
|
||||||
|
if (app_path / "config/config.json").exists():
|
||||||
|
with (app_path / "config/config.json").open(mode="r", encoding="utf-8") as f:
|
||||||
|
config = json.load(f)
|
||||||
|
update_type = config["Update"]["UpdateType"]
|
||||||
|
else:
|
||||||
|
update_type = "main"
|
||||||
|
|
||||||
# 从远程服务器获取最新版本信息
|
# 从远程服务器获取最新版本信息
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json"
|
f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{update_type}/resources/version.json"
|
||||||
)
|
)
|
||||||
version_remote = response.json()
|
version_remote = response.json()
|
||||||
main_version_remote = list(
|
main_version_remote = list(
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"announcement": "\n# 这是一个中转版本,此版本后更换程序架构方式。\n# 由于更新方法无法通用,您需要在完成本次更新后再次检查更新以获取最新版本。\n",
|
"announcement": "\n# 这是一个中转版本,此版本后更换程序架构方式。\n# 由于更新方法无法通用,您需要在完成本次更新后再次检查更新以获取最新版本。\n",
|
||||||
"proxy_list":[
|
"proxy_list":[
|
||||||
"",
|
"",
|
||||||
|
"https://ghfast.top",
|
||||||
"https://gitproxy.click/",
|
"https://gitproxy.click/",
|
||||||
"https://cdn.moran233.xyz/",
|
"https://cdn.moran233.xyz/",
|
||||||
"https://gh.llkk.cc/",
|
"https://gh.llkk.cc/",
|
||||||
"https://github.akams.cn/",
|
"https://github.akams.cn/",
|
||||||
"https://www.ghproxy.cn/",
|
"https://www.ghproxy.cn/"
|
||||||
"https://ghp.ci/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"main_version": "4.2.2.2",
|
"main_version": "4.2.2.2",
|
||||||
"updater_version": "1.1.1.0",
|
"updater_version": "1.1.1.2",
|
||||||
"announcement": "\n## 新增功能\n- 添加用户每日代理次数上限功能 #15\n- 新增代理成功消息推送渠道Server酱与企业微信群机器人推送\n## 修复BUG\n- 修复自定义基建无法正常使用的问题\n- 修正人工排查文案\n## 程序优化\n- 无",
|
"announcement": "\n## 新增功能\n- 添加用户每日代理次数上限功能 #15\n- 新增代理成功消息推送渠道Server酱与企业微信群机器人推送\n- 添加更新类别可选项\n## 修复BUG\n- 修复自定义基建无法正常使用的问题\n- 修正人工排查文案\n- 修复高级MAA配置序号错位\n- 修复高级用户列表无法配置问题\n- 修复主调度台选项乱动问题\n- 修复更新器文件夹定位问题\n## 程序优化\n- 无",
|
||||||
"proxy_list": [
|
"proxy_list": [
|
||||||
"",
|
"",
|
||||||
|
"https://ghfast.top",
|
||||||
"https://gitproxy.click/",
|
"https://gitproxy.click/",
|
||||||
"https://cdn.moran233.xyz/",
|
"https://cdn.moran233.xyz/",
|
||||||
"https://gh.llkk.cc/",
|
"https://gh.llkk.cc/",
|
||||||
"https://github.akams.cn/",
|
"https://github.akams.cn/",
|
||||||
"https://www.ghproxy.cn/",
|
"https://www.ghproxy.cn/"
|
||||||
"https://ghp.ci/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user