allow torrents to force start (button, api, locale)

This commit is contained in:
R-L-T-Y
2020-07-08 16:05:41 +08:00
committed by CzBiX
parent e51fa04ce6
commit ab8f6bcbc2
4 changed files with 22 additions and 2 deletions

View File

@@ -121,6 +121,10 @@ class Api {
return this.actionTorrents('resume', hashes);
}
public setForceStartTorrents(hashes: string[]) {
return this.actionTorrents('setForceStart', hashes, {value:'true'});
}
public reannounceTorrents(hashes: string[]) {
return this.actionTorrents('reannounce', hashes);
}

View File

@@ -33,6 +33,16 @@
>
<v-icon>mdi-pause</v-icon>
</v-btn>
<v-btn
icon
@click="forceStartTorrents"
:title="$t('force_start')"
:disabled="!hasSelected"
>
<v-icon>mdi-play-speed</v-icon>
</v-btn>
<v-divider
vertical
inset
@@ -466,6 +476,10 @@ export default class Torrents extends Vue {
await api.resumeTorrents(this.selectedHashes);
}
async forceStartTorrents() {
await api.setForceStartTorrents(this.selectedHashes);
}
async pauseTorrents() {
await api.pauseTorrents(this.selectedHashes);
}

View File

@@ -15,6 +15,7 @@ export default {
todo: 'To Do',
resume: 'Resume',
pause: 'Pause',
force_start: 'Force Start',
info: 'Info',
reset: 'Reset',
login: 'Login',
@@ -142,4 +143,4 @@ export default {
inactive: 'Inactive',
errored: 'Errored',
}
}
}

View File

@@ -15,6 +15,7 @@ export default {
todo: '待办',
resume: '恢复',
pause: '暂停',
force_start: '强制继续',
info: '信息',
reset: '重置',
login: '登录',
@@ -142,4 +143,4 @@ export default {
inactive: '空闲',
errored: '错误',
}
}
}