setting tampilan belum fix

This commit is contained in:
2025-06-03 10:27:59 +07:00
29 changed files with 2635 additions and 83 deletions

View File

@@ -3,16 +3,18 @@ import { onMounted, ref, shallowRef, watch } from 'vue';
import { useDisplay } from "vuetify";
import sidebarItems from "@/components/layout/full/vertical-sidebar/sidebarItem";
import { Menu2Icon } from "vue-tabler-icons";
const props = defineProps({ items: { type: Object } })
const sidebarMenu = ref('');
const sidebarMenu = shallowRef(sidebarItems);
const { mdAndDown } = useDisplay();
const sDrawer = ref(true);
onMounted(() => {
sDrawer.value = !mdAndDown.value; // hide on mobile, show on desktop
});
watch(mdAndDown, (val) => {
sDrawer.value = !val;
watch([mdAndDown, () => props.items], ([mdVal, items]) => {
sDrawer.value = !mdVal;
sidebarMenu.value = items;
});
</script>

View File

@@ -1,5 +1,15 @@
<script setup lang="ts">
import { UserIcon, MailIcon, ListCheckIcon } from 'vue-tabler-icons';
const runtimeConfig = useRuntimeConfig();
const user_profile = useCookie('user_profile');
const user_token = useCookie('user_token');
const logout = async () => {
window.location.href = `${runtimeConfig.public.keycloakUrl}/realms/${runtimeConfig.public.keycloakRealm}/protocol/openid-connect/logout?client_id=${runtimeConfig.public.keycloakClient}&post_logout_redirect_uri=http://localhost:3000`;
user_token.value = null;
localStorage.removeItem('userProfile')
localStorage.removeItem('sidebarItems')
navigateTo('/auth/login')
}
</script>
<template>
@@ -16,27 +26,27 @@ import { UserIcon, MailIcon, ListCheckIcon } from 'vue-tabler-icons';
</template>
<v-sheet rounded="md" width="200" elevation="10" class="mt-2">
<v-list class="py-0" lines="one" density="compact">
<v-list-item value="item1" active-color="primary" >
<v-list-item value="item1" active-color="primary">
<template v-slot:prepend>
<UserIcon stroke-width="1.5" size="20"/>
<UserIcon stroke-width="1.5" size="20" />
</template>
<v-list-item-title class="pl-4 text-body-1">My Profile</v-list-item-title>
</v-list-item>
<v-list-item value="item2" active-color="primary">
<template v-slot:prepend>
<MailIcon stroke-width="1.5" size="20"/>
<MailIcon stroke-width="1.5" size="20" />
</template>
<v-list-item-title class="pl-4 text-body-1">My Account</v-list-item-title>
<v-list-item-title class="pl-4 text-body-1">My Account</v-list-item-title>
</v-list-item>
<v-list-item value="item3" active-color="primary">
<v-list-item value="item3" active-color="primary">
<template v-slot:prepend>
<ListCheckIcon stroke-width="1.5" size="20"/>
<ListCheckIcon stroke-width="1.5" size="20" />
</template>
<v-list-item-title class="pl-4 text-body-1">My Task</v-list-item-title>
</v-list-item>
</v-list>
<div class="pt-4 pb-4 px-5 text-center">
<v-btn to="/auth/login" color="primary" variant="outlined" block>Logout</v-btn>
<v-btn @click="logout" color="primary" variant="outlined" block>Logout</v-btn>
</div>
</v-sheet>
</v-menu>

View File

@@ -1,3 +1,5 @@
const { $decodeBase64 } = useNuxtApp();
export interface menu {
header?: string;
title?: string;
@@ -14,6 +16,7 @@ export interface menu {
type?: string;
subCaption?: string;
external?: boolean;
requiredGroups?: string[];
}
const sidebarItem: menu[] = [
@@ -44,16 +47,19 @@ const sidebarItem: menu[] = [
title: "Front Pages",
icon: "home-angle-linear",
to: "/front",
requiredGroups: ["/Bidang Pelayanan Medik"],
children: [
{
title: "Coba VueForm",
to: "/coba",
external: false,
requiredGroups: ["/Bidang Pelayanan Medik"]
},
{
title: "Coba VueForm2",
to: "/coba2",
external: false,
requiredGroups: ["/Bidang Diklit/Staff"]
},
{
title: "Homepage",
@@ -68,6 +74,8 @@ const sidebarItem: menu[] = [
title: "Typography",
icon: "text-circle-outline",
to: "/ui/typography",
requiredGroups: ['/Instalasi Bedah Sentral', '/Instalasi Rawat Jalan'],
},
{
title: "Shadow",
@@ -124,4 +132,7 @@ const sidebarItem: menu[] = [
},
];
export default sidebarItem;