Support for individual entity group refresh

This commit is contained in:
Fabio Manganiello 2022-04-19 23:56:49 +02:00
parent e6bfa1c50f
commit 7d4bd20df0
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 16 additions and 4 deletions

View File

@ -33,7 +33,11 @@
<div class="title" v-text="group.name" v-else-if="selector.grouping === 'plugin'"/>
</span>
<span class="section right" />
<span class="section right">
<button title="Refresh" @click="refresh(group)">
<i class="fa fa-sync-alt" />
</button>
</span>
</div>
<div class="body">
@ -142,8 +146,16 @@ export default {
}, {})
},
async refresh() {
this.loadingEntities = Object.entries(this.entities).reduce((obj, [id, entity]) => {
async refresh(group) {
const entities = group ? group.entities : this.entities
const args = {}
if (group)
args.plugins = Object.keys(entities.reduce((obj, entity) => {
obj[entity.plugin] = true
return obj
}, {}))
this.loadingEntities = Object.entries(entities).reduce((obj, [id, entity]) => {
const self = this
if (this.entityTimeouts[id])
clearTimeout(this.entityTimeouts[id])
@ -166,7 +178,7 @@ export default {
return obj
}, {})
await this.request('entities.scan')
await this.request('entities.scan', args)
},
async sync() {