authorized fix keycloak sidebarItem

This commit is contained in:
2025-07-08 14:07:50 +07:00
parent 25f4b8cac7
commit 1b80be5fdd
48 changed files with 11684 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<script setup lang="ts">
definePageMeta({
middleware: ['auth'],
// auth:'super_admin'
})
import { ref } from "vue";
import { useAuth } from "#imports";
// const { setUserInfoStore } = useUserInfoStore();
// const { getUserInfoStore } = storeToRefs(useUserInfoStore());
const { data, status, getCsrfToken, getProviders, signOut, getSession } = useAuth()
const tokens = ref('')
// onMounted(async () => {
// // $fetch(`/api/auth/protected`).then(res => console.log('ini responnya',res))
// const headers = useRequestHeaders(['cookie']) as HeadersInit
// const { data: token } = await useFetch('/api/token', { headers })
// tokens.value = token.value
// // userAuthenticate(token.value)
// setUserInfoStore(token.value)
// })
</script>
<template>
<v-row>
<v-col cols="12" md="12">
<v-card elevation="10">
<v-card-item>
<!-- <pre><span>Providers:</span> {{ getUserInfoStore }}</pre> -->
<h5 class="text-h5 mb-3">Sample Page</h5>
<p class="text-body-1">This is a sample page</p>
<div class="mt-4">
<!-- <v-btn @click="getUserFromComposable" color="primary" variant="outlined" block>useComposables</v-btn> -->
<!-- <pre><span>Providers:</span> {{ tokens }}</pre> -->
</div>
</v-card-item>
</v-card>
</v-col>
</v-row>
</template>
+12
View File
@@ -0,0 +1,12 @@
<script setup lang="ts">
definePageMeta({
layout: "blank",
})
// definePageMeta({
// middleware: ['auth'],
// auth:'super_admin'
// })
</script>
<template>
<AuthUnauthorization/>
</template>
+71
View File
@@ -0,0 +1,71 @@
<script setup lang="ts">
import WelcomeCard from '~/components/dashboards/dashboard1/WelcomeCard.vue';
import CustomerCard from '~/components/dashboards/dashboard1/CustomerCard.vue';
import ProjectCard from '~/components/dashboards/dashboard1/ProjectCard.vue';
import RevenueForcast from '~/components/dashboards/dashboard1/RevenueForcast.vue';
import Performence from '~/components/dashboards/dashboard1/Performence.vue';
import CustomerChart from '~/components/dashboards/dashboard1/CustomerChart.vue';
import SalesOverview from '~/components/dashboards/dashboard1/SalesOverview.vue';
import RevenueProducts from '~/components/dashboards/dashboard1/RevenueProducts.vue';
import TotalSettelment from '~/components/dashboards/dashboard1/TotalSettelment.vue';
import SnackBar from '~/components/dashboards/snackbar.vue';
definePageMeta({
middleware: ['auth'],
// auth:'super_admin',
roles:['super_admin','admin'],
})
</script>
<template>
<!-- Loader -->
<SnackBar/>
<!-- Loader -->
<v-row>
<!-- Welcome Cards -->
<v-col cols="12" lg="5">
<v-row>
<v-col cols="12">
<WelcomeCard />
</v-col>
<v-col cols="12" md="6">
<CustomerCard />
</v-col>
<v-col cols="12" md="6">
<ProjectCard />
</v-col>
</v-row>
</v-col>
<!-- Revenue Forecast -->
<v-col cols="12" lg="7">
<RevenueForcast />
</v-col>
<!-- Your Performance -->
<v-col cols="12" lg="5">
<Performence />
</v-col>
<!-- Customers / Sales Overview -->
<v-col cols="12" lg="7">
<v-row>
<v-col cols="12" md="6">
<CustomerChart />
</v-col>
<v-col cols="12" md="6">
<SalesOverview />
</v-col>
</v-row>
</v-col>
<!-- Revenue by Product / Total settlements -->
<v-col cols="12" lg="8">
<RevenueProducts />
</v-col>
<v-col cols="12" lg="4">
<TotalSettelment/>
</v-col>
</v-row>
</template>
<style scoped lang="scss">
</style>
+11
View File
@@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped lang="scss">
</style>
+58
View File
@@ -0,0 +1,58 @@
<script setup lang="ts">
import CustomerChart from '~/components/dashboards/dashboard1/CustomerChart.vue';
import Performence from '@/components/dashboards/dashboard1/Performence.vue';
import RevenueProducts from '@/components/dashboards/dashboard1/RevenueProducts.vue';
import SalesOverview from '@/components/dashboards/dashboard1/SalesOverview.vue';
import TotalSettelment from '@/components/dashboards/dashboard1/TotalSettelment.vue';
import AnnualProfit from '@/components/dashboards/dashboard2/AnnualProfit.vue';
import RevenueCard from '@/components/dashboards/dashboard2/RevenueCard.vue';
import Calendarcard from '@/components/dashboards/dashboard3/Calendarcard.vue';
import IconCards from '@/components/dashboards/dashboard3/IconCards.vue';
definePageMeta({
middleware: ['auth'],
// auth:'super_admin',
roles:['admin'],
})
</script>
<template>
<v-row>
<v-col cols="12">
<IconCards/>
</v-col>
<!-- Revenue Forecast -->
<v-col cols="12" lg="8">
<RevenueCard />
</v-col>
<!-- Annual Profit -->
<v-col cols="12" lg="4">
<AnnualProfit />
</v-col>
<!-- Your Performance -->
<v-col cols="12" lg="5">
<Performence />
</v-col>
<!-- Customers / Sales Overview -->
<v-col cols="12" lg="7">
<v-row>
<v-col cols="12" md="6">
<CustomerChart />
</v-col>
<v-col cols="12" md="6">
<SalesOverview />
</v-col>
</v-row>
</v-col>
<!-- Revenue by Product / Total settlements -->
<v-col cols="12" lg="8">
<RevenueProducts />
</v-col>
<v-col cols="12" lg="4">
<TotalSettelment/>
</v-col>
<v-col cols="12" >
<Calendarcard/>
</v-col>
</v-row>
</template>