2023-07-19 18:42:05 +02:00
|
|
|
<script setup lang="ts">
|
2023-09-07 18:13:09 +02:00
|
|
|
definePageMeta({
|
|
|
|
public: true,
|
|
|
|
})
|
|
|
|
|
2023-07-25 23:11:32 +02:00
|
|
|
const { t } = useI18n()
|
2023-11-23 17:07:54 +01:00
|
|
|
const isLoggedIn = await useIsLoggedIn()
|
|
|
|
const settings = await useSettings()
|
2023-09-04 16:45:16 +02:00
|
|
|
const appsData = await useApps()
|
2023-07-19 18:42:05 +02:00
|
|
|
|
2023-09-07 18:13:09 +02:00
|
|
|
useHead({
|
2023-11-11 15:07:40 +01:00
|
|
|
title: t('app_list'),
|
2023-09-04 16:49:13 +02:00
|
|
|
})
|
|
|
|
|
2023-11-23 16:01:49 +01:00
|
|
|
const intro = computed(() => {
|
|
|
|
const {
|
|
|
|
portal_user_intro: userIntro,
|
|
|
|
portal_public_intro: publicIntro,
|
|
|
|
public: isPublic,
|
|
|
|
} = settings.value
|
|
|
|
return isLoggedIn.value ? userIntro : isPublic ? publicIntro : null
|
|
|
|
})
|
|
|
|
|
2023-09-04 16:45:16 +02:00
|
|
|
const apps = computed(() => {
|
2023-11-14 18:33:23 +01:00
|
|
|
const appTileVariant = [
|
|
|
|
'btn-primary',
|
|
|
|
'btn-secondary',
|
|
|
|
'btn-accent',
|
|
|
|
'btn-neutral',
|
|
|
|
'btn-info',
|
|
|
|
'btn-success',
|
|
|
|
'btn-warning',
|
|
|
|
'btn-error',
|
|
|
|
// FIXME currently using daisyui btn colors to get focus/hover styles,
|
|
|
|
// if we want more colors we need to add btn variants based on daisyui colors.
|
|
|
|
// 'bg-red-500'
|
|
|
|
// 'bg-orange-500'
|
|
|
|
// 'bg-yellow-500'
|
|
|
|
// 'bg-lime-500'
|
|
|
|
// 'bg-green-500'
|
|
|
|
// 'bg-teal-500'
|
|
|
|
// 'bg-indigo-500'
|
|
|
|
// 'bg-primary',
|
|
|
|
// 'bg-purple-500'
|
|
|
|
// 'bg-rose-500'
|
2023-07-20 17:36:08 +02:00
|
|
|
]
|
2023-08-06 16:27:24 +02:00
|
|
|
|
2023-09-04 16:45:16 +02:00
|
|
|
return Object.entries(appsData.value).map(([id, app]) => {
|
|
|
|
return {
|
|
|
|
...app,
|
|
|
|
id,
|
|
|
|
url: '//' + app.url,
|
2023-11-14 18:33:23 +01:00
|
|
|
variant: appTileVariant[parseInt(app.label, 36) % appTileVariant.length],
|
2023-09-04 16:45:16 +02:00
|
|
|
}
|
|
|
|
})
|
2023-07-20 17:36:08 +02:00
|
|
|
})
|
2023-07-19 18:42:05 +02:00
|
|
|
</script>
|
2023-07-12 04:52:58 +02:00
|
|
|
|
2023-07-19 18:42:05 +02:00
|
|
|
<template>
|
2023-08-06 16:27:24 +02:00
|
|
|
<div>
|
2023-11-14 18:33:23 +01:00
|
|
|
<PageTitle :text="$t('app_list')" sr-only />
|
2023-08-06 16:27:24 +02:00
|
|
|
|
2023-11-23 16:01:49 +01:00
|
|
|
<CustomText v-if="intro" :content="intro" />
|
|
|
|
|
|
|
|
<section id="apps" class="my-10">
|
2023-09-04 16:45:16 +02:00
|
|
|
<div v-if="!apps.length" class="w-2/3">
|
2023-07-26 01:25:42 +02:00
|
|
|
<em>{{ t('no_apps') }}</em>
|
2023-07-19 18:42:05 +02:00
|
|
|
</div>
|
|
|
|
|
2023-07-26 01:25:42 +02:00
|
|
|
<ul v-else class="tile-container">
|
2023-11-14 18:33:23 +01:00
|
|
|
<li v-for="app in apps" :key="app.id" class="tile relative">
|
2023-11-22 16:18:34 +01:00
|
|
|
<a :href="app.url" class="btn" :class="app.variant">
|
|
|
|
<span class="text-6xl font-extrabold" aria-hidden="true">
|
2023-07-19 18:42:05 +02:00
|
|
|
{{ app.label.substring(0, 2) }}
|
2023-11-22 16:18:34 +01:00
|
|
|
</span>
|
|
|
|
<span class="leading-tight">{{ app.label }}</span>
|
2023-07-19 18:42:05 +02:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2023-11-23 16:01:49 +01:00
|
|
|
</section>
|
2023-07-19 18:42:05 +02:00
|
|
|
</div>
|
2023-07-12 04:52:58 +02:00
|
|
|
</template>
|
2023-07-26 01:25:42 +02:00
|
|
|
|
2023-11-23 16:01:49 +01:00
|
|
|
<style scoped>
|
2023-07-26 01:25:42 +02:00
|
|
|
.tile-container {
|
|
|
|
display: grid;
|
2023-11-22 16:18:34 +01:00
|
|
|
grid-template-columns: repeat(auto-fit, 9rem);
|
|
|
|
grid-auto-rows: 9rem;
|
2023-07-26 01:25:42 +02:00
|
|
|
grid-gap: 1.5rem;
|
|
|
|
}
|
|
|
|
|
2023-11-14 18:33:23 +01:00
|
|
|
.tile a {
|
2023-11-22 16:18:34 +01:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2023-11-14 18:33:23 +01:00
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
2023-11-22 16:18:34 +01:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
gap: 0;
|
2023-07-26 01:25:42 +02:00
|
|
|
}
|
|
|
|
|
2023-11-14 18:33:23 +01:00
|
|
|
.tile:hover a,
|
|
|
|
.tile a:focus {
|
|
|
|
transform: scale(1.05);
|
2023-07-26 01:25:42 +02:00
|
|
|
}
|
|
|
|
</style>
|