1
0
Fork 0
mirror of https://github.com/VueTorrent/VueTorrent.git synced 2025-05-10 09:14:09 +03:00
This commit is contained in:
Daan Wijns 2021-01-29 11:42:20 +01:00 committed by GitHub
parent c4329ce2b9
commit 2e334ca909
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 507 additions and 185 deletions

View file

@ -8,7 +8,7 @@
<v-card style="overflow: hidden !important">
<v-container :style="{ height: phoneLayout ? '100vh' : '' }">
<v-card-title class="pb-0 justify-center">
<h2>Change Torrent Location</h2>
<h2>Change Location</h2>
</v-card-title>
<v-card-text>
<div>
@ -18,13 +18,13 @@
<v-text-field
v-model="torrent.name"
label="Torrent Name"
prepend-icon="insert_drive_file"
:prepend-icon="mdiFile"
readonly
/>
<v-text-field
v-model="newPath"
label="Directory"
prepend-icon="folder"
:prepend-icon="mdiFolder"
@keydown.enter="setLocation"
/>
</v-col>
@ -49,7 +49,7 @@
right
@click="close"
>
<v-icon>close</v-icon>
<v-icon>{{ mdiClose }}</v-icon>
</v-btn>
</v-fab-transition>
</v-card>
@ -58,9 +58,10 @@
<script>
import { mapGetters } from 'vuex'
import { mdiFile, mdiFolder, mdiClose } from '@mdi/js'
import { Modal, FullScreenModal } from '@/mixins'
import qbit from '@/services/qbit'
export default {
name: 'ChangeLocationModal',
mixins: [Modal, FullScreenModal],
@ -69,7 +70,8 @@ export default {
},
data() {
return {
newPath: ''
newPath: '',
mdiFile, mdiFolder, mdiClose
}
},
computed: {

View file

@ -12,7 +12,10 @@
:key="t.hash"
>
<v-list-item-content>
<v-list-item-title class="truncate" v-text="t.name" />
<v-list-item-title
class="text-wrap"
v-text="t.name"
/>
</v-list-item-content>
</v-list-item>
</v-list>
@ -20,21 +23,21 @@
<v-card-actions class="justify-center pb-5">
<v-btn
text
class="error white--text mt-3"
class="accent white--text mt-3"
@click="close()"
>
Cancel
</v-btn>
<v-btn
text
class="accent white--text mt-3"
class="error white--text mt-3"
@click="deleteWithoutFiles()"
>
Delete
</v-btn>
<v-btn
text
class="accent white--text mt-3"
class="error white--text mt-3"
@click="deleteWithFiles()"
>
Delete with files

View file

@ -8,7 +8,7 @@
<v-card style="overflow: hidden !important">
<v-container :style="{ height: phoneLayout ? '100vh' : '' }">
<v-card-title class="pb-0 justify-center">
<h2>Rename Torrent</h2>
<h2>Rename</h2>
</v-card-title>
<v-card-text>
<div>
@ -18,7 +18,7 @@
<v-text-field
v-model="name"
label="Torrent Name"
prepend-icon="insert_drive_file"
:prepend-icon="mdiFile"
/>
</v-col>
</v-row>
@ -42,7 +42,7 @@
right
@click="close"
>
<v-icon>close</v-icon>
<v-icon>{{ mdiClose }}</v-icon>
</v-btn>
</v-fab-transition>
</v-card>
@ -51,6 +51,7 @@
<script>
import { mapGetters } from 'vuex'
import { mdiFile, mdiClose } from '@mdi/js'
import { Modal, FullScreenModal } from '@/mixins'
import qbit from '@/services/qbit'
export default {
@ -61,7 +62,8 @@ export default {
},
data() {
return {
name: ''
name: '',
mdiFile, mdiClose
}
},
computed: {

View file

@ -0,0 +1,112 @@
<template>
<v-dialog
v-model="dialog"
scrollable
max-width="500px"
:fullscreen="phoneLayout"
>
<v-card style="overflow: hidden !important">
<v-container :style="{ height: phoneLayout ? '100vh' : '' }">
<v-card-title class="pb-0 justify-center">
<h2 class="text-capitalize">
Limit {{ mode }}
</h2>
</v-card-title>
<v-card-text>
<div>
<v-container>
<v-row>
<v-col>
<v-text-field
v-model="limit"
label="Speed Limit"
:prepend-icon="mdiSpeedometer"
suffix="KB/s"
clearable
/>
</v-col>
</v-row>
</v-container>
</div>
</v-card-text>
<div>
<v-card-actions class="justify-center">
<v-btn color="success" @click="setLimit">
Save
</v-btn>
</v-card-actions>
</div>
</v-container>
<v-fab-transition v-if="phoneLayout">
<v-btn
color="red"
dark
absolute
bottom
right
@click="close"
>
<v-icon>{{ mdiClose }}</v-icon>
</v-btn>
</v-fab-transition>
</v-card>
</v-dialog>
</template>
<script>
import { mapGetters } from 'vuex'
import { mdiSpeedometer, mdiClose } from '@mdi/js'
import { Modal, FullScreenModal } from '@/mixins'
import qbit from '@/services/qbit'
export default {
name: 'SpeedLimitModal',
mixins: [Modal, FullScreenModal],
props: {
mode: String,
hash: String
},
data() {
return {
limit: '',
mdiSpeedometer, mdiClose
}
},
computed: {
...mapGetters(['getTorrent']),
torrent() {
return this.getTorrent(this.hash)
}
},
created() {
switch (this.mode) {
case 'download':
this.limit = this.torrent.dl_limit / 1024
break
case 'upload':
this.limit = this.torrent.up_limit / 1024
break
default:
break
}
},
methods: {
setLimit() {
switch (this.mode) {
case 'download':
qbit.setDownloadLimit([this.hash], this.limit * 1024 ?? -1)
break
case 'upload':
qbit.setUploadLimit([this.hash], this.limit * 1024 ?? -1)
break
default:
break
}
this.close()
},
close() {
this.$store.commit('DELETE_MODAL', this.guid)
}
}
}
</script>

View file

@ -170,6 +170,30 @@
{{ torrent.auto_tmm }}
</td>
</tr>
<tr>
<td class="grey--text">
Share Limit
</td>
<td>
{{ torrent.ratio_limit }}
</td>
</tr>
<tr>
<td class="grey--text">
Download Limit
</td>
<td>
{{ torrent.dl_limit | getDataValue }} {{ torrent.dl_limit | getDataUnit }}/s
</td>
</tr>
<tr>
<td class="grey--text">
Upload Limit
</td>
<td>
{{ torrent.up_limit | getDataValue }} {{ torrent.up_limit | getDataUnit }}/s
</td>
</tr>
</tbody>
</v-simple-table>
</v-card-text>