Feat : Url decode formula in rename modal (#244)

This commit is contained in:
m4ximuel 2021-04-25 14:16:07 +09:00 committed by GitHub
parent a9653d9b0d
commit 0c471a40d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()