mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-29 05:28:53 +03:00
feat: show created by info #279
This commit is contained in:
parent
a18bded9cb
commit
7a7562e54e
2 changed files with 22 additions and 2 deletions
|
@ -134,6 +134,14 @@
|
|||
{{ torrent.tracker }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="createdBy">
|
||||
<td :class="commonStyle">
|
||||
Created By
|
||||
</td>
|
||||
<td>
|
||||
{{ createdBy }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="torrent.comment">
|
||||
<td :class="commonStyle">
|
||||
Comments
|
||||
|
@ -213,6 +221,8 @@
|
|||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { FullScreenModal } from '@/mixins'
|
||||
import qbit from '@/services/qbit'
|
||||
|
||||
export default {
|
||||
name: 'Info',
|
||||
mixins: [FullScreenModal],
|
||||
|
@ -221,7 +231,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
commonStyle: 'caption'
|
||||
commonStyle: 'caption',
|
||||
createdBy: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -229,6 +240,15 @@ export default {
|
|||
torrent() {
|
||||
return this.getTorrent(this.hash)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTorrentProperties()
|
||||
},
|
||||
methods: {
|
||||
async getTorrentProperties() {
|
||||
const props = await qbit.getTorrentProperties(this.hash)
|
||||
this.createdBy = props.created_by || null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -145,7 +145,7 @@ class Qbit {
|
|||
getTorrentProperties(hash) {
|
||||
return this.axios.get('/torrents/properties', {
|
||||
params: { hash }
|
||||
})
|
||||
}).then(res => res.data)
|
||||
}
|
||||
|
||||
// Post
|
||||
|
|
Loading…
Reference in a new issue