2020-11-10 00:33:55 +00:00
|
|
|
<template>
|
|
|
|
<q-page
|
|
|
|
padding
|
2021-03-18 16:23:57 +00:00
|
|
|
style="grid-auto-rows: 1fr"
|
2020-11-10 00:33:55 +00:00
|
|
|
class="fit row justify-around items-start q-col-gutter-sm"
|
|
|
|
>
|
2021-01-27 07:16:44 +00:00
|
|
|
<div v-for="(item, index) in widgets" :key="index" class="col-4 full-height col-sm-6 col-xs-12">
|
2021-03-19 16:36:34 +00:00
|
|
|
<component :is="item.widget" />
|
2020-11-10 00:33:55 +00:00
|
|
|
</div>
|
|
|
|
</q-page>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-03-19 16:36:34 +00:00
|
|
|
import { computed, defineComponent, inject } from 'vue';
|
2021-05-25 14:13:15 +00:00
|
|
|
import { hasPermissions } from '@flaschengeist/api';
|
|
|
|
import { FG_Plugin } from '@flaschengeist/types';
|
2021-03-19 16:36:34 +00:00
|
|
|
|
2020-11-10 00:33:55 +00:00
|
|
|
export default defineComponent({
|
|
|
|
name: 'Dashboard',
|
2021-01-30 05:19:43 +00:00
|
|
|
setup() {
|
2021-02-04 01:42:49 +00:00
|
|
|
const flaschengeist = inject<FG_Plugin.Flaschengeist>('flaschengeist');
|
2021-03-19 16:36:34 +00:00
|
|
|
const widgets = computed(() => {
|
|
|
|
return flaschengeist?.widgets.filter((widget) => hasPermissions(widget.permissions));
|
2020-11-10 00:33:55 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
2021-03-18 16:23:57 +00:00
|
|
|
widgets,
|
2020-11-10 00:33:55 +00:00
|
|
|
};
|
2021-03-18 16:23:57 +00:00
|
|
|
},
|
2020-11-10 00:33:55 +00:00
|
|
|
});
|
|
|
|
</script>
|