diff --git a/README.md b/README.md index f72cde7..995a85a 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,42 @@ -# Yan Frp +# YanFrp 基于javafx开发的 frp 客户端 -后台管理面板使用的是开源的 frp 管理面板 [SakuraPanel](https://github.com/ZeroDream-CN/SakuraPanel) - - ps:为了适配 yanfrp 我自己修改了些面板代码,如果想自己搭建需要改造 - - 管理面板网址:https://frp.octopusyan.top/?page=login -# 说明: +### 说明: - 1. +- 后台管理面板使用的是开源的 frp 管理面板 [SakuraPanel](https://github.com/ZeroDream-CN/SakuraPanel) +- ps:为了适配 yanfrp 我自己修改了些面板代码,如果想自己搭建需要改造 +- 管理面板网址:https://frp.octopusyan.top/?page=login -# 后续开发计划 +### 安装教程 -- ~~HTTP Basic Auth~~ (已完成) -- ~~添加p2p连接方式(xtcp,stcp)~~ (已完成) -- 删除 +1. git clone https://gitee.com/octopus_yan/yan-frp.git +2. mvn jfx:jar + +### 后续? + +- ~~HTTP Basic Auth~~ +- ~~添加连接方式(xtcp,stcp)~~ +- ~~删除隧道~~ - HTTP URL路由 - 待添加... -# 界面: -登录 +#### 参与贡献 +1. 有实际需要的朋友,请留言联系哈 + + +### 界面: + +#### 登录 ![Image text](https://git.octopusyan.top/octopus_yan/YanFrp/raw/branch/master/readme/login.png) -注册 - +#### 注册 ![Image text](https://git.octopusyan.top/octopus_yan/YanFrp/raw/branch/master/readme/register.png) -主界面 - +#### 主界面 ![Image text](https://git.octopusyan.top/octopus_yan/YanFrp/raw/branch/master/readme/main.png) -主界面-运行 - +#### 主界面-运行 ![Image text](https://git.octopusyan.top/octopus_yan/YanFrp/raw/branch/master/readme/main-run.png) diff --git a/pom.xml b/pom.xml index f3f1127..f0ee9d4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ top.octopusyan yanfrp - 1.1.3 + 1.1.4 yanfrp diff --git a/src/main/java/top/octopusyan/base/BaseController.java b/src/main/java/top/octopusyan/base/BaseController.java index bc88f64..0e47b3c 100644 --- a/src/main/java/top/octopusyan/base/BaseController.java +++ b/src/main/java/top/octopusyan/base/BaseController.java @@ -82,7 +82,7 @@ public abstract class BaseController

implements Initializable { } // app 版本信息 - if (getAppVersionLabel() != null) getAppVersionLabel().setText("version : v" + ApplicatonStore.APP_VERSION); + if (getAppVersionLabel() != null) getAppVersionLabel().setText("v" + ApplicatonStore.APP_VERSION); // 这个位置的左边第一个 JFXBtn 会莫名其妙会的焦点效果,启动时禁用焦点,取消按钮效果 if (getFirstBtn() != null) getFirstBtn().setDisableVisualFocus(true); diff --git a/src/main/java/top/octopusyan/config/ProxyConfig.java b/src/main/java/top/octopusyan/config/ProxyConfig.java index d6484bf..43c970e 100644 --- a/src/main/java/top/octopusyan/config/ProxyConfig.java +++ b/src/main/java/top/octopusyan/config/ProxyConfig.java @@ -29,9 +29,9 @@ public class ProxyConfig { serverIp.put("上海", "127.0.0.1"); typePort.put("http", 80); - typePort.put("https", 80); - typePort.put("tcp", 0); - typePort.put("udp", 0); + typePort.put("https", 443); + typePort.put("tcp", 25565); + typePort.put("udp", 53); } diff --git a/src/main/java/top/octopusyan/config/TextValidate.java b/src/main/java/top/octopusyan/config/TextValidate.java index c0ea21c..85e7731 100644 --- a/src/main/java/top/octopusyan/config/TextValidate.java +++ b/src/main/java/top/octopusyan/config/TextValidate.java @@ -88,7 +88,7 @@ public class TextValidate { static { EmailFormat.setRegexPattern("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$"); AccoountValidator.setRegexPattern("^[a-zA-Z0-9_-]*$"); - PortFormat.setRegexPattern("^([0-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{4}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"); + PortFormat.setRegexPattern("^([1-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{4}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"); IpFormat.setRegexPattern("^(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\" + ".(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])$"); HttpUserFormat.setRegexPattern("^[a-zA-Z0-9_-]*$"); diff --git a/src/main/java/top/octopusyan/controller/MainController.java b/src/main/java/top/octopusyan/controller/MainController.java index 7be0705..2539b2c 100644 --- a/src/main/java/top/octopusyan/controller/MainController.java +++ b/src/main/java/top/octopusyan/controller/MainController.java @@ -5,17 +5,12 @@ import com.alibaba.fastjson.JSONObject; import com.jfoenix.controls.*; import com.jfoenix.validation.base.ValidatorBase; import javafx.application.Platform; -import javafx.beans.InvalidationListener; -import javafx.beans.Observable; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; -import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.Label; import javafx.scene.control.*; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.HBox; @@ -35,9 +30,9 @@ import top.octopusyan.manager.http.request.ProxySetup; import top.octopusyan.model.ApplicatonStore; import top.octopusyan.model.ProxySetupModel; import top.octopusyan.utils.*; +import top.octopusyan.view.ProxyListItemView; import java.io.IOException; -import java.util.List; import java.util.*; import static top.octopusyan.model.ApplicatonStore.*; @@ -51,9 +46,6 @@ import static top.octopusyan.model.ApplicatonStore.*; public class MainController extends BaseController implements Initializable { public static final String PROXY_LIST_ITEM_CLASS = "proxyListItem"; - public static final String PROXY_LIST_ITEM_STOP_CLASS = "proxyListItem-stop"; - public static final String PROXY_LIST_ITEM_RUN_CLASS = "proxyListItem-run"; - public static final String PROXY_LIST_ITEM_CLOSE_CLASS = "proxyListItem-close"; public static final String PROXY_LIST_ITEM_SELECT_CLASS = "proxyListItem-select"; @@ -88,7 +80,7 @@ public class MainController extends BaseController implements Initial public JFXButton copyDomainBtn; /* 隧道列表控件 */ - public JFXListView

true:run false:stop null:disable + * + * @param status 运行状态 + */ + public void setStatus(Boolean status) { + // 初始化样式 + if (style == null) style = statusIcon.getStyle(); + + if (status == null) { + statusIcon.setStyle(style + "-fx-icon-color: linear-gradient(grey, #524e50);"); + } else if (status) { + statusIcon.setStyle(style + "-fx-icon-color: linear-gradient(#95f257, #91e5ac);"); + } else { + statusIcon.setStyle(style + "-fx-icon-color: linear-gradient(#f25757, #e591b1);"); + } + } + + public void setName(String proxyName) { + this.proxyName.setText(proxyName); + } + + public StringProperty textProperty() { + return proxyName.textProperty(); + } + + public Label getProxyName() { + return proxyName; + } + + public JFXButton getDeleteBtn() { + return deleteBtn; + } + + public enum Status { + RUN, STOP, DISABLED + } +} diff --git a/src/main/resources/css/main.css b/src/main/resources/css/main.css index cd7ca99..d05351a 100644 --- a/src/main/resources/css/main.css +++ b/src/main/resources/css/main.css @@ -51,26 +51,10 @@ -fx-opacity: 0.7; -fx-background-color: linear-gradient(#9198e5, #57b4f2); } -#proxyListView .list-cell:hover lable, #proxyListView .list-cell:selected label, .proxyListItem-select{ +#proxyListView .list-cell:hover lable, #proxyListView .list-cell:selected label, .proxyListItem-select label{ -fx-text-fill: white; } -.proxyListItemLabel { - -fx-font-size: 16px; -} -.proxyListItemIcon { - -fx-font-size: 14px; -} - -.proxyListItem-run FontIcon { - -fx-icon-color: linear-gradient(#95f257, #91e5ac); -} -.proxyListItem-stop FontIcon { - -fx-icon-color: linear-gradient(#f25757, #e591b1); -} -.proxyListItem-close FontIcon { - -fx-icon-color: linear-gradient(grey, #524e50); -} /* 面板背景 */ #proxySetupPane, #proxyListPane, .whitePane { diff --git a/src/main/resources/fxml/main.fxml b/src/main/resources/fxml/main.fxml index 65351ee..6bae540 100644 --- a/src/main/resources/fxml/main.fxml +++ b/src/main/resources/fxml/main.fxml @@ -157,7 +157,7 @@ - + @@ -190,37 +190,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +