Compare commits

...

2 Commits

Author SHA1 Message Date
96274f6952 chore: README.md 2024-11-11 22:53:27 +08:00
b468b9774d chore: 手动代理修改配置 2024-11-11 00:01:32 +08:00
2 changed files with 20 additions and 6 deletions

View File

@ -20,7 +20,7 @@
### 截图
<details>
<details open>
<summary> 主界面 </summary>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/909ac6ad-0021-47d7-a75c-7fb6505e8c15">
@ -28,7 +28,7 @@
</picture>
</details>
<details>
<details open>
<summary> 管理员信息 </summary>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/840dca69-e67d-4083-88f8-8e67c3e47141">
@ -36,7 +36,7 @@
</picture>
</details>
<details>
<details open>
<summary> 设置 </summary>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/8fc8c489-b9cd-4e34-ad32-4899ccc275e9">
@ -44,7 +44,7 @@
</picture>
</details>
<details>
<details open>
<summary> 关于 </summary>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/dbef2d66-4ca4-4e89-8292-dbdce3566f93">

View File

@ -65,8 +65,14 @@ public class SetupViewModel extends BaseViewModel {
proxySetup.addListener((_, _, newValue) -> ConfigManager.proxySetup(newValue));
proxyTestUrl.addListener((_, _, newValue) -> ConfigManager.proxyTestUrl(newValue));
proxyHost.addListener((_, _, newValue) -> ConfigManager.proxyHost(newValue));
proxyPort.addListener((_, _, newValue) -> ConfigManager.proxyPort(newValue));
language.addListener((_, _, newValue) -> Context.setLanguage(newValue));
proxyHost.addListener((_, _, newValue) -> {
ConfigManager.proxyHost(newValue);
setProxy();
});
proxyPort.addListener((_, _, newValue) -> {
ConfigManager.proxyPort(newValue);
setProxy();
});
}
public ObjectProperty<Theme> themeProperty() {
@ -123,6 +129,14 @@ public class SetupViewModel extends BaseViewModel {
});
}
private void setProxy() {
ConfigManager.checkProxy((success, _) -> {
if (!success) return;
HttpUtil.getInstance().proxy(ConfigManager.proxySetup(), ConfigManager.getProxyInfo());
});
}
private static ProxyCheckTask getProxyCheckTask(String checkUrl) {
var task = new ProxyCheckTask(checkUrl);
task.onListen(new TaskListener(task) {