system menu improvements
This commit is contained in:
@@ -12,17 +12,44 @@ const integrationStore = useIntegrationStore();
|
||||
|
||||
// Get all entries based on current menu mode
|
||||
const menuEntries = computed(() => {
|
||||
const pointType = layoutStore.menuMode === 'settings' ? 'admin_settings_menu' : 'app_menu';
|
||||
return integrationStore.getPoint(pointType);
|
||||
switch (layoutStore.menuMode) {
|
||||
case 'user-settings':
|
||||
return integrationStore.getPoint('user_settings_menu');
|
||||
case 'admin-settings':
|
||||
return integrationStore.getPoint('admin_settings_menu');
|
||||
case 'apps':
|
||||
default:
|
||||
return integrationStore.getPoint('app_menu');
|
||||
}
|
||||
});
|
||||
|
||||
// Menu mode display info
|
||||
const menuModeInfo = computed(() => ({
|
||||
icon: layoutStore.menuMode === 'settings' ? 'mdi-cog' : 'mdi-view-dashboard',
|
||||
label: layoutStore.menuMode === 'settings' ? 'Settings' : 'Applications',
|
||||
toggleLabel: layoutStore.menuMode === 'settings' ? 'Switch to Apps' : 'Switch to Settings',
|
||||
toggleIcon: layoutStore.menuMode === 'settings' ? 'mdi-view-dashboard' : 'mdi-cog',
|
||||
}));
|
||||
const menuModeInfo = computed(() => {
|
||||
switch (layoutStore.menuMode) {
|
||||
case 'user-settings':
|
||||
return {
|
||||
icon: 'mdi-account-cog',
|
||||
label: 'Personal Settings',
|
||||
toggleLabel: 'Admin',
|
||||
toggleIcon: 'mdi-shield-crown',
|
||||
};
|
||||
case 'admin-settings':
|
||||
return {
|
||||
icon: 'mdi-shield-crown',
|
||||
label: 'Administration',
|
||||
toggleLabel: 'Apps',
|
||||
toggleIcon: 'mdi-view-dashboard',
|
||||
};
|
||||
case 'apps':
|
||||
default:
|
||||
return {
|
||||
icon: 'mdi-view-dashboard',
|
||||
label: 'Applications',
|
||||
toggleLabel: 'Settings',
|
||||
toggleIcon: 'mdi-account-cog',
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
||||
import config from '@KTXC/config';
|
||||
import { useUserStore } from './userStore';
|
||||
|
||||
export type MenuMode = 'apps' | 'settings';
|
||||
export type MenuMode = 'apps' | 'user-settings' | 'admin-settings';
|
||||
|
||||
export const useLayoutStore = defineStore('layout', () => {
|
||||
// Loading state
|
||||
@@ -58,7 +58,11 @@ export const useLayoutStore = defineStore('layout', () => {
|
||||
}
|
||||
|
||||
function toggleMenuMode() {
|
||||
menuMode.value = menuMode.value === 'apps' ? 'settings' : 'apps';
|
||||
// Cycle through: apps -> user-settings -> admin-settings -> apps
|
||||
const modes: MenuMode[] = ['apps', 'user-settings', 'admin-settings'];
|
||||
const currentIndex = modes.indexOf(menuMode.value);
|
||||
const nextIndex = (currentIndex + 1) % modes.length;
|
||||
menuMode.value = modes[nextIndex];
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user