Triggering notifications for children of alert entities. Showing icons in alert entity search to distinguish networks and channels.
This commit is contained in:
@@ -13,15 +13,29 @@
|
||||
class="nolist"
|
||||
>
|
||||
<li
|
||||
v-for="actor in results"
|
||||
:key="`actor-${actor.id}`"
|
||||
v-for="result in results"
|
||||
:key="`result-${result.id}`"
|
||||
class="result"
|
||||
@click="selectResult(actor)"
|
||||
><img
|
||||
v-if="actor.avatar"
|
||||
:src="getPath(actor.avatar)"
|
||||
class="avatar"
|
||||
>{{ actor.name }}</li>
|
||||
@click="selectResult(result)"
|
||||
>
|
||||
<Icon
|
||||
v-if="result.type === 'network'"
|
||||
v-tooltip="'Network'"
|
||||
icon="device_hub"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-if="result.type === 'channel'"
|
||||
v-tooltip="'Channel'"
|
||||
icon="tv"
|
||||
/>
|
||||
|
||||
<img
|
||||
v-if="result.avatar"
|
||||
:src="getPath(result.avatar)"
|
||||
class="avatar"
|
||||
>{{ result.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
@@ -123,4 +137,9 @@ export default {
|
||||
height: 2rem;
|
||||
margin: 0 .5rem 0 0;
|
||||
}
|
||||
|
||||
.icon {
|
||||
fill: var(--shadow);
|
||||
margin: -.1rem .75rem 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
>Alert</AddAlert>
|
||||
|
||||
<div class="notifications-body">
|
||||
<span
|
||||
<div
|
||||
v-if="notifications.length === 0"
|
||||
class="notifications-empty"
|
||||
>No notifications</span>
|
||||
>No notifications</div>
|
||||
|
||||
<ul
|
||||
v-else
|
||||
@@ -55,18 +55,18 @@
|
||||
<div class="notification-row notification-title">
|
||||
<img
|
||||
v-if="notification.scene.entity.type === 'network' || notification.scene.entity.independent"
|
||||
:src="`/img/logos/${notification.scene.entity.slug}/favicon_dark.png`"
|
||||
:src="`/img/logos/${notification.scene.entity.slug}/favicon_${theme === 'dark' ? 'light' : 'dark'}.png`"
|
||||
class="notification-favicon"
|
||||
>
|
||||
|
||||
<img
|
||||
v-else
|
||||
:src="`/img/logos/${notification.scene.entity.parent.slug}/favicon_dark.png`"
|
||||
:src="`/img/logos/${notification.scene.entity.parent.slug}/favicon_${theme === 'dark' ? 'light' : 'dark'}.png`"
|
||||
class="notification-favicon"
|
||||
>
|
||||
|
||||
New <ul
|
||||
v-if="notification.alert.tags.length > 0"
|
||||
v-if="notification.alert?.tags.length > 0"
|
||||
class="nolist notification-tags"
|
||||
>
|
||||
<li
|
||||
@@ -180,12 +180,14 @@ export default {
|
||||
}
|
||||
|
||||
.notifications-empty {
|
||||
padding: 1rem;
|
||||
padding: .5rem 1rem;
|
||||
color: var(--shadow);
|
||||
}
|
||||
|
||||
.notification {
|
||||
display: block;
|
||||
margin: 0 0 -1px 0;
|
||||
color: var(--text);
|
||||
|
||||
&.unseen {
|
||||
border-right: solid .5rem var(--primary);
|
||||
|
||||
Reference in New Issue
Block a user