A full-featured download manager.
refactor: improve max connection per server
Dr_rOota303afb9a5f9
diff --git a/src/main/core/ConfigManager.js b/src/main/core/ConfigManager.jsindex 6780dd15..855c5c4f 100644--- a/src/main/core/ConfigManager.js+++ b/src/main/core/ConfigManager.js@@ -65,7 +65,7 @@ export default class ConfigManager {'rpc-secret': EMPTY_STRING,'seed-ratio': 1,'seed-time': 60,- 'split': 16,+ 'split': 128,'user-agent': 'Transmission/2.94'}})diff --git a/src/renderer/components/Preference/Basic.vue b/src/renderer/components/Preference/Basic.vueindex 6d0f0292..4c37e6c8 100644--- a/src/renderer/components/Preference/Basic.vue+++ b/src/renderer/components/Preference/Basic.vue@@ -154,10 +154,10 @@<el-col class="form-item-sub" :span="24">{{ $t('preferences.max-connection-per-server') }}<el-input-number- v-model="form.split"+ v-model="form.maxConnectionPerServer"controls-position="right":min="1"- :max="form.maxConnectionPerServer"+ :max="form.engineMaxConnectionPerServer":label="$t('preferences.max-connection-per-server')"></el-input-number></el-col>@@ -214,39 +214,39 @@const initialForm = (config) => {const {+ autoHideWindow,dir,+ engineMaxConnectionPerServer,hideAppMenu,keepWindowState,locale,maxConcurrentDownloads,maxConnectionPerServer,- maxOverallUploadLimit,maxOverallDownloadLimit,+ maxOverallUploadLimit,newTaskShowDownloading,openAtLogin,- autoHideWindow,resumeAllWhenAppLaunched,runMode,- split,taskNotification,theme} = configconst result = {+ autoHideWindow,continue: config.continue,dir,+ engineMaxConnectionPerServer,hideAppMenu,keepWindowState,locale,maxConcurrentDownloads,maxConnectionPerServer,- maxOverallUploadLimit,maxOverallDownloadLimit,+ maxOverallUploadLimit,newTaskShowDownloading,openAtLogin,- autoHideWindow,resumeAllWhenAppLaunched,runMode,- split,taskNotification,theme}diff --git a/src/renderer/components/Task/AddTask.vue b/src/renderer/components/Task/AddTask.vueindex 629c4b21..c97619f2 100644--- a/src/renderer/components/Task/AddTask.vue+++ b/src/renderer/components/Task/AddTask.vue@@ -18,7 +18,6 @@:autosize="{ minRows: 3, maxRows: 5 }"auto-complete="off":placeholder="$t('task.uri-task-tips')"- @change="handleUriChange"@paste.native="handleUriPaste"v-model="form.uris">@@ -50,12 +49,10 @@:label-width="formLabelWidth"><el-input-number- v-model="form.split"- @change="handleSplitChange"+ v-model="form.maxConnectionPerServer"controls-position="right":min="1"- :max="config.maxConnectionPerServer"- :value="config.split"+ :max="config.engineMaxConnectionPerServer":label="$t('task.task-split')"></el-input-number>@@ -183,19 +180,26 @@ import '@/components/Icons/inbox'const initialForm = state => {const { addTaskUrl, addTaskOptions } = state.app- const { allProxy, dir, split, newTaskShowDownloading } = state.preference.config+ const {+ allProxy,+ dir,+ engineMaxConnectionPerServer,+ maxConnectionPerServer,+ newTaskShowDownloading+ } = state.preference.configconst result = {allProxy,- uris: addTaskUrl,- torrent: '',- selectFile: NONE_SELECTED_FILES,- out: '',- userAgent: '',- referer: '',cookie: '',dir,- split,+ engineMaxConnectionPerServer,+ maxConnectionPerServer,newTaskShowDownloading,+ out: '',+ referer: '',+ selectFile: NONE_SELECTED_FILES,+ torrent: '',+ uris: addTaskUrl,+ userAgent: '',...addTaskOptions}return result@@ -302,16 +306,10 @@ export default {})}},- handleUriChange () {- console.log('handleUriChange===>', this.form.uris)- },handleTorrentChange (torrent, selectedFileIndex) {this.form.torrent = torrentthis.form.selectFile = selectedFileIndex},- handleSplitChange (value) {- console.log('handleSplitChange===>', value)- },onDirectorySelected (dir) {this.form.dir = dir},@@ -338,7 +336,7 @@ export default {return result},buildOption (type, form) {- const { allProxy, dir, out, selectFile, split } = form+ const { allProxy, dir, out, selectFile } = formconst result = {}if (!isEmpty(allProxy)) {@@ -362,10 +360,6 @@ export default {}}- if (split > 0) {- result.split = split- }-const header = this.buildHeader(form)if (!isEmpty(header)) {result.header = headerdiff --git a/src/shared/configKeys.js b/src/shared/configKeys.jsindex c92e7fe0..0297ee48 100644--- a/src/shared/configKeys.js+++ b/src/shared/configKeys.js@@ -1,9 +1,12 @@const userKeys = ['all-proxy-backup','auto-check-update',+ 'auto-hide-window','auto-sync-tracker','cookie','enable-egg-features',+ 'engine-bin-path',+ 'engine-max-connection-per-server','hide-app-menu','keep-window-state','last-check-update-time',@@ -12,7 +15,6 @@ const userKeys = ['log-path','new-task-show-downloading','open-at-login',- 'auto-hide-window','protocols','resume-all-when-app-launched','run-mode',