perf: add refresh icon to RSS feeds (#709)

This commit is contained in:
Rémi Marseault 2023-03-15 15:14:58 +01:00 committed by GitHub
parent 97f77050f0
commit a583b42d68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

View file

@ -8,12 +8,17 @@
<v-list-item-content>
<v-list-item-title v-text="item.name" />
</v-list-item-content>
<v-list-item-action>
<v-list-item-action class="icon">
<v-icon @click="updateFeed(item)">
{{ mdiSync }}
</v-icon>
</v-list-item-action>
<v-list-item-action class="icon">
<v-icon @click="editFeed(item)">
{{ mdiPencil }}
</v-icon>
</v-list-item-action>
<v-list-item-action>
<v-list-item-action class="icon">
<v-icon color="red" @click="deleteFeed(item)">
{{ mdiDelete }}
</v-icon>
@ -34,7 +39,7 @@
<script lang="ts">
import { mapGetters } from 'vuex'
import qbit from '@/services/qbit'
import { mdiDelete, mdiPencil } from '@mdi/js'
import { mdiDelete, mdiPencil, mdiSync } from '@mdi/js'
import { Tab, General, FullScreenModal } from '@/mixins'
import { Feed } from '@/types/vuetorrent'
@ -45,7 +50,8 @@ export default defineComponent({
mixins: [Tab, General, FullScreenModal],
data: () => ({
mdiPencil,
mdiDelete
mdiDelete,
mdiSync
}),
computed: {
...mapGetters(['getFeeds']),
@ -60,6 +66,9 @@ export default defineComponent({
activeMethod() {
this.$store.commit('FETCH_FEEDS')
},
async updateFeed(item: Feed) {
await qbit.refreshFeed(item.name)
},
editFeed(item: Feed) {
this.createModal('FeedForm', { initialFeed: { url: item.url, name: item.name } })
},
@ -73,3 +82,9 @@ export default defineComponent({
}
})
</script>
<style scoped>
.icon {
margin-left: 16px;
}
</style>

View file

@ -210,6 +210,12 @@ export class QBitApi {
})
}
async refreshFeed(itemPath: string) {
await this.execute('rss/refreshItem', {
itemPath
})
}
// Post
async addTorrents(params: AddTorrentPayload, torrents: File[]): Promise<void> {