mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 20:21:10 -04:00
v6 update
This commit is contained in:
28
resources/scripts/admin/views/dashboard/Dashboard.vue
Normal file
28
resources/scripts/admin/views/dashboard/Dashboard.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<script setup>
|
||||
import DashboardStats from '../dashboard/DashboardStats.vue'
|
||||
import DashboardChart from '../dashboard/DashboardChart.vue'
|
||||
import DashboardTable from '../dashboard/DashboardTable.vue'
|
||||
import { useUserStore } from '@/scripts/admin/stores/user'
|
||||
import { onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
const router = useRouter()
|
||||
|
||||
onMounted(() => {
|
||||
if (route.meta.ability && !userStore.hasAbilities(route.meta.ability)) {
|
||||
router.push({ name: 'account.settings' })
|
||||
} else if (route.meta.isOwner && !userStore.currentUser.is_owner) {
|
||||
router.push({ name: 'account.settings' })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasePage>
|
||||
<DashboardStats />
|
||||
<DashboardChart />
|
||||
<DashboardTable />
|
||||
</BasePage>
|
||||
</template>
|
||||
Reference in New Issue
Block a user