mirror of
https://github.com/octopusYan/alist-gui.git
synced 2025-12-08 17:21:56 +08:00
Compare commits
9 Commits
alpha/v1.0
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 50cba0557f | |||
| 9e9a1b22b7 | |||
| a8db7cbf88 | |||
| 6a4e425f8a | |||
| 09f515025c | |||
| 96274f6952 | |||
| b468b9774d | |||
| 17d21fdc03 | |||
| 894439de6f |
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
### 截图
|
### 截图
|
||||||
|
|
||||||
<details>
|
<details open>
|
||||||
<summary> 主界面 </summary>
|
<summary> 主界面 </summary>
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/909ac6ad-0021-47d7-a75c-7fb6505e8c15">
|
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/909ac6ad-0021-47d7-a75c-7fb6505e8c15">
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</picture>
|
</picture>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details open>
|
||||||
<summary> 管理员信息 </summary>
|
<summary> 管理员信息 </summary>
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/840dca69-e67d-4083-88f8-8e67c3e47141">
|
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/840dca69-e67d-4083-88f8-8e67c3e47141">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</picture>
|
</picture>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details open>
|
||||||
<summary> 设置 </summary>
|
<summary> 设置 </summary>
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/8fc8c489-b9cd-4e34-ad32-4899ccc275e9">
|
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/8fc8c489-b9cd-4e34-ad32-4899ccc275e9">
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</picture>
|
</picture>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details open>
|
||||||
<summary> 关于 </summary>
|
<summary> 关于 </summary>
|
||||||
<picture>
|
<picture>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/dbef2d66-4ca4-4e89-8292-dbdce3566f93">
|
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/dbef2d66-4ca4-4e89-8292-dbdce3566f93">
|
||||||
|
|||||||
28
gui/pom.xml
28
gui/pom.xml
@ -7,11 +7,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.octopusyan</groupId>
|
<groupId>cn.octopusyan</groupId>
|
||||||
<artifactId>alist-gui</artifactId>
|
<artifactId>alist-gui</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>gui</artifactId>
|
<artifactId>gui</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>1.0.3</version>
|
||||||
<name>alist-gui</name>
|
<name>alist-gui</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -105,21 +105,6 @@
|
|||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>nexus</id>
|
|
||||||
<name>nexus-snapshot-repository</name>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
<updatePolicy>always</updatePolicy>
|
|
||||||
</snapshots>
|
|
||||||
<releases>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</releases>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
@ -136,7 +121,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>21</source>
|
<source>21</source>
|
||||||
<target>21</target>
|
<target>21</target>
|
||||||
@ -156,9 +140,8 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>us.hebi.sass</groupId>
|
<groupId>us.hebi.sass</groupId>
|
||||||
<artifactId>sass-cli-maven-plugin</artifactId>
|
<artifactId>sass-cli-maven-plugin</artifactId>
|
||||||
<version>1.0.3</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<sassVersion>1.78.0</sassVersion>
|
<sassVersion>1.81.0</sassVersion>
|
||||||
<args> <!-- Any argument that should be forwarded to the sass cli -->
|
<args> <!-- Any argument that should be forwarded to the sass cli -->
|
||||||
<arg>${cssSrcPath}/root.scss:${cssTargetPath}/root.css</arg>
|
<arg>${cssSrcPath}/root.scss:${cssTargetPath}/root.css</arg>
|
||||||
<arg>${cssSrcPath}/root-view.scss:${cssTargetPath}/root-view.css</arg>
|
<arg>${cssSrcPath}/root-view.scss:${cssTargetPath}/root-view.css</arg>
|
||||||
@ -183,7 +166,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-maven-plugin</artifactId>
|
<artifactId>javafx-maven-plugin</artifactId>
|
||||||
<version>0.0.8</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<stripDebug>true</stripDebug>
|
<stripDebug>true</stripDebug>
|
||||||
<compress>2</compress>
|
<compress>2</compress>
|
||||||
@ -209,7 +191,7 @@
|
|||||||
<mainClass>cn.octopusyan.alistgui/${exec.mainClass}</mainClass>
|
<mainClass>cn.octopusyan.alistgui/${exec.mainClass}</mainClass>
|
||||||
<options>
|
<options>
|
||||||
<option>--enable-preview</option>
|
<option>--enable-preview</option>
|
||||||
<!-- <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005</option>-->
|
<!-- <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005</option>-->
|
||||||
</options>
|
</options>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@ -220,7 +202,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.github.fvarrui</groupId>
|
<groupId>io.github.fvarrui</groupId>
|
||||||
<artifactId>javapackager</artifactId>
|
<artifactId>javapackager</artifactId>
|
||||||
<version>1.7.7-SNAPSHOT</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<mainClass>${exec.mainClass}</mainClass>
|
<mainClass>${exec.mainClass}</mainClass>
|
||||||
<bundleJre>true</bundleJre>
|
<bundleJre>true</bundleJre>
|
||||||
@ -280,7 +261,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<nonFilteredFileExtensions>
|
<nonFilteredFileExtensions>
|
||||||
<nonFilteredFileExtension>exe</nonFilteredFileExtension>
|
<nonFilteredFileExtension>exe</nonFilteredFileExtension>
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class Application extends javafx.application.Application {
|
|||||||
long delay = 0L;
|
long delay = 0L;
|
||||||
// 更新重启检查
|
// 更新重启检查
|
||||||
File upgradeFile = new File(Constants.DATA_DIR_PATH + File.separator + new Gui().getReleaseFile());
|
File upgradeFile = new File(Constants.DATA_DIR_PATH + File.separator + new Gui().getReleaseFile());
|
||||||
logger.error("{}{}{}", Constants.DATA_DIR_PATH, File.separator, new Gui().getReleaseFile());
|
// logger.error("{}{}{}", Constants.DATA_DIR_PATH, File.separator, new Gui().getReleaseFile());
|
||||||
if (upgradeFile.exists()) {
|
if (upgradeFile.exists()) {
|
||||||
logger.error("upgradeFile.exists");
|
logger.error("upgradeFile.exists");
|
||||||
FileUtil.del(upgradeFile);
|
FileUtil.del(upgradeFile);
|
||||||
@ -165,7 +165,7 @@ public class Application extends javafx.application.Application {
|
|||||||
instanceCheckLatch.countDown();
|
instanceCheckLatch.countDown();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
logger.error(STR."====\{instanceId}====");
|
logger.debug(STR."====\{instanceId}====");
|
||||||
try (
|
try (
|
||||||
Socket clientSocket = serverSocket.accept();
|
Socket clientSocket = serverSocket.accept();
|
||||||
BufferedReader in = new BufferedReader(
|
BufferedReader in = new BufferedReader(
|
||||||
|
|||||||
@ -143,24 +143,21 @@ public class AListManager {
|
|||||||
ConsoleLog.info(getText("alist.status.stop"));
|
ConsoleLog.info(getText("alist.status.stop"));
|
||||||
if (!running.get()) {
|
if (!running.get()) {
|
||||||
ConsoleLog.warning(getText("alist.status.stop.stopped"));
|
ConsoleLog.warning(getText("alist.status.stop.stopped"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
util.destroy();
|
util.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
static ChangeListener<Boolean> restartListener;
|
static ChangeListener<Boolean> restartListener = (_, _, run) -> {
|
||||||
|
if (run) return;
|
||||||
|
running.removeListener(AListManager.restartListener);
|
||||||
|
start();
|
||||||
|
};
|
||||||
|
|
||||||
public static void restart() {
|
public static void restart() {
|
||||||
if (!running.get()) {
|
if (!running.get()) {
|
||||||
start();
|
start();
|
||||||
} else {
|
} else {
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
restartListener = (_, _, run) -> {
|
|
||||||
if (run) return;
|
|
||||||
running.removeListener(restartListener);
|
|
||||||
start();
|
|
||||||
};
|
|
||||||
running.addListener(restartListener);
|
running.addListener(restartListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,7 +191,7 @@ public class AListManager {
|
|||||||
//============================={ private }====================================
|
//============================={ private }====================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 点击开始时检查 aList 执行文件
|
* 点击开始时检查 aList 执行文件
|
||||||
*/
|
*/
|
||||||
private static boolean checkAList() {
|
private static boolean checkAList() {
|
||||||
if (new File(Constants.ALIST_FILE).exists()) return true;
|
if (new File(Constants.ALIST_FILE).exists()) return true;
|
||||||
@ -216,6 +213,11 @@ public class AListManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始下载AList
|
||||||
|
*
|
||||||
|
* @param version 下载版本号
|
||||||
|
*/
|
||||||
private static void showDownload(String version) {
|
private static void showDownload(String version) {
|
||||||
String content = STR."""
|
String content = STR."""
|
||||||
\{getText("msg.alist.download.notfile")}
|
\{getText("msg.alist.download.notfile")}
|
||||||
|
|||||||
@ -19,9 +19,10 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +34,7 @@ public class ConsoleLog {
|
|||||||
public static final String format = "yyyy/MM/dd hh:mm:ss";
|
public static final String format = "yyyy/MM/dd hh:mm:ss";
|
||||||
private volatile static ConsoleLog log;
|
private volatile static ConsoleLog log;
|
||||||
private final VBox textArea;
|
private final VBox textArea;
|
||||||
private final static String CONSOLE_COLOR_PREFIX = "^\033[";
|
private final static String CONSOLE_COLOR_PREFIX = "\033[";
|
||||||
private final static String CONSOLE_MSG_REX = "^\033\\[(\\d+)m(.*)\033\\[0m(.*)$";
|
private final static String CONSOLE_MSG_REX = "^\033\\[(\\d+)m(.*)\033\\[0m(.*)$";
|
||||||
private final static String URL_IP_REX = "^((ht|f)tps?:\\/\\/)?[\\w-+&@#/%?=~_|!:,.;]*[\\w-+&@#/%=~_|]+(:\\d{1,5})?\\/?$";
|
private final static String URL_IP_REX = "^((ht|f)tps?:\\/\\/)?[\\w-+&@#/%?=~_|!:,.;]*[\\w-+&@#/%=~_|]+(:\\d{1,5})?\\/?$";
|
||||||
|
|
||||||
@ -88,16 +89,6 @@ public class ConsoleLog {
|
|||||||
if (StringUtils.isEmpty(message) || !isInit()) return;
|
if (StringUtils.isEmpty(message) || !isInit()) return;
|
||||||
message = message.strip();
|
message = message.strip();
|
||||||
message = StrUtil.format(message, param);
|
message = StrUtil.format(message, param);
|
||||||
|
|
||||||
// 多颜色消息处理
|
|
||||||
if (StringUtils.countMatches(message, CONSOLE_COLOR_PREFIX) > 1) {
|
|
||||||
String[] split = message.replace(CONSOLE_MSG_REX, "\n%s".formatted(CONSOLE_COLOR_PREFIX)).split("\n");
|
|
||||||
List<String> msgs = Arrays.stream(split).toList();
|
|
||||||
for (String msg : msgs) {
|
|
||||||
msg(msg);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
message = setPwdText(message);
|
message = setPwdText(message);
|
||||||
message = resetConsoleColor(message);
|
message = resetConsoleColor(message);
|
||||||
|
|
||||||
@ -187,17 +178,35 @@ public class ConsoleLog {
|
|||||||
/**
|
/**
|
||||||
* 控制台输出颜色
|
* 控制台输出颜色
|
||||||
*
|
*
|
||||||
* @param msg alist 输出消息
|
* @param msg 输出消息
|
||||||
* @return bbcode 颜色文本
|
* @return bbcode 颜色文本
|
||||||
*/
|
*/
|
||||||
private static String resetConsoleColor(String msg) {
|
private static String resetConsoleColor(String msg) {
|
||||||
if (!msg.contains("\033[")) return msg;
|
if (!msg.contains(CONSOLE_COLOR_PREFIX) || !Pattern.matches(CONSOLE_MSG_REX, msg)) return msg;
|
||||||
|
|
||||||
String colorCode = ReUtil.get(CONSOLE_MSG_REX, msg, 1);
|
// 多颜色处理
|
||||||
String color = StringUtils.lowerCase(Color.valueOf(Integer.parseInt(colorCode)).getColor());
|
String[] split = Pattern.compile("\\033\\[(\\d;)?(\\d+)m")
|
||||||
String colorMsg = ReUtil.get(CONSOLE_MSG_REX, msg, 2);
|
.matcher(msg)
|
||||||
msg = ReUtil.get(CONSOLE_MSG_REX, msg, 3);
|
.replaceAll(matchResult -> "\n" + matchResult.group())
|
||||||
return color(color, colorMsg) + msg;
|
.replaceFirst("\n", "")
|
||||||
|
.split("\n");
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
Pattern pattern = Pattern.compile("\\033\\[(\\d;)?(\\d+)m(.*)");
|
||||||
|
Matcher matcher;
|
||||||
|
for (int i = 0; i < split.length; i++) {
|
||||||
|
matcher = pattern.matcher(split[i]);
|
||||||
|
if(!matcher.matches()) continue;
|
||||||
|
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
String color = StringUtils.lowerCase(Color.valueOf(Integer.parseInt(matcher.group(2))).getColor());
|
||||||
|
sb.append(color(color, matcher.group(3)));
|
||||||
|
} else {
|
||||||
|
sb.append(matcher.group(3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package cn.octopusyan.alistgui.manager.http;
|
package cn.octopusyan.alistgui.manager.http;
|
||||||
|
|
||||||
import cn.octopusyan.alistgui.enums.ProxySetup;
|
import cn.octopusyan.alistgui.enums.ProxySetup;
|
||||||
import cn.octopusyan.alistgui.manager.http.handler.BodyHandler;
|
import cn.octopusyan.alistgui.manager.http.handler.DownloadBodyHandler;
|
||||||
import cn.octopusyan.alistgui.model.ProxyInfo;
|
import cn.octopusyan.alistgui.model.ProxyInfo;
|
||||||
import cn.octopusyan.alistgui.util.JsonUtil;
|
import cn.octopusyan.alistgui.util.JsonUtil;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
@ -126,7 +126,7 @@ public class HttpUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 下载处理器
|
// 下载处理器
|
||||||
var handler = BodyHandler.create(
|
var handler = DownloadBodyHandler.create(
|
||||||
Path.of(savePath),
|
Path.of(savePath),
|
||||||
StandardOpenOption.CREATE, StandardOpenOption.WRITE
|
StandardOpenOption.CREATE, StandardOpenOption.WRITE
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,16 +21,16 @@ import java.util.function.Consumer;
|
|||||||
* @author octopus_yan
|
* @author octopus_yan
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BodyHandler implements HttpResponse.BodyHandler<Path> {
|
public class DownloadBodyHandler implements HttpResponse.BodyHandler<Path> {
|
||||||
private final HttpResponse.BodyHandler<Path> handler;
|
private final HttpResponse.BodyHandler<Path> handler;
|
||||||
private BiConsumer<Long, Long> consumer;
|
private BiConsumer<Long, Long> consumer;
|
||||||
|
|
||||||
private BodyHandler(HttpResponse.BodyHandler<Path> handler) {
|
private DownloadBodyHandler(HttpResponse.BodyHandler<Path> handler) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BodyHandler create(Path directory, OpenOption... openOptions) {
|
public static DownloadBodyHandler create(Path directory, OpenOption... openOptions) {
|
||||||
return new BodyHandler(HttpResponse.BodyHandlers.ofFileDownload(directory, openOptions));
|
return new DownloadBodyHandler(HttpResponse.BodyHandlers.ofFileDownload(directory, openOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -17,6 +17,7 @@ import cn.octopusyan.alistgui.view.alert.AlertUtil;
|
|||||||
import cn.octopusyan.alistgui.view.alert.builder.AlertBuilder;
|
import cn.octopusyan.alistgui.view.alert.builder.AlertBuilder;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.property.*;
|
import javafx.beans.property.*;
|
||||||
|
import javafx.beans.value.ChangeListener;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,8 +145,13 @@ public class AboutViewModule extends BaseViewModel {
|
|||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
switch (app) {
|
switch (app) {
|
||||||
case AList _ -> {
|
case AList _ -> {
|
||||||
|
if(AListManager.isRunning()) {
|
||||||
|
AListManager.stop();
|
||||||
|
AListManager.runningProperty().addListener(updateListener);
|
||||||
|
} else {
|
||||||
// 下载完成后,解压并删除文件
|
// 下载完成后,解压并删除文件
|
||||||
DownloadUtil.unzip(app);
|
DownloadUtil.unzip(app);
|
||||||
|
}
|
||||||
// 设置应用版本
|
// 设置应用版本
|
||||||
aListVersion.setValue(aListNewVersion.getValue());
|
aListVersion.setValue(aListNewVersion.getValue());
|
||||||
AListManager.restart();
|
AListManager.restart();
|
||||||
@ -163,4 +169,12 @@ public class AboutViewModule extends BaseViewModel {
|
|||||||
}).execute();
|
}).execute();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static final ChangeListener<Boolean> updateListener = (_, _, run) -> {
|
||||||
|
if (!run) {
|
||||||
|
// 下载完成后,解压并删除文件
|
||||||
|
DownloadUtil.unzip(ConfigManager.aList());
|
||||||
|
}
|
||||||
|
AListManager.runningProperty().removeListener(AboutViewModule.updateListener);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,8 +65,14 @@ public class SetupViewModel extends BaseViewModel {
|
|||||||
proxySetup.addListener((_, _, newValue) -> ConfigManager.proxySetup(newValue));
|
proxySetup.addListener((_, _, newValue) -> ConfigManager.proxySetup(newValue));
|
||||||
proxyTestUrl.addListener((_, _, newValue) -> ConfigManager.proxyTestUrl(newValue));
|
proxyTestUrl.addListener((_, _, newValue) -> ConfigManager.proxyTestUrl(newValue));
|
||||||
proxyHost.addListener((_, _, newValue) -> ConfigManager.proxyHost(newValue));
|
proxyHost.addListener((_, _, newValue) -> ConfigManager.proxyHost(newValue));
|
||||||
proxyPort.addListener((_, _, newValue) -> ConfigManager.proxyPort(newValue));
|
proxyHost.addListener((_, _, newValue) -> {
|
||||||
language.addListener((_, _, newValue) -> Context.setLanguage(newValue));
|
ConfigManager.proxyHost(newValue);
|
||||||
|
setProxy();
|
||||||
|
});
|
||||||
|
proxyPort.addListener((_, _, newValue) -> {
|
||||||
|
ConfigManager.proxyPort(newValue);
|
||||||
|
setProxy();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectProperty<Theme> themeProperty() {
|
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) {
|
private static ProxyCheckTask getProxyCheckTask(String checkUrl) {
|
||||||
var task = new ProxyCheckTask(checkUrl);
|
var task = new ProxyCheckTask(checkUrl);
|
||||||
task.onListen(new TaskListener(task) {
|
task.onListen(new TaskListener(task) {
|
||||||
|
|||||||
58
pom.xml
58
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>cn.octopusyan</groupId>
|
<groupId>cn.octopusyan</groupId>
|
||||||
<artifactId>alist-gui</artifactId>
|
<artifactId>alist-gui</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.3</version>
|
||||||
<name>alist-gui</name>
|
<name>alist-gui</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
@ -30,8 +30,6 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<project.version>1.0.1</project.version>
|
|
||||||
|
|
||||||
<junit.version>5.10.0</junit.version>
|
<junit.version>5.10.0</junit.version>
|
||||||
<javafx.version>21.0.4</javafx.version>
|
<javafx.version>21.0.4</javafx.version>
|
||||||
<slf4j.version>2.0.16</slf4j.version>
|
<slf4j.version>2.0.16</slf4j.version>
|
||||||
@ -141,4 +139,58 @@
|
|||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>nexus</id>
|
||||||
|
<name>nexus-snapshot-repository</name>
|
||||||
|
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<updatePolicy>always</updatePolicy>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- https://github.com/HebiRobotics/sass-cli-maven-plugin -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>us.hebi.sass</groupId>
|
||||||
|
<artifactId>sass-cli-maven-plugin</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.openjfx</groupId>
|
||||||
|
<artifactId>javafx-maven-plugin</artifactId>
|
||||||
|
<version>0.0.8</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- https://github.com/fvarrui/JavaPackager -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.github.fvarrui</groupId>
|
||||||
|
<artifactId>javapackager</artifactId>
|
||||||
|
<version>1.7.7-SNAPSHOT</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
@ -7,11 +7,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.octopusyan</groupId>
|
<groupId>cn.octopusyan</groupId>
|
||||||
<artifactId>alist-gui</artifactId>
|
<artifactId>alist-gui</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>upgrade</artifactId>
|
<artifactId>upgrade</artifactId>
|
||||||
<version>${parent.version}</version>
|
<version>1.0.3</version>
|
||||||
<name>upgrade</name>
|
<name>upgrade</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -61,7 +61,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>21</source>
|
<source>21</source>
|
||||||
<target>21</target>
|
<target>21</target>
|
||||||
@ -79,7 +78,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-maven-plugin</artifactId>
|
<artifactId>javafx-maven-plugin</artifactId>
|
||||||
<version>0.0.8</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<stripDebug>true</stripDebug>
|
<stripDebug>true</stripDebug>
|
||||||
<compress>2</compress>
|
<compress>2</compress>
|
||||||
@ -112,7 +110,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.github.fvarrui</groupId>
|
<groupId>io.github.fvarrui</groupId>
|
||||||
<artifactId>javapackager</artifactId>
|
<artifactId>javapackager</artifactId>
|
||||||
<version>1.7.7-SNAPSHOT</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<mainClass>${exec.mainClass}</mainClass>
|
<mainClass>${exec.mainClass}</mainClass>
|
||||||
<bundleJre>true</bundleJre>
|
<bundleJre>true</bundleJre>
|
||||||
|
|||||||
Reference in New Issue
Block a user