mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-05-04 06:14:57 +03:00
0.4.1 (#53)
This commit is contained in:
parent
ae6a2048eb
commit
dde4c08f2b
19 changed files with 454 additions and 377 deletions
src/components/Modals
|
@ -11,7 +11,6 @@
|
|||
<v-row no-gutters>
|
||||
<v-col ref="fileZone">
|
||||
<v-file-input
|
||||
v-if="!url"
|
||||
v-model="files"
|
||||
color="deep-purple accent-4"
|
||||
counter
|
||||
|
@ -44,8 +43,7 @@
|
|||
>
|
||||
</template>
|
||||
</v-file-input>
|
||||
<v-text-field
|
||||
v-if="files.length == 0"
|
||||
<v-textarea
|
||||
label="URL"
|
||||
prepend-icon="mdi-link"
|
||||
:rows="
|
||||
|
@ -53,7 +51,10 @@
|
|||
"
|
||||
required
|
||||
:autofocus="!phoneLayout"
|
||||
v-model="url"
|
||||
v-model="urls"
|
||||
auto-grow
|
||||
clearable
|
||||
hint="One link per line"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
@ -130,17 +131,17 @@ export default {
|
|||
'Not a valid magnet link'
|
||||
],
|
||||
loading: false,
|
||||
url: null,
|
||||
urls: null,
|
||||
valid: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
if (this.files.length || this.url) {
|
||||
if (this.files.length || this.urls) {
|
||||
let torrents = []
|
||||
let params = { urls: null, autoTMM: this.autoTMM }
|
||||
if (this.files.length) torrents.push(...this.files)
|
||||
if (this.url) params.urls = this.url
|
||||
if (this.urls) params.urls = this.urls
|
||||
if (this.category) params.category = this.category
|
||||
if (!this.autoTMM) params.savepath = this.directory
|
||||
if (this.skip_checking) params.skip_checking = this.skip_checking
|
||||
|
|
71
src/components/Modals/ConfirmDeleteModal.vue
Normal file
71
src/components/Modals/ConfirmDeleteModal.vue
Normal file
|
@ -0,0 +1,71 @@
|
|||
<template>
|
||||
<v-dialog v-model="dialog" scrollable max-width="500px">
|
||||
<v-card>
|
||||
<v-container :class="`pa-0 project done`">
|
||||
<v-card-title class="justify-center">
|
||||
<h2>Confirm Removal</h2>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-list flat>
|
||||
<v-list-item
|
||||
v-for="t in torrents"
|
||||
:key="t.hash"
|
||||
>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="truncate" v-text="t.name"></v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card-text>
|
||||
<v-card-actions class="justify-center pb-5">
|
||||
<v-btn text class="error white--text mt-3"
|
||||
@click="close()"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
text
|
||||
class="green_accent white--text mt-3"
|
||||
@click="deleteWithoutFiles()"
|
||||
>Delete</v-btn
|
||||
>
|
||||
<v-btn
|
||||
text
|
||||
class="green_accent white--text mt-3"
|
||||
@click="deleteWithFiles()"
|
||||
>Delete with files</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import { Modal } from '@/mixins'
|
||||
import qbit from '@/services/qbit'
|
||||
export default {
|
||||
name: 'ConfirmDeleteModal',
|
||||
mixins: [Modal],
|
||||
methods: {
|
||||
close() {
|
||||
this.$store.commit('DELETE_MODAL', this.guid)
|
||||
},
|
||||
deleteWithoutFiles() {
|
||||
qbit.deleteTorrents(this.selected_torrents, false)
|
||||
this.close()
|
||||
},
|
||||
deleteWithFiles() {
|
||||
qbit.deleteTorrents(this.selected_torrents, true)
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['selected_torrents']),
|
||||
...mapGetters(['getTorrents']),
|
||||
torrents(){
|
||||
return this.getTorrents().filter(t => this.selected_torrents.includes(t.hash))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
80
src/components/Modals/RenameModal.vue
Normal file
80
src/components/Modals/RenameModal.vue
Normal file
|
@ -0,0 +1,80 @@
|
|||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
scrollable
|
||||
:width="dialogWidth"
|
||||
:fullscreen="phoneLayout"
|
||||
>
|
||||
<v-card style="overflow: hidden !important">
|
||||
<v-container :style="{ height: phoneLayout ? '100vh' : '' }">
|
||||
<v-card-title class="pb-0 justify-center">
|
||||
<h2>Rename Torrent</h2>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<div>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
label="Torrent Name"
|
||||
prepend-icon="insert_drive_file"
|
||||
v-model="name"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<div>
|
||||
<v-card-actions class="justify-center">
|
||||
<v-btn color="success" @click="rename">Save</v-btn>
|
||||
</v-card-actions>
|
||||
</div>
|
||||
</v-container>
|
||||
<v-fab-transition v-if="phoneLayout">
|
||||
<v-btn @click="close" color="red" dark absolute bottom right>
|
||||
<v-icon>close</v-icon>
|
||||
</v-btn>
|
||||
</v-fab-transition>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { Modal, FullScreenModal } from '@/mixins'
|
||||
import qbit from '@/services/qbit'
|
||||
export default {
|
||||
name: 'RenameModal',
|
||||
mixins: [Modal, FullScreenModal],
|
||||
props: {
|
||||
hash: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['getTorrent']),
|
||||
dialogWidth() {
|
||||
return this.phoneLayout ? '100%' : '750px'
|
||||
},
|
||||
torrent() {
|
||||
return this.getTorrent(this.hash)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rename() {
|
||||
qbit.setTorrentName(this.hash, this.name)
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.$store.commit('DELETE_MODAL', this.guid)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.name = this.torrent.name
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -46,10 +46,10 @@ export default {
|
|||
mixins: [Modal],
|
||||
data() {
|
||||
return {
|
||||
sortProperty: { value: 'added_on', name: 'Default' },
|
||||
sortProperty: { value: 'added_on', name: 'Added On' },
|
||||
reverse: true,
|
||||
options: [
|
||||
{ value: 'added_on', name: 'Default' },
|
||||
{ value: 'added_on', name: 'Added On' },
|
||||
{ value: 'availability', name: 'Availability' },
|
||||
{ value: 'category', name: 'Category' },
|
||||
{ value: 'completed', name: 'Completed' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue