Skip to content

Commit 7632b0d

Browse files
committed
1
1 parent 1c1a8e4 commit 7632b0d

10 files changed

Lines changed: 26 additions & 24 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ Path : JDK安装目录\bin
111111

112112
```
113113
Linux: mkdir /home/nginxWebUI/
114-
wget -O /home/nginxWebUI/nginxWebUI.jar https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.5/nginxWebUI-4.3.5.jar
114+
wget -O /home/nginxWebUI/nginxWebUI.jar https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.6/nginxWebUI-4.3.6.jar
115115
116-
Windows: 直接使用浏览器下载 https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.5/nginxWebUI-4.3.5.jar 到 D:/home/nginxWebUI/nginxWebUI.jar
116+
Windows: 直接使用浏览器下载 https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.6/nginxWebUI-4.3.6.jar 到 D:/home/nginxWebUI/nginxWebUI.jar
117117
```
118118

119119
有新版本只需要修改路径中的版本即可

README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ reboot
107107

108108
```
109109
Linux: mkdir /home/nginxWebUI/
110-
wget -O /home/nginxWebUI/nginxWebUI.jar https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.5/nginxWebUI-4.3.5.jar
110+
wget -O /home/nginxWebUI/nginxWebUI.jar https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.6/nginxWebUI-4.3.6.jar
111111
112-
Windows: Download directly from your browser https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.5/nginxWebUI-4.3.5.jar into D:/home/nginxWebUI/
112+
Windows: Download directly from your browser https://gitee.com/cym1102/nginxWebUI/releases/download/4.3.6/nginxWebUI-4.3.6.jar into D:/home/nginxWebUI/
113113
```
114114

115115
With a new version, you just need to change the version in the path

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<modelVersion>4.0.0</modelVersion>
1212
<groupId>com.cym</groupId>
1313
<artifactId>nginxWebUI</artifactId>
14-
<version>4.3.5</version>
14+
<version>4.3.6</version>
1515

1616
<properties>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/com/cym/NginxWebUI.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import cn.hutool.core.io.FileUtil;
1919
import cn.hutool.core.thread.ThreadUtil;
2020
import cn.hutool.core.util.RuntimeUtil;
21-
import cn.hutool.core.util.StrUtil;
2221

2322
@EnableScheduling
2423
@SolonMain
@@ -27,8 +26,6 @@ public class NginxWebUI {
2726

2827
public static void main(String[] args) {
2928
boolean findPass = false;
30-
String initAdmin = null;
31-
String initPass = null;
3229

3330
if (args != null) {
3431
for (String arg : args) {
@@ -37,8 +34,6 @@ public static void main(String[] args) {
3734
}
3835
}
3936
}
40-
41-
4237

4338
try {
4439
if (!findPass) {

src/main/java/com/cym/config/InitConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ private void showLogo() throws IOException {
229229

230230
}
231231

232+
@Deprecated
232233
private void transferSql() {
233234
// 关闭sqlite连接
234235
dataSourceEmbed.getDataSource().close();

src/main/java/com/cym/config/VersionConfig.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import cn.hutool.json.JSONUtil;
2424

2525
@Component
26-
public class VersionConfig {
26+
public class VersionConfig {
2727
Logger logger = LoggerFactory.getLogger(VersionConfig.class);
2828

2929
public Version newVersion;
@@ -32,17 +32,15 @@ public class VersionConfig {
3232

3333
@Init
3434
public void afterInjection() {
35-
checkVersion();
36-
}
37-
38-
public void checkVersion(){
3935
// 获取版本号
4036
try {
4137
currentVersion = getFromPom();
4238
} catch (Exception e) {
4339
logger.info(e.getMessage(), e);
4440
}
41+
}
4542

43+
public void checkVersion() {
4644
// 获取服务器最新版本
4745
try {
4846
String json = HttpUtil.get("https://www.nginxwebui.cn/download/version.json", 1000);
@@ -54,7 +52,7 @@ public void checkVersion(){
5452

5553
}
5654
}
57-
55+
5856
public String getFromPom() throws IOException, XmlPullParserException {
5957

6058
// 查看jar包里面pom.properties版本号

src/main/java/com/cym/controller/adminPage/LoginController.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import cn.hutool.core.codec.Base64;
3232
import cn.hutool.core.lang.UUID;
33+
import cn.hutool.core.thread.ThreadUtil;
3334
import cn.hutool.core.util.StrUtil;
3435

3536
/**
@@ -142,9 +143,6 @@ public JsonResult submitLogin(String name, String pass, String code, String auth
142143
Context.current().sessionSet("admin", admin);
143144
Context.current().sessionRemove("imgCode"); // 立刻销毁验证码
144145

145-
// 检查更新
146-
versionConfig.checkVersion();
147-
148146
return renderSuccess(admin);
149147
}
150148

@@ -160,8 +158,6 @@ public JsonResult autoLogin(String autoKey) {
160158
Context.current().sessionSet("admin", admin);
161159
Context.current().sessionRemove("imgCode"); // 立刻销毁验证码
162160

163-
// 检查更新
164-
versionConfig.checkVersion();
165161

166162
return renderSuccess(admin);
167163
} else {
@@ -335,5 +331,4 @@ public JsonResult changeLang(String lang) {
335331
return renderSuccess();
336332
}
337333

338-
339334
}

src/main/java/com/cym/task/ScheduleTask.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.slf4j.LoggerFactory;
1616

1717
import com.cym.config.HomeConfig;
18+
import com.cym.config.VersionConfig;
1819
import com.cym.controller.adminPage.CertController;
1920
import com.cym.controller.adminPage.ConfController;
2021
import com.cym.controller.adminPage.RemoteController;
@@ -73,7 +74,15 @@ public class ScheduleTask {
7374
HomeConfig homeConfig;
7475
@Inject
7576
BLogFileTailer bLogFileTailer;
77+
@Inject
78+
VersionConfig versionConfig;
7679

80+
// 检查更新
81+
@Scheduled(cron = "0 0 0 * * ?")
82+
public void checkUpdate() {
83+
versionConfig.checkVersion();
84+
}
85+
7786
// 续签证书
7887
@Scheduled(cron = "0 0 0/2 * * ?")
7988
public void certTasks() {

src/main/resources/WEB-INF/view/adminPage/server/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
width: 120px;
8181
}
8282

83+
.middle{
84+
width: 200px;
85+
}
86+
8387
.long {
8488
width: 300px;
8589
display: inline-block;

src/main/resources/static/js/adminPage/server/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ function buildHtml(uuid, location, upstreamSelect) {
618618
</td>
619619
<td>
620620
<div class="layui-inline" >
621-
<input type="text" name="path" class="layui-input short" value="${location.path}">
621+
<input type="text" name="path" class="layui-input middle" value="${location.path}">
622622
</div>
623623
</td>
624624
<td>
@@ -636,7 +636,7 @@ function buildHtml(uuid, location, upstreamSelect) {
636636
<td style="width: 740px;">
637637
<span name="valueSpan">
638638
<div class="layui-inline">
639-
<input type="text" style="width: 277px;" name="value" id="value_${uuid}" class="layui-input long" value="" placeholder="${serverStr.example}:http://127.0.0.1:8080">
639+
<input type="text" name="value" id="value_${uuid}" class="layui-input middle" value="" placeholder="${serverStr.example}:http://127.0.0.1:8080">
640640
</div>
641641
</span>
642642

0 commit comments

Comments
 (0)