mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-14 12:10:18 +03:00
Feat : Url decode formula in rename modal (#244)
This commit is contained in:
parent
a9653d9b0d
commit
0c471a40d8
1 changed files with 21 additions and 0 deletions
|
@ -30,6 +30,14 @@
|
|||
</v-card-text>
|
||||
<v-divider />
|
||||
<v-card-actions class="justify-end">
|
||||
<v-btn
|
||||
v-if="enableUrlDecode"
|
||||
class="info white--text elevation-0 px-4"
|
||||
@click="urlDecode"
|
||||
>
|
||||
URL DECODE
|
||||
</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
class="accent white--text elevation-0 px-4"
|
||||
@click="rename"
|
||||
|
@ -76,8 +84,21 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.name = this.torrent.name
|
||||
this.isUrl()
|
||||
},
|
||||
methods: {
|
||||
urlDecode() {
|
||||
this.name = decodeURIComponent(this.name)
|
||||
this.isUrl()
|
||||
},
|
||||
isUrl() {
|
||||
this.enableUrlDecode = false
|
||||
if (this.name.indexOf(' ') == -1) {
|
||||
const exp = /\+|%/
|
||||
if (exp.test(this.name))
|
||||
this.enableUrlDecode = true
|
||||
}
|
||||
},
|
||||
rename() {
|
||||
qbit.setTorrentName(this.hash, this.name)
|
||||
this.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue