Skip to content

Commit

Permalink
Fix create task config bug
Browse files Browse the repository at this point in the history
update version to 3.01
  • Loading branch information
monkeyWie committed Sep 7, 2018
1 parent b878ea5 commit f5f60fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
29 changes: 14 additions & 15 deletions front/src/components/Task/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
<script>
import FileChoose from '../FileChoose'
let defaultConfig = {}
export default {
props: {
request: {
Expand Down Expand Up @@ -102,7 +100,7 @@ export default {
request() {
this.form.request = this.request
this.form.response = this.response
this.form.config = { ...defaultConfig }
this.setDefaultConfig()
}
},
computed: {
Expand Down Expand Up @@ -155,9 +153,7 @@ export default {
this.form.taskId = undefined
if (visible) {
//check same task
const { data: serverConfig } = await this.$http.get('http://127.0.0.1:26339/config')
const { data: downTasks } = await this.$http.get('http://127.0.0.1:26339/tasks?status=1,2,3')
this.setDefaultConfig(serverConfig)
this.sameTasks = downTasks
? downTasks.filter(task => task.response.supportRange && task.response.totalSize === this.response.totalSize)
: []
Expand Down Expand Up @@ -195,19 +191,22 @@ export default {
this.selectOldTask = true
}
},
setDefaultConfig(serverConfig) {
const defaultConfig = {
filePath: serverConfig.filePath,
connections: serverConfig.connections,
timeout: serverConfig.timeout,
retryCount: serverConfig.retryCount,
autoRename: serverConfig.autoRename,
speedLimit: serverConfig.speedLimit
}
this.form.config = { ...defaultConfig }
setDefaultConfig() {
this.$http.get('http://127.0.0.1:26339/config').then(result => {
const serverConfig = result.data
this.form.config = {
filePath: serverConfig.filePath,
connections: serverConfig.connections,
timeout: serverConfig.timeout,
retryCount: serverConfig.retryCount,
autoRename: serverConfig.autoRename,
speedLimit: serverConfig.speedLimit
}
})
}
},
created() {
this.setDefaultConfig()
this.init(this.visible)
}
}
Expand Down
4 changes: 2 additions & 2 deletions main/src/main/java/org/pdown/gui/DownApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void start(Stage primaryStage) throws Exception {
initTray();
initWindow();
initBrowser();
loadUri("", true);
loadUri(null, true);
}


Expand Down Expand Up @@ -307,7 +307,7 @@ public void loadUri(String uri, boolean isTray) {
} else {
Platform.runLater(() -> {
show(isTray);
if (!browser.isLoad()) {
if (uri != null || !browser.isLoad()) {
browser.load(url);
}
});
Expand Down
2 changes: 1 addition & 1 deletion main/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 3.0
version: 3.01
spring:
profiles:
active: @environment@
Expand Down

0 comments on commit f5f60fa

Please sign in to comment.