Skip to content

Commit

Permalink
Add missing settings-menu entry
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Jun 29, 2024
1 parent f886cd0 commit 264c110
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
<f7-col :class="!addonsLoaded || (addonsLoaded && addonsInstalled.length > 0) ? 'settings-col' : ''" width="100" medium="50">
<f7-block-title>Configuration</f7-block-title>
<f7-list media-list class="search-list">
<f7-list-item
v-if="$store.getters.apiEndpoint('links')"
media-item
link="health/"
title="Health check"
:badge="(healthCount > 0) ? healthCount : undefined"
:after="(healthCount > 0) ? undefined : 0"
badge-color="red"
:footer="objectsSubtitles.health">
<f7-icon slot="media" f7="heart" color="gray" />
</f7-list-item>
<f7-list-item
v-if="$store.getters.apiEndpoint('things')"
media-item
Expand Down Expand Up @@ -219,6 +230,7 @@ export default {
scripts: 'Rules dedicated to running code',
schedule: 'View upcoming time-based rules'
},
healthCount: '',
inboxCount: '',
thingsCount: '',
itemsCount: '',
Expand Down Expand Up @@ -292,6 +304,7 @@ export default {
},
loadCounters () {
if (!this.apiEndpoints) return
if (this.$store.getters.apiEndpoint('links')) this.$oh.api.get('/rest/links/orphans').then((data) => { this.healthCount = data.length.toString() })
if (this.$store.getters.apiEndpoint('inbox')) this.$oh.api.get('/rest/inbox?includeIgnored=false').then((data) => { this.inboxCount = data.filter((e) => e.flag === 'NEW').length.toString() })
if (this.$store.getters.apiEndpoint('things')) this.$oh.api.get('/rest/things?staticDataOnly=true').then((data) => { this.thingsCount = data.length.toString() })
if (this.$store.getters.apiEndpoint('items')) this.$oh.api.get('/rest/items?staticDataOnly=true').then((data) => { this.itemsCount = data.length.toString() })
Expand Down

0 comments on commit 264c110

Please sign in to comment.