WIP: add Daemon badge in app sidebar (2)

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
This commit is contained in:
Andrey Borysenko 2024-10-11 17:12:49 +03:00
parent 475ce2ead8
commit 151a75812c
No known key found for this signature in database
GPG key ID: 934CB29F9F59B0D1
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<!--
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<span v-if="daemon"
class="app-daemon-badge"
:title="daemon.name">
<NcIconSvgWrapper :path="mdiFileChart" :size="20" inline />
{{ daemon.display_name }}
</span>
</template>
<script setup lang="ts">
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import { mdiFileChart } from '@mdi/js'
import type { IDeployDaemon } from '../../app-types.ts'
const props = defineProps<{
daemon?: IDeployDaemon
}>()
</script>
<style scoped lang="scss">
.app-daemon-badge {
color: var(--color-text-maxcontrast);
background-color: transparent;
border: 1px solid var(--color-text-maxcontrast);
border-radius: var(--border-radius);
display: flex;
flex-direction: row;
gap: 6px;
padding: 3px 6px;
width: fit-content;
}
</style>

View file

@ -26,6 +26,7 @@
<!-- Featured/Supported badges -->
<div class="app-sidebar__badges">
<AppLevelBadge :level="app.level" />
<AppDaemonBadge v-if="app?.app_api && app?.daemon" :daemon="app.daemon" />
<AppScore v-if="hasRating" :score="rating" />
</div>
</template>
@ -52,6 +53,7 @@ import AppDetailsTab from '../components/AppStoreSidebar/AppDetailsTab.vue'
import AppReleasesTab from '../components/AppStoreSidebar/AppReleasesTab.vue'
import AppDeployDaemonTab from '../components/AppStoreSidebar/AppDeployDaemonTab.vue'
import AppLevelBadge from '../components/AppList/AppLevelBadge.vue'
import AppDaemonBadge from '../components/AppList/AppDaemonBadge.vue'
import { useAppIcon } from '../composables/useAppIcon.ts'
import { useStore } from '../store'