diff options
Diffstat (limited to 'apps/settings/src/views/AppStoreSidebar.vue')
-rw-r--r-- | apps/settings/src/views/AppStoreSidebar.vue | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/apps/settings/src/views/AppStoreSidebar.vue b/apps/settings/src/views/AppStoreSidebar.vue index 0e76d360afd..b4041066c67 100644 --- a/apps/settings/src/views/AppStoreSidebar.vue +++ b/apps/settings/src/views/AppStoreSidebar.vue @@ -1,25 +1,7 @@ <!-- - - @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net> - - - - @author Julius Härtl <jus@bitgrid.net> - - @author Ferdinand Thiessen <opensource@fthiessen.de> - - - - @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 Affero 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 Affero General Public License for more details. - - - - You should have received a copy of the GNU Affero General Public License - - along with this program. If not, see <http://www.gnu.org/licenses/>. - - - --> + - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors + - SPDX-License-Identifier: AGPL-3.0-or-later +--> <template> <!-- Selected app details --> <NcAppSidebar v-if="showSidebar" @@ -44,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 +35,7 @@ <AppDescriptionTab :app="app" /> <AppDetailsTab :app="app" /> <AppReleasesTab :app="app" /> + <AppDeployDaemonTab :app="app" /> </NcAppSidebar> </template> @@ -61,21 +45,36 @@ import { computed, onMounted, ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router/composables' import { useAppsStore } from '../store/apps-store' -import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js' -import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' +import NcAppSidebar from '@nextcloud/vue/components/NcAppSidebar' +import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper' import AppScore from '../components/AppList/AppScore.vue' import AppDescriptionTab from '../components/AppStoreSidebar/AppDescriptionTab.vue' 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' +import { useAppApiStore } from '../store/app-api-store.ts' const route = useRoute() const router = useRouter() const store = useAppsStore() +const appApiStore = useAppApiStore() +const legacyStore = useStore() const appId = computed(() => route.params.id ?? '') -const app = computed(() => store.getAppById(appId.value)!) +const app = computed(() => { + if (legacyStore.getters.isAppApiEnabled) { + const exApp = appApiStore.getAllApps + .find((app) => app.id === appId.value) ?? null + if (exApp) { + return exApp + } + } + return store.getAppById(appId.value)! +}) const hasRating = computed(() => app.value.appstoreData?.ratingNumOverall > 5) const rating = computed(() => app.value.appstoreData?.ratingNumRecent > 5 ? app.value.appstoreData.ratingRecent @@ -87,7 +86,15 @@ const { appIcon } = useAppIcon(app) /** * The second text line shown on the sidebar */ -const licenseText = computed(() => app.value ? t('settings', 'Version {version}, {license}-licensed', { version: app.value.version, license: app.value.licence.toString().toUpperCase() }) : '') +const licenseText = computed(() => { + if (!app.value) { + return '' + } + if (app.value.license !== '') { + return t('settings', 'Version {version}, {license}-licensed', { version: app.value.version, license: app.value.licence.toString().toUpperCase() }) + } + return t('settings', 'Version {version}', { version: app.value.version }) +}) const activeTab = ref('details') watch([app], () => { activeTab.value = 'details' }) |