Skip to content

Commit 48f187c

Browse files
authored
Things list: Add dynamic blue dot to status badges if status detail is set (#4069)
Resolves #4063 This allows a dynamic information badge ("blue dot") to be applied to Thing in the list page in order to mark when the Thing has a special status. For example "low battery" or "firmware update available". --------- Also-by: Florian Hotze <dev@florianhotze.com> Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
1 parent b84ffb9 commit 48f187c

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,15 @@
174174
</div>
175175
</template>
176176
<template #after>
177-
<f7-badge :color="thingStatusBadgeColor(thing.statusInfo)" :tooltip="thing.statusInfo.description">
178-
{{ thingStatusBadgeText(thing.statusInfo) }}
179-
</f7-badge>
177+
<div class="badge-with-marker">
178+
<f7-badge :color="thingStatusBadgeColor(thing.statusInfo)" :tooltip="thing.statusInfo.description || null">
179+
{{ thingStatusBadgeText(thing.statusInfo) }}
180+
</f7-badge>
181+
<span
182+
v-if="thing.statusInfo.status === 'ONLINE' && thing.statusInfo.description && thing.statusInfo.description !== ''"
183+
class="badge-marker-dot">
184+
</span>
185+
</div>
180186
</template>
181187
<template #after-title>
182188
<f7-icon v-if="!thing.editable" f7="lock_fill" size="1rem" color="gray" />
@@ -215,6 +221,19 @@
215221
<style lang="stylus">
216222
.things-list
217223
margin-bottom calc(var(--f7-fab-size) + 2 * calc(var(--f7-fab-margin) + var(--f7-safe-area-bottom)))
224+
.badge-with-marker
225+
position relative
226+
display inline-block
227+
.badge-marker-dot
228+
position absolute
229+
top -4px
230+
right -4px
231+
width 10px
232+
height 10px
233+
background-color var(--f7-color-blue)
234+
border 1px solid var(--f7-list-bg-color)
235+
border-radius 50%
236+
pointer-events none
218237
</style>
219238

220239
<script>

0 commit comments

Comments
 (0)