diff options
Diffstat (limited to 'apps/dashboard/src/components/ApiDashboardWidget.vue')
-rw-r--r-- | apps/dashboard/src/components/ApiDashboardWidget.vue | 64 |
1 files changed, 20 insertions, 44 deletions
diff --git a/apps/dashboard/src/components/ApiDashboardWidget.vue b/apps/dashboard/src/components/ApiDashboardWidget.vue index daa97fc5428..4aa8628fac8 100644 --- a/apps/dashboard/src/components/ApiDashboardWidget.vue +++ b/apps/dashboard/src/components/ApiDashboardWidget.vue @@ -1,25 +1,7 @@ <!-- - - @copyright Copyright (c) 2023 Richard Steinmetz <richard@steinmetz.cloud> - - - - @author Richard Steinmetz <richard@steinmetz.cloud> - - - - @license AGPL-3.0-or-later - - - - This program is free software: you can redistribute it and/or modify - - it under the terms of the GNU General Public License as published by - - the Free Software Foundation, either version 3 of the License, or - - (at your option) any later version. - - - - This program is distributed in the hope that it will be useful, - - but WITHOUT ANY WARRANTY; without even the implied warranty of - - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - - GNU General Public License for more details. - - - - You should have received a copy of the GNU General Public License - - along with this program. If not, see <http://www.gnu.org/licenses/>. - - - --> - + - SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + - SPDX-License-Identifier: AGPL-3.0-or-later + --> <template> <NcDashboardWidget :items="items" :show-more-label="showMoreLabel" @@ -28,16 +10,7 @@ :show-items-and-empty-content="!!halfEmptyContentMessage" :half-empty-content-message="halfEmptyContentMessage"> <template #default="{ item }"> - <NcDashboardWidgetItem :target-url="item.link" - :overlay-icon-url="item.overlayIconUrl ? item.overlayIconUrl : ''" - :main-text="item.title" - :sub-text="item.subtitle"> - <template #avatar> - <template v-if="item.iconUrl"> - <NcAvatar :size="44" :url="item.iconUrl" /> - </template> - </template> - </NcDashboardWidgetItem> + <ApiDashboardWidgetItem :item="item" :icon-size="iconSize" :rounded-icons="widget.item_icons_round" /> </template> <template #empty-content> <NcEmptyContent v-if="items.length === 0" @@ -56,24 +29,20 @@ </template> <script> -import { - NcAvatar, - NcDashboardWidget, - NcDashboardWidgetItem, - NcEmptyContent, - NcButton, -} from '@nextcloud/vue' +import NcButton from '@nextcloud/vue/components/NcButton' +import NcDashboardWidget from '@nextcloud/vue/components/NcDashboardWidget' +import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent' import CheckIcon from 'vue-material-design-icons/Check.vue' +import ApiDashboardWidgetItem from './ApiDashboardWidgetItem.vue' export default { name: 'ApiDashboardWidget', components: { - NcAvatar, + ApiDashboardWidgetItem, + CheckIcon, NcDashboardWidget, - NcDashboardWidgetItem, NcEmptyContent, NcButton, - CheckIcon, }, props: { widget: { @@ -89,6 +58,11 @@ export default { required: true, }, }, + data() { + return { + iconSize: 44, + } + }, computed: { /** @return {object[]} */ items() { @@ -133,8 +107,10 @@ export default { return this.moreButton?.link }, }, + mounted() { + const size = window.getComputedStyle(document.body).getPropertyValue('--default-clickable-area') + const numeric = Number.parseFloat(size) + this.iconSize = Number.isNaN(numeric) ? 44 : numeric + }, } </script> - -<style lang="scss" scoped> -</style> |