mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-14 12:10:18 +03:00
perf: Register magnet handler (#784)
This commit is contained in:
parent
d1ffa2b143
commit
82310c843d
3 changed files with 35 additions and 1 deletions
|
@ -220,6 +220,18 @@
|
|||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-row dense>
|
||||
<v-col cols="7" sm="7" md="10">
|
||||
<p class="subtitle-1">
|
||||
{{ $t('modals.settings.pageVueTorrent.pageGeneral.registerMagnetHeader') }}
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col cols="4" sm="4" md="2">
|
||||
<v-btn @click="registerMagnetHandler">{{ $t('modals.settings.pageVueTorrent.pageGeneral.registerMagnetButton') }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-textarea v-model="settingsField" />
|
||||
</v-list-item>
|
||||
|
@ -296,6 +308,15 @@ export default {
|
|||
resetSettings() {
|
||||
window.localStorage.clear()
|
||||
location.reload()
|
||||
},
|
||||
registerMagnetHandler() {
|
||||
if (typeof navigator.registerProtocolHandler !== 'function') {
|
||||
this.$toast.error(this.$t("toast.magnetHandlerNotSupported").toString());
|
||||
return;
|
||||
}
|
||||
|
||||
const templateUrl = location.href.replace('/settings', '/download=%s')
|
||||
navigator.registerProtocolHandler('magnet', templateUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,6 +237,8 @@
|
|||
"showShutdownButton": "Show shutdown button",
|
||||
"currentVersion": "Current Version:",
|
||||
"qbittorrentVersion": "QBittorrent Version:",
|
||||
"registerMagnetHeader": "Register to handle magnet links...",
|
||||
"registerMagnetButton": "Register",
|
||||
"importSettings": "Import Settings",
|
||||
"exportSettings": "Export Settings",
|
||||
"resetSettings": "Reset Settings"
|
||||
|
@ -556,7 +558,8 @@
|
|||
"pasteNotSupported": "Unable to paste, context isn't secured",
|
||||
"shutdownSuccess": "qBittorrent was shutdown successfully!",
|
||||
"shutdownError": "Unable to shutdown app. Make sure qBittorrent is running!",
|
||||
"invalidJson": "Invalid JSON! Check console for details"
|
||||
"invalidJson": "Invalid JSON! Check console for details",
|
||||
"magnetHandlerNotSupported": "Unable to register handler, context isn't secured!"
|
||||
},
|
||||
"rightClick": {
|
||||
"resume": "resume",
|
||||
|
|
|
@ -133,6 +133,16 @@ exports[`General > render correctly 1`] = `
|
|||
</a></v-col-stub>
|
||||
</v-row-stub>
|
||||
</v-list-item-stub>
|
||||
<v-list-item-stub data-v-7da6d3e2=\\"\\" activeclass=\\"\\" tag=\\"div\\">
|
||||
<v-row-stub data-v-7da6d3e2=\\"\\" tag=\\"div\\" dense=\\"true\\">
|
||||
<v-col-stub data-v-7da6d3e2=\\"\\" cols=\\"7\\" sm=\\"7\\" md=\\"10\\" tag=\\"div\\">
|
||||
<p data-v-7da6d3e2=\\"\\" class=\\"subtitle-1\\"> </p>
|
||||
</v-col-stub>
|
||||
<v-col-stub data-v-7da6d3e2=\\"\\" cols=\\"4\\" sm=\\"4\\" md=\\"2\\" tag=\\"div\\">
|
||||
<v-btn-stub data-v-7da6d3e2=\\"\\" tag=\\"button\\" activeclass=\\"\\" type=\\"button\\"></v-btn-stub>
|
||||
</v-col-stub>
|
||||
</v-row-stub>
|
||||
</v-list-item-stub>
|
||||
<v-list-item-stub data-v-7da6d3e2=\\"\\" activeclass=\\"\\" tag=\\"div\\">
|
||||
<v-textarea-stub data-v-7da6d3e2=\\"\\" errorcount=\\"1\\" errormessages=\\"\\" messages=\\"\\" rules=\\"\\" successmessages=\\"\\" value=\\"\\" backgroundcolor=\\"\\" loaderheight=\\"2\\" clearicon=\\"$clear\\" type=\\"text\\" rowheight=\\"24\\" rows=\\"5\\"></v-textarea-stub>
|
||||
</v-list-item-stub>
|
||||
|
|
Loading…
Add table
Reference in a new issue