feat: 移除更新类型字段
This commit is contained in:
@@ -111,9 +111,6 @@ class GlobalConfig(ConfigBase):
|
|||||||
Notify_CompanyWebHookBotUrl = ConfigItem("Notify", "CompanyWebHookBotUrl", "")
|
Notify_CompanyWebHookBotUrl = ConfigItem("Notify", "CompanyWebHookBotUrl", "")
|
||||||
|
|
||||||
Update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator())
|
Update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator())
|
||||||
Update_UpdateType = ConfigItem(
|
|
||||||
"Update", "UpdateType", "stable", OptionsValidator(["stable", "beta"])
|
|
||||||
)
|
|
||||||
Update_Source = ConfigItem(
|
Update_Source = ConfigItem(
|
||||||
"Update",
|
"Update",
|
||||||
"Source",
|
"Source",
|
||||||
|
|||||||
@@ -140,9 +140,6 @@ class GlobalConfig_Notify(BaseModel):
|
|||||||
|
|
||||||
class GlobalConfig_Update(BaseModel):
|
class GlobalConfig_Update(BaseModel):
|
||||||
IfAutoUpdate: Optional[bool] = Field(default=None, description="是否自动更新")
|
IfAutoUpdate: Optional[bool] = Field(default=None, description="是否自动更新")
|
||||||
UpdateType: Optional[Literal["stable", "beta"]] = Field(
|
|
||||||
default=None, description="更新类型, stable为稳定版, beta为测试版"
|
|
||||||
)
|
|
||||||
Source: Optional[Literal["GitHub", "MirrorChyan", "AutoSite"]] = Field(
|
Source: Optional[Literal["GitHub", "MirrorChyan", "AutoSite"]] = Field(
|
||||||
default=None, description="更新源: GitHub源, Mirror酱源, 自建源"
|
default=None, description="更新源: GitHub源, Mirror酱源, 自建源"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class _UpdateHandler:
|
|||||||
logger.info("开始检查更新")
|
logger.info("开始检查更新")
|
||||||
|
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
f"https://mirrorchyan.com/api/resources/AUTO_MAA/latest?user_agent=AutoMasGui¤t_version={current_version}&cdk={Config.get('Update', 'MirrorChyanCDK')}&channel={Config.get('Update', 'UpdateType')}",
|
f"https://mirrorchyan.com/api/resources/AUTO_MAA/latest?user_agent=AutoMasGui¤t_version={current_version}&cdk={Config.get('Update', 'MirrorChyanCDK')}&channel=stable",
|
||||||
timeout=10,
|
timeout=10,
|
||||||
proxies=Config.get_proxies(),
|
proxies=Config.get_proxies(),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ export type GlobalConfig_Update = {
|
|||||||
* 是否自动更新
|
* 是否自动更新
|
||||||
*/
|
*/
|
||||||
IfAutoUpdate?: (boolean | null);
|
IfAutoUpdate?: (boolean | null);
|
||||||
/**
|
|
||||||
* 更新类型, stable为稳定版, beta为测试版
|
|
||||||
*/
|
|
||||||
UpdateType?: ('stable' | 'beta' | null);
|
|
||||||
/**
|
/**
|
||||||
* 更新源: GitHub源, Mirror酱源, 自建源
|
* 更新源: GitHub源, Mirror酱源, 自建源
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export interface SettingsData {
|
|||||||
}
|
}
|
||||||
Update: {
|
Update: {
|
||||||
IfAutoUpdate: boolean
|
IfAutoUpdate: boolean
|
||||||
UpdateType: string
|
|
||||||
Source: string
|
Source: string
|
||||||
ProxyAddress: string
|
ProxyAddress: string
|
||||||
MirrorChyanCDK: string
|
MirrorChyanCDK: string
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ const settings = reactive<SettingsData>({
|
|||||||
},
|
},
|
||||||
Update: {
|
Update: {
|
||||||
IfAutoUpdate: false,
|
IfAutoUpdate: false,
|
||||||
UpdateType: 'stable',
|
|
||||||
Source: 'GitHub',
|
Source: 'GitHub',
|
||||||
ProxyAddress: '',
|
ProxyAddress: '',
|
||||||
MirrorChyanCDK: '',
|
MirrorChyanCDK: '',
|
||||||
@@ -107,11 +106,6 @@ const sendTaskResultTimeOptions = [
|
|||||||
{ label: '仅失败时', value: '仅失败时' },
|
{ label: '仅失败时', value: '仅失败时' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const updateTypeOptions = [
|
|
||||||
{ label: '稳定版', value: 'stable' },
|
|
||||||
{ label: '测试版', value: 'beta' },
|
|
||||||
]
|
|
||||||
|
|
||||||
const updateSourceOptions = [
|
const updateSourceOptions = [
|
||||||
{ label: 'GitHub', value: 'GitHub' },
|
{ label: 'GitHub', value: 'GitHub' },
|
||||||
{ label: 'Mirror酱', value: 'MirrorChyan' },
|
{ label: 'Mirror酱', value: 'MirrorChyan' },
|
||||||
@@ -981,7 +975,7 @@ onMounted(() => {
|
|||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :span="8">
|
<a-col :span="12">
|
||||||
<div class="form-item-vertical">
|
<div class="form-item-vertical">
|
||||||
<div class="form-label-wrapper">
|
<div class="form-label-wrapper">
|
||||||
<span class="form-label">自动检查更新</span>
|
<span class="form-label">自动检查更新</span>
|
||||||
@@ -1002,24 +996,7 @@ onMounted(() => {
|
|||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="12">
|
||||||
<div class="form-item-vertical">
|
|
||||||
<div class="form-label-wrapper">
|
|
||||||
<span class="form-label">更新类型</span>
|
|
||||||
<a-tooltip title="选择版本更新类型">
|
|
||||||
<QuestionCircleOutlined class="help-icon" />
|
|
||||||
</a-tooltip>
|
|
||||||
</div>
|
|
||||||
<a-select
|
|
||||||
v-model:value="settings.Update.UpdateType"
|
|
||||||
@change="(value: any) => handleSettingChange('Update', 'UpdateType', value)"
|
|
||||||
:options="updateTypeOptions"
|
|
||||||
size="large"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<div class="form-item-vertical">
|
<div class="form-item-vertical">
|
||||||
<div class="form-label-wrapper">
|
<div class="form-label-wrapper">
|
||||||
<span class="form-label">更新源</span>
|
<span class="form-label">更新源</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user