Use summary=true for lists & counters (#640)
Use the summary option added to some API resources in https://github.com/openhab/openhab-core/pull/1827 when displaying counters or lists that don't need the entire object. Signed-off-by: Yannick Schaus <github@schaus.net>pull/641/head
parent
91a9d05526
commit
e6d81d5a38
|
@ -360,9 +360,9 @@ export default {
|
|||
Promise.resolve(this.cachedObjects[3])
|
||||
] : [
|
||||
this.$oh.api.get('/rest/items'),
|
||||
this.$oh.api.get('/rest/things'),
|
||||
this.$oh.api.get('/rest/rules'),
|
||||
this.$oh.api.get('/rest/ui/components/ui:page')
|
||||
this.$oh.api.get('/rest/things?summary=true'),
|
||||
this.$oh.api.get('/rest/rules?summary=true'),
|
||||
Promise.resolve(this.$store.getters.pages)
|
||||
]
|
||||
|
||||
this.searchResultsLoading = true
|
||||
|
|
|
@ -156,7 +156,7 @@ export default {
|
|||
this.loading = true
|
||||
this.$set(this, 'selectedItems', [])
|
||||
this.showCheckboxes = false
|
||||
this.$oh.api.get('/rest/rules' + (this.showScripts ? '?tags=Script' : '')).then(data => {
|
||||
this.$oh.api.get('/rest/rules?summary=true' + (this.showScripts ? '&tags=Script' : '')).then(data => {
|
||||
this.rules = data.sort((a, b) => {
|
||||
return a.name.localeCompare(b.name)
|
||||
})
|
||||
|
|
|
@ -209,9 +209,9 @@ export default {
|
|||
loadCounters () {
|
||||
if (!this.apiEndpoints) return
|
||||
if (this.$store.getters.apiEndpoint('inbox')) this.$oh.api.get('/rest/inbox').then((data) => { this.inboxCount = data.filter((e) => e.flag === 'NEW').length.toString() })
|
||||
if (this.$store.getters.apiEndpoint('things')) this.$oh.api.get('/rest/things').then((data) => { this.thingsCount = data.length.toString() })
|
||||
if (this.$store.getters.apiEndpoint('things')) this.$oh.api.get('/rest/things?summary=true').then((data) => { this.thingsCount = data.length.toString() })
|
||||
if (this.$store.getters.apiEndpoint('items')) this.$oh.api.get('/rest/items').then((data) => { this.itemsCount = data.length.toString() })
|
||||
if (this.$store.getters.apiEndpoint('ui')) this.$oh.api.get('/rest/ui/components/system:sitemap').then((data) => { this.sitemapsCount = data.length })
|
||||
if (this.$store.getters.apiEndpoint('ui')) this.$oh.api.get('/rest/ui/components/system:sitemap?summary=true').then((data) => { this.sitemapsCount = data.length })
|
||||
},
|
||||
onPageInit () {
|
||||
this.loadMenu()
|
||||
|
|
|
@ -168,7 +168,7 @@ export default {
|
|||
},
|
||||
load () {
|
||||
this.loading = true
|
||||
this.$oh.api.get('/rest/things').then((data) => {
|
||||
this.$oh.api.get('/rest/things?summary=true').then((data) => {
|
||||
this.things = data.sort((a, b) => a.label.localeCompare(b.label))
|
||||
this.initSearchbar = true
|
||||
this.loading = false
|
||||
|
|
Loading…
Reference in New Issue