Skip to content

Commit

Permalink
升级至2.5
Browse files Browse the repository at this point in the history
1.任务列表UI调整为列表模式
2.任务列表支持批量暂停、继续、删除
3.修复暂停时删除下载的文件导致下载进度超过100%的BUG
4.修复部分情况获取是否含有root权限导致程序无法正常启动的BUG
  • Loading branch information
monkeyWie committed Apr 18, 2018
1 parent a538b90 commit 0551599
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<details>
<summary>安装完后进入百度云页面没有显示proxyee-down标记?</summary>

**如果是校内网或宽带拨号上网的,请[安装switchy插件](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/switchy/read.md)进行下载**
**先尝试重启软件和浏览器,若还是不显示可以[安装switchy插件](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/switchy/read.md)进行下载**
</details>
<details>
<summary>运行时提示证书安装失败?</summary>
Expand Down
Binary file added .guide/common/ca/linux/imgs/2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions .guide/common/ca/linux/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### linux安装证书
本教程以chrome浏览器为例,firefox的可以参考[火狐浏览器安装证书](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/ca/firefox/read.md)
1. 右击软件托盘,点证书目录会跳转到对应目录
2. 打开chrome,进入设置->高级->管理证书,选择授权中心然后点击导入,然后选择第一步证书目录中的ca.crt文件。在弹出的信任证书框中把三个复选框都勾上,点击确定即可。
![](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/common/ca/linux/imgs/2-1.png)


Binary file removed .guide/linux/imgs/11.png
Binary file not shown.
Binary file removed .guide/linux/imgs/5.png
Binary file not shown.
50 changes: 10 additions & 40 deletions .guide/linux/read.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,30 @@
## 下载
进入[下载页面](https://github.com/monkeyWie/proxyee-down#下载),选择proxyee-down-x.xx-jar.zip文件进行下载。
## 安装环境
- 进入[JRE下载页面](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html),下载对应的JRE
![1](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/linux/imgs/1.png)

- 以root用户登录将下载的jre-8u161-linux-x64.tar.gz文件放到/temp目录下,使用如下命令解压:
```tar zxvf jre-8u161-linux-x64.tar.gz```

- 将解压后的jre1.8.0_161复制到/opt下,命令如下:
```
root@test:~# mkdir /temp
root@test:~# cd /temp
root@test:/temp# tar zxvf jre-8u161-linux-x64.tar.gz
root@test:/temp# cd /opt
root@test:/opt# mv /temp/jre1.8.0_161/ .
```

- 在/bin目录下创建java软链接
```
root@test:/opt# cd /bin
root@test:/bin# ln -s /opt/jre1.8.0_161/bin/java java
- 将下载的jre-8u161-linux-x64.tar.gz文件解压:
```
- 验证软件的正确性
![5](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/linux/imgs/5.png)

- 配置Java环境
sudo tar zxvf jre-8u161-linux-x64.tar.gz
```
root@test:/bin# gedit /etc/profile
export JAVA_HOME=/opt/jre1.8.0_161
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib #这句容易出错
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
root@test:/bin# source /etc/profile
root@test:/bin# echo $JAVA_HOME
/opt/jre1.8.0_161
```

## 解压并运行

将下载好的proxyee-down-x.xx-jar.zip解压至任意目录。运行以下两条命令:
将下载好的proxyee-down-x.xx-jar.zip解压至任意目录。使用刚刚解压出的jre运行
(xxx为刚刚解压出来的jre绝对路径)
```
ulimit -c unlimited
java -jar proxyee-down.jar
xxx/bin/java -jar -Dfile.encoding=GBK -Xms256m -Xmx512m ./proxyee-down.jar
```
![10](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/linux/imgs/10.png)

## 证书安装
访问`127.0.0.1:9999`下载证书,选择第一条`Trust this CA to identify websites`,然后OK
![11](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/linux/imgs/11.png)
[查看](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/ca/read.md)

## SwitchyOmega插件安装与设置

[查看](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/switchy/read.md)

## 开启飞速下载
打开浏览器,选择要下载的资源进行下载就会弹出下载页面了。
## 完成
打开**网页浏览器**,选择要下载的资源进行下载就会弹出下载页面了。



2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
百度云大文件、合并下载限制突破,成功安装下载器后,打开百度云页面会有如下提示,然后在选择文件后点击下载按钮即可调用proxyee-down下载
![百度云破解](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/common/bdy-hook.png)
### 百度云解压工具
在下载器工具页面里进入百度云解压工具,选择百度云批量下载的文件进行解压
由于百度批量下载的zip压缩包不是zip64格式,在压缩包里有超过4G文件的时候普通的解压工具并不能正确的识别文件大小从而导致压缩失败,遇到这种情况时可以在下载器左侧**工具**栏目里找到百度云解压工具进行解压
![百度云解压](https://github.com/monkeyWie/proxyee-down/raw/master/.guide/common/bdy-unzip.png)
## 其他
### SwitchyOmega插件安装与设置
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.44</version>
<version>2.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/lee/study/down/io/BdyZip.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public interface BdyUnzipCallback {
void onError(Exception e);
}

static class TestUnzipCallback implements BdyUnzipCallback {
public static class TestUnzipCallback implements BdyUnzipCallback {

@Override
public void onStart() {
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/lee/study/down/model/TaskInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ public TaskInfo buildChunkInfoList() {
}

public void reset() {
startTime = lastTime = pauseTime = 0;
startTime = lastTime = pauseTime = downSize = 0;
chunkInfoList.forEach((chunkInfo) -> {
chunkInfo.setStartTime(0);
chunkInfo.setLastTime(0);
chunkInfo.setPauseTime(0);
chunkInfo.setDownSize(0);
chunkInfo.setErrorCount(0);
});
}
Expand Down
30 changes: 19 additions & 11 deletions common/src/main/java/lee/study/down/util/OsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,27 @@ public static boolean is32() {
}

static {
Preferences prefs = Preferences.systemRoot();
PrintStream systemErr = System.err;
synchronized (systemErr) { // better synchroize to avoid problems with other threads that access System.err
System.setErr(null);
if (isWindows()) {
Preferences prefs = Preferences.systemRoot();
PrintStream systemErr = System.err;
synchronized (systemErr) { // better synchroize to avoid problems with other threads that access System.err
System.setErr(null);
try {
prefs.put("pd_test", "1"); // SecurityException on Windows
prefs.remove("pd_test");
prefs.flush(); // BackingStoreException on Linux
isAdmin = true;
} catch (Exception e) {
isAdmin = false;
} finally {
System.setErr(systemErr);
}
}
} else {
try {
prefs.put("pd_test", "1"); // SecurityException on Windows
prefs.remove("pd_test");
prefs.flush(); // BackingStoreException on Linux
isAdmin = true;
} catch (Exception e) {
isAdmin = "0".equals(getProcessPrint("id -u").trim());
} catch (IOException e) {
isAdmin = false;
} finally {
System.setErr(systemErr);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.44</version>
<version>2.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>lee.study</groupId>
<artifactId>proxyee-down</artifactId>
<version>2.44</version>
<version>2.5</version>
<packaging>pom</packaging>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion sniff/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.44</version>
<version>2.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions sniff/src/main/resources/hookjs/bdyHook.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//1.7
//1.8
var initHookInterval = setInterval(function () {
if (!window.$) {
return;
Expand All @@ -18,7 +18,7 @@ var initHookInterval = setInterval(function () {
" ")[0];
$('.module-header-wrapper dl:first').find('dd:first').append(
'<span class="' + pd_parent_span_class + ' find-light">'
+ '<a href="https://github.com/monkeyWie/proxyee-down" target="_blank" title="百度云下载插件加载成功">proxyee-down</a>'
+ '<a href="javascript:alert(\'请在网盘中选择文件再点击下载按钮(此按钮非下载按钮,仅用于提示)\')">proxyee-down</a>'
+ '<span class="' + pd_child_span_class + '"></span>'
+ '<i class="find-light-icon"></i>'
+ '</span>');
Expand Down
2 changes: 1 addition & 1 deletion ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>proxyee-down</artifactId>
<groupId>lee.study</groupId>
<version>2.44</version>
<version>2.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private void afterTrayInit() {
);
int sniffProxyPort = ContentManager.CONFIG.get().getProxyPort();
if (OsUtil.isBusyPort(sniffProxyPort)) {
showMsg("端口(" + sniffProxyPort + ")被占用,请关闭占用端口的软件或设置新的端口号");
showMsg("端口(" + sniffProxyPort + ")被占用,请勿重复启动本软件!若无重复启动,请关闭占用端口的软件或设置新的端口号");
} else {
new Thread(() -> proxyServer.start(ContentManager.CONFIG.get().getProxyPort())).start();
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.version=2.44
app.version=2.5
spring.profiles.active=prd
view.server.port = 8999
tomcat.server.port = 26339
Expand Down
28 changes: 10 additions & 18 deletions ui/view/src/components/TaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
v-loading="initFlag"
style="height: 500px">
</div>
<div v-else-if="tasks.length>0"
v-loading="loadFlag">
<div v-else-if="tasks.length>0">
<el-row class="task-list-row task-list-row-title"
:gutter="20">
<el-col :span="2">
Expand Down Expand Up @@ -175,15 +174,9 @@
import NewTask from './NewTask'
import TaskProgress from './base/TaskProgress'
import {mapState, mapMutations} from 'vuex'
import ElCol from "element-ui/packages/col/src/col";
import ElRow from "element-ui/packages/row/src/row";
import ElCheckbox from "../../node_modules/element-ui/packages/checkbox/src/checkbox.vue";
export default {
components: {
ElCheckbox,
ElRow,
ElCol,
BuildTask,
NewTask,
TaskProgress,
Expand All @@ -194,7 +187,6 @@
checkTasks: [],
checkAll: false,
checkSome: false,
loadFlag: false,
}
},
computed: {
Expand Down Expand Up @@ -345,28 +337,28 @@
}
},
controlTask(task) {
this.loadFlag = true;
let load = this.$loading();
if (task.status == 5 || task.status == 6 || task.status == 9) {
this.$http.get('api/continueTask?id=' + task.id)
.then(() => {
this.loadFlag = false;
load.close();
}).catch(() => {
});
} else {
this.$http.get('api/pauseTask?id=' + task.id)
.then(() => {
this.loadFlag = false;
load.close();
}).catch(() => {
});
}
},
deleteTask(task) {
this.deleteConfirm(checked => {
this.loadFlag = true;
let load = this.$loading();
this.$http.get('api/deleteTask?id=' + task.id + "&delFile=" + checked)
.then(() => {
this.$store.commit("tasks/delTask", task.id);
this.loadFlag = false;
load.close();
}).catch(() => {
});
});
Expand Down Expand Up @@ -415,20 +407,20 @@
},
continueAllHandle() {
if (this.hasChecked()) {
this.loadFlag = true;
let load = this.$loading();
this.$http.post('api/continueAllTask', this.checkTasks)
.then(() => {
this.loadFlag = false;
load.close();
}).catch(() => {
});
}
},
pauseAllHandle() {
if (this.hasChecked()) {
this.loadFlag = true;
let load = this.$loading();
this.$http.post('api/pauseAllTask', this.checkTasks)
.then(() => {
this.loadFlag = false;
load.close();
}).catch(() => {
});
}
Expand Down
53 changes: 0 additions & 53 deletions ui/view/src/store/modules/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,60 +60,7 @@ export default {
state.tasks = state.tasks.sort((task1, task2) => {
return task2.startTime - task1.startTime;
});
/*state.tasks.forEach((task1) => {
let index = Util.inArray(tasks, task1, (arrObj, obj) => {
return arrObj.id == obj.id
});
if (index != -1) {
task1.chunkInfoList.forEach((chunk, index) => {
chunk.intervalTime = chunk.lastTime
- task2.chunkInfoList[index].lastTime;
chunk.intervalDownSize = chunk.downSize
- task2.chunkInfoList[index].downSize;
chunk.speedCount = task2.chunkInfoList[index].speedCount;
if (chunk.intervalDownSize == 0) {
if (!chunk.speedCount) {
chunk.speedCount = 1;
} else {
chunk.speedCount++;
}
} else {
chunk.speedCount = 1;
}
});
} else {
task1.push();
}
});*/
}
/*if (tasks) {
state.tasks = tasks.map(task1 => {
state.tasks.forEach(task2 => {
if (task2.id == task1.id) {
task1.chunkInfoList.forEach((chunk, index) => {
chunk.intervalTime = chunk.lastTime
- task2.chunkInfoList[index].lastTime;
chunk.intervalDownSize = chunk.downSize
- task2.chunkInfoList[index].downSize;
chunk.speedCount = task2.chunkInfoList[index].speedCount;
if (chunk.intervalDownSize == 0) {
if (!chunk.speedCount) {
chunk.speedCount = 1;
} else {
chunk.speedCount++;
}
} else {
chunk.speedCount = 1;
}
});
}
return false;
});
return task1;
}).sort((task1, task2) => {
return task2.startTime - task1.startTime;
});
}*/
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion update/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>lee.study</groupId>
<artifactId>proxyee-down-update</artifactId>
<packaging>jar</packaging>
<version>2.44</version>
<version>2.5</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 0551599

Please sign in to comment.