mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-29 21:11:51 +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 }}
|
{{ torrent.tracker }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-if="createdBy">
|
||||||
|
<td :class="commonStyle">
|
||||||
|
Created By
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ createdBy }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr v-if="torrent.comment">
|
<tr v-if="torrent.comment">
|
||||||
<td :class="commonStyle">
|
<td :class="commonStyle">
|
||||||
Comments
|
Comments
|
||||||
|
@ -213,6 +221,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { FullScreenModal } from '@/mixins'
|
import { FullScreenModal } from '@/mixins'
|
||||||
|
import qbit from '@/services/qbit'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Info',
|
name: 'Info',
|
||||||
mixins: [FullScreenModal],
|
mixins: [FullScreenModal],
|
||||||
|
@ -221,7 +231,8 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
commonStyle: 'caption'
|
commonStyle: 'caption',
|
||||||
|
createdBy: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -229,6 +240,15 @@ export default {
|
||||||
torrent() {
|
torrent() {
|
||||||
return this.getTorrent(this.hash)
|
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>
|
</script>
|
||||||
|
|
|
@ -145,7 +145,7 @@ class Qbit {
|
||||||
getTorrentProperties(hash) {
|
getTorrentProperties(hash) {
|
||||||
return this.axios.get('/torrents/properties', {
|
return this.axios.get('/torrents/properties', {
|
||||||
params: { hash }
|
params: { hash }
|
||||||
})
|
}).then(res => res.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post
|
// Post
|
||||||
|
|
Loading…
Add table
Reference in a new issue