fe fixes profil
This commit is contained in:
@@ -8,7 +8,7 @@ import AppSidebar from './AppSidebar.vue';
|
|||||||
import AppTopbar from './AppTopbar.vue';
|
import AppTopbar from './AppTopbar.vue';
|
||||||
|
|
||||||
|
|
||||||
const { layoutConfig, layoutState, isSidebarActive, resetMenu } = useLayout();
|
const { hideMenu, layoutConfig, layoutState, isSidebarActive, resetMenu } = useLayout();
|
||||||
|
|
||||||
const outsideClickListener = ref(null);
|
const outsideClickListener = ref(null);
|
||||||
const page = ref("progetti");
|
const page = ref("progetti");
|
||||||
@@ -16,6 +16,7 @@ const userPrefStore = UserPrefStore();
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
userPrefStore.fetchUserData();
|
userPrefStore.fetchUserData();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,6 +29,12 @@ watch(isSidebarActive, (newVal) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(route, (newRoute) => {
|
||||||
|
if (newRoute.path === '/projects') {
|
||||||
|
hideMenu();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const containerClass = computed(() => {
|
const containerClass = computed(() => {
|
||||||
return {
|
return {
|
||||||
'layout-theme-light': !layoutConfig.darkTheme,
|
'layout-theme-light': !layoutConfig.darkTheme,
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ const userPrefStore = UserPrefStore();
|
|||||||
|
|
||||||
|
|
||||||
const model = ref([
|
const model = ref([
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
items: []
|
|
||||||
//items: [{ label: 'ATF-Notifier', icon: 'pi pi-fw pi-id-card', to: '/app-browser' }]
|
|
||||||
} ,
|
|
||||||
{
|
{
|
||||||
label: 'Scenarios',
|
label: 'Scenarios',
|
||||||
items: [
|
items: [
|
||||||
{ label: 'Available Scenarios', icon: 'pi pi-fw pi-id-card', to: '/' },
|
{ label: 'Available Scenarios', icon: 'pi pi-fw pi-id-card', to: '/' },
|
||||||
{ label: 'Executions List', icon: 'pi pi-fw pi-id-card', to: '/executions' }]
|
{ label: 'Executions List', icon: 'pi pi-fw pi-id-card', to: '/executions' },
|
||||||
}, {
|
] },
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
items: [] } ,
|
||||||
|
{
|
||||||
label: 'Canvas',
|
label: 'Canvas',
|
||||||
items: [{ label: 'New Canvas', icon: 'pi pi-fw pi-id-card', to: '/mdcanvas' }]
|
items: [{ label: 'New Canvas', icon: 'pi pi-fw pi-id-card', to: '/mdcanvas' }]
|
||||||
}
|
}
|
||||||
@@ -34,21 +34,21 @@ function updateApplicationsMenu() {
|
|||||||
|
|
||||||
if (selectedApp!=null) {
|
if (selectedApp!=null) {
|
||||||
// Se selectedApp non è nullo, aggiorna gli item
|
// Se selectedApp non è nullo, aggiorna gli item
|
||||||
model.value[0].label = selectedApp.fe_name;
|
model.value[1].label = selectedApp.fe_name;
|
||||||
|
|
||||||
// Aggiorna gli item dell'app selezionata
|
// Aggiorna gli item dell'app selezionata
|
||||||
model.value[0].items = [
|
model.value[1].items = [
|
||||||
{ label: 'Rev Eng Code', icon: 'pi pi-fw pi-id-card', to: '/app-browser' }
|
{ label: 'Rev Eng Code', icon: 'pi pi-fw pi-id-card', to: '/app-browser' }
|
||||||
];
|
];
|
||||||
|
|
||||||
selectedApp.available_scenarios.forEach(app => {
|
selectedApp.available_scenarios.forEach(app => {
|
||||||
model.value[0].items.push({ label: app.label, icon: 'pi pi-fw pi-id-card', to: `/scenario/exec/${app.scenario_id}` });
|
model.value[1].items.push({ label: app.label, icon: 'pi pi-fw pi-id-card', to: `/scenario/exec/${app.scenario_id}` });
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Se selectedApp è nullo, svuota gli item
|
// Se selectedApp è nullo, svuota gli item
|
||||||
model.value[0].label = '';
|
model.value[1].label = '';
|
||||||
model.value[0].items = [];
|
model.value[1].items = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +62,7 @@ watch(() => userPrefStore.getSelApp, updateApplicationsMenu, { immediate: true }
|
|||||||
<template v-for="(item, i) in model" :key="item">
|
<template v-for="(item, i) in model" :key="item">
|
||||||
<app-menu-item v-if="!item.separator" :item="item" :index="i"></app-menu-item>
|
<app-menu-item v-if="!item.separator" :item="item" :index="i"></app-menu-item>
|
||||||
<li v-if="item.separator" class="menu-separator"></li>
|
<li v-if="item.separator" class="menu-separator"></li>
|
||||||
|
<hr v-if="i === 0" class="menu-separator"/>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -82,13 +82,20 @@ const { onMenuToggle, toggleDarkMode, isDarkTheme } = useLayout();
|
|||||||
</button>
|
</button>
|
||||||
<AppConfigurator />
|
<AppConfigurator />
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1 v-if="userPrefStore.user.selectedProject">
|
||||||
|
{{ userPrefStore.user.selectedProject.fe_name }}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
v-model="userPrefStore.selectedApp"
|
v-model="userPrefStore.selectedApp"
|
||||||
:options="userPrefStore.availableApp"
|
:options="userPrefStore.availableApp"
|
||||||
optionLabel="fe_name"
|
optionLabel="fe_name"
|
||||||
placeholder="Select an Option"
|
placeholder="Select an Application"
|
||||||
class="dropdown-list"
|
class="dropdown-list"
|
||||||
@change="scenario_store.fetchApplicationScenarios()"
|
@change="scenario_store.fetchApplicationScenarios()"
|
||||||
:disabled="route.path === '/projects'"
|
:disabled="route.path === '/projects'"
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ export function useLayout() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hideMenu = () => {
|
||||||
|
console.log('hideMenu');
|
||||||
|
layoutState.staticMenuDesktopInactive = true;
|
||||||
|
};
|
||||||
|
|
||||||
const resetMenu = () => {
|
const resetMenu = () => {
|
||||||
layoutState.overlayMenuActive = false;
|
layoutState.overlayMenuActive = false;
|
||||||
layoutState.staticMenuMobileActive = false;
|
layoutState.staticMenuMobileActive = false;
|
||||||
@@ -74,5 +79,5 @@ export function useLayout() {
|
|||||||
|
|
||||||
const getPrimary = computed(() => layoutConfig.primary);
|
const getPrimary = computed(() => layoutConfig.primary);
|
||||||
|
|
||||||
return { layoutConfig: readonly(layoutConfig), layoutState: readonly(layoutState), onMenuToggle, isSidebarActive, isDarkTheme, getPrimary, setActiveMenuItem, toggleDarkMode, setPrimary, setSurface, setPreset, resetMenu };
|
return { layoutConfig: readonly(layoutConfig), layoutState: readonly(layoutState), onMenuToggle, isSidebarActive, isDarkTheme, getPrimary, setActiveMenuItem, toggleDarkMode, setPrimary, setSurface, setPreset, resetMenu, hideMenu };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const ScenarioStore = defineStore('scenario_store', () => {
|
|||||||
const applicationScenarios = ref([])
|
const applicationScenarios = ref([])
|
||||||
const filterString = ref('')
|
const filterString = ref('')
|
||||||
const allScenarios = ref([])
|
const allScenarios = ref([])
|
||||||
const typeFilter = ref('all')
|
const typeFilter = ref({ name: 'All', value: 'all' })
|
||||||
|
|
||||||
const userPrefStore = UserPrefStore()
|
const userPrefStore = UserPrefStore()
|
||||||
const loadingStore = LoadingStore()
|
const loadingStore = LoadingStore()
|
||||||
|
|||||||
Reference in New Issue
Block a user