Skip to content

Commit b6010ce

Browse files
committed
perf: 优化检查更新界面和更多参数页面
1 parent a681eb3 commit b6010ce

File tree

6 files changed

+28
-13
lines changed

6 files changed

+28
-13
lines changed

CheckUpdates.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CheckUpdates.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ private async void timer1_Tick(object sender, EventArgs e)
103103
if (mainForm != null)
104104
{
105105
githubProxyURL = await mainForm.GetGithubProxyUrlAsync();
106+
await mainForm.AutoCheckSysProxy();
106107
}
107108

108109
if (最新GUI版本号 != 当前GUI版本号)
@@ -111,7 +112,7 @@ private async void timer1_Tick(object sender, EventArgs e)
111112
string upgradeExePath = System.IO.Path.Combine(Application.StartupPath, "Upgrade.exe");
112113
if (System.IO.File.Exists(upgradeExePath))
113114
{
114-
buttonUpdateGUI.Text = "立即更新";
115+
buttonUpdateGUI.Text = "更新原版";
115116
buttonUpdateGUI.Enabled = true;
116117
}
117118
else
@@ -308,7 +309,7 @@ private async Task<string> DetectGitHubProxyAsync(List<string> proxyItems)
308309
return detectedProxyURL;
309310
}
310311

311-
private void button2_Click(object sender, EventArgs e)
312+
private void buttonUpdateKernel_Click(object sender, EventArgs e)
312313
{
313314
// 设置对话框结果为OK,表示用户点击了"立即更新"按钮
314315
this.DialogResult = DialogResult.OK;
@@ -317,7 +318,7 @@ private void button2_Click(object sender, EventArgs e)
317318
this.Close();
318319
}
319320

320-
private void button1_Click(object sender, EventArgs e)
321+
private void buttonUpdateGUI_Click(object sender, EventArgs e)
321322
{
322323
if (buttonUpdateGUI.Text == "立即更新 GUI")
323324
{

MainGui.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ public async Task DownloadSubsCheckEXE()
14621462
await SaveConfig(false);
14631463

14641464
// 可选:删除 zip 文件(注释状态保留原样)
1465-
File.Delete(zipFilePath);
1465+
//File.Delete(zipFilePath);
14661466
}
14671467
else
14681468
{
@@ -2458,7 +2458,7 @@ private async Task<string> DetectGitHubProxyAsync(List<string> proxyItems)
24582458
{
24592459
// 找到可用代理
24602460
detectedProxyURL = $"https://{proxyItem}/";
2461-
//richTextBoxAllLog.Clear();
2461+
richTextBoxAllLog.Clear();
24622462
Log($"找到可用 GitHub 代理: {proxyItem}", GetRichTextBoxAllLog());
24632463
proxyFound = true;
24642464
break;
@@ -2797,7 +2797,7 @@ private void buttonCheckUpdate_Click(object sender, EventArgs e)
27972797
};
27982798

27992799
// 设置 button2 点击后关闭窗口并返回 DialogResult.OK
2800-
// 这需要在 CheckUpdates.cs 中修改 button2_Click 方法
2800+
// 这需要在 CheckUpdates.cs 中修改 buttonUpdateKernel_Click 方法
28012801

28022802
// 显示 CheckUpdates 窗口
28032803
checkUpdatesForm.ShowDialog();
@@ -3844,8 +3844,8 @@ public async Task<string> GetGithubProxyUrlAsync()
38443844
const string AUTO = "自动选择";
38453845
if (comboBoxGithubProxyUrl == null) return githubProxyURL;
38463846

3847-
// 如果上次运行时间距今不足 30 分钟,直接返回上次结果(若有)
3848-
if (_lastGithubProxyUrl != null && (DateTime.Now - _lastGetGithubProxyRunTime).TotalMinutes < 30)
3847+
// 如果上次运行时间距今不足 1 分钟,直接返回上次结果(若有)
3848+
if (_lastGithubProxyUrl != null && (DateTime.Now - _lastGetGithubProxyRunTime).TotalMinutes < 1)
38493849
{
38503850
Log($"GitHub Proxy:{_lastGithubProxyUrl}", GetRichTextBoxAllLog());
38513851
return _lastGithubProxyUrl;

MoreYAML.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private void button2_Click(object sender, EventArgs e)
7878

7979
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
8080
{
81-
Process.Start("https://github.com/beck-8/subs-check/blob/master/config/config.example.yaml");
81+
Process.Start("https://github.com/sinspired/subs-check/blob/master/config/config.example.yaml");
8282
}
8383

8484
private void button1_Click(object sender, EventArgs e)

MoreYAML.resx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ recipient-url:
132132
# 钉钉格式:dingtalk://&lt;secret&gt;@&lt;dd_token&gt;/&lt;chat_id&gt;
133133
# - dingtalk://xxxxxx@xxxxxxx/123123
134134
# 自定义通知标题
135-
notify-title: "🔔 节点状态更新"</value>
135+
notify-title: "🔔 节点状态更新"
136+
137+
# 符合条件节点数量的占比,低于此值会将订阅链接打印出来,用于排查质量差的订阅
138+
success-rate: 0
139+
140+
# platforms:
141+
# - iprisk
142+
# - openai
143+
# - gemini
144+
# - tiktok
145+
# - youtube
146+
# - netflix
147+
# - disney
148+
# - x
149+
</value>
136150
</data>
137151
</root>

Proxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static async Task<bool> IsSysProxyAvailableAsync(string proxy)
7474

7575
using (var client = new HttpClient(handler))
7676
{
77-
client.Timeout = TimeSpan.FromSeconds(10);
77+
client.Timeout = TimeSpan.FromSeconds(5);
7878

7979
var testUrls = new List<Tuple<string, HttpStatusCode>>
8080
{

0 commit comments

Comments
 (0)