Added entity results to global search.

This commit is contained in:
2024-12-29 23:56:41 +01:00
parent 684c269f87
commit 0565ad062b
3 changed files with 71 additions and 2 deletions

View File

@@ -5,12 +5,20 @@
>
<img
v-if="entity.hasLogo"
:src="entity.type === 'network' || entity.isIndependent ? `/logos/${entity.slug}/thumbs/network.png` : `/logos/${entity.parent?.slug}/thumbs/${entity.slug}.png`"
:src="entity.type === 'network' || entity.isIndependent || !entity.parent
? `/logos/${entity.slug}/thumbs/network.png`
: `/logos/${entity.parent.slug}/thumbs/${entity.slug}.png`"
:alt="entity.name"
loading="lazy"
class="logo"
>
<span v-else>{{ entity.name }}</span>
<Icon
v-if="showNetworkSymbol && entity.type === 'network'"
icon="device_hub"
/>
</a>
</template>
@@ -20,6 +28,10 @@ defineProps({
type: Object,
default: null,
},
showNetworkSymbol: {
type: Boolean,
default: true,
},
});
</script>
@@ -33,11 +45,22 @@ defineProps({
box-sizing: border-box;
padding: 1rem;
border-radius: .5rem;
position: relative;
background: var(--shadow-strong-30);
color: var(--text-light);
font-size: 1.25rem;
font-weight: bold;
.icon {
position: absolute;
top: -.25rem;
right: -.25rem;
padding: .4rem .55rem .25rem .25rem;
border-radius: .25rem;
background: var(--highlight-weak-30);
fill: var(--text-light);
}
&:hover {
box-shadow: 0 0 3px var(--shadow);
}