|
| 1 | +<!-- |
| 2 | + - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors |
| 3 | + - SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 | + --> |
| 5 | + |
| 6 | +<script setup lang="ts"> |
| 7 | +import axios from '@nextcloud/axios' |
| 8 | +import { t } from '@nextcloud/l10n' |
| 9 | +import { generateOcsUrl } from '@nextcloud/router' |
| 10 | +import { onBeforeMount, ref } from 'vue' |
| 11 | +import NcActionLink from '@nextcloud/vue/components/NcActionLink' |
| 12 | +import NcActions from '@nextcloud/vue/components/NcActions' |
| 13 | +import IconDotsGrid from 'vue-material-design-icons/DotsGrid.vue' |
| 14 | +import ThemeLogo from './ThemeLogo.vue' |
| 15 | +import { appData } from '../../../../app/AppData.js' |
| 16 | +
|
| 17 | +const apps = ref([]) |
| 18 | +const serverUrl = appData.serverUrl! as string |
| 19 | +const theming = appData.capabilities.theming |
| 20 | +
|
| 21 | +// TODO: add it to the Application Data |
| 22 | +// TODO: add types |
| 23 | +onBeforeMount(async () => { |
| 24 | + const response = await axios.get(generateOcsUrl('core/navigation/apps')) |
| 25 | + apps.value = response.data.ocs.data.filter(({ id }) => id !== 'spreed') |
| 26 | +}) |
| 27 | +</script> |
| 28 | + |
| 29 | +<template> |
| 30 | + <NcActions :aria-label="t('talk_desktop', 'Menu')" variant="tertiary-no-background" force-menu> |
| 31 | + <template #icon> |
| 32 | + <IconDotsGrid :size="20" /> |
| 33 | + </template> |
| 34 | + |
| 35 | + <NcActionLink :href="serverUrl"> |
| 36 | + <template #icon> |
| 37 | + <span class="action-icon-wrapper"> |
| 38 | + <ThemeLogo :size="20" /> |
| 39 | + </span> |
| 40 | + </template> |
| 41 | + {{ theming.name }} |
| 42 | + </NcActionLink> |
| 43 | + <NcActionLink v-for="app in apps" :key="app.id" :href="app.href"> |
| 44 | + <template #icon> |
| 45 | + <span class="action-icon-wrapper"> |
| 46 | + <img class="app-icon" :src="app.icon" alt=""> |
| 47 | + </span> |
| 48 | + </template> |
| 49 | + {{ app.name }} |
| 50 | + </NcActionLink> |
| 51 | + </NcActions> |
| 52 | +</template> |
| 53 | + |
| 54 | +<style scoped> |
| 55 | +.action-icon-wrapper { |
| 56 | + width: var(--default-clickable-area); |
| 57 | + height: var(--default-clickable-area); |
| 58 | + display: flex; |
| 59 | + align-items: center; |
| 60 | + justify-content: center; |
| 61 | +} |
| 62 | +
|
| 63 | +.app-icon { |
| 64 | + max-width: 20px; |
| 65 | + max-height: 20px; |
| 66 | + filter: var(--background-invert-if-bright); |
| 67 | +} |
| 68 | +</style> |
0 commit comments