Merge branch 'master' of https://gitlab.gcp.windtre.it/olympus_ai/hermione-fe
This commit is contained in:
@@ -8,7 +8,7 @@ import AppSidebar from './AppSidebar.vue';
|
||||
import AppTopbar from './AppTopbar.vue';
|
||||
|
||||
|
||||
const { layoutConfig, layoutState, isSidebarActive, resetMenu } = useLayout();
|
||||
const { hideMenu, layoutConfig, layoutState, isSidebarActive, resetMenu } = useLayout();
|
||||
|
||||
const outsideClickListener = ref(null);
|
||||
const page = ref("progetti");
|
||||
@@ -16,6 +16,7 @@ const userPrefStore = UserPrefStore();
|
||||
const route = useRoute();
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
userPrefStore.fetchUserData();
|
||||
});
|
||||
|
||||
@@ -28,6 +29,12 @@ watch(isSidebarActive, (newVal) => {
|
||||
}
|
||||
});
|
||||
|
||||
watch(route, (newRoute) => {
|
||||
if (newRoute.path === '/projects') {
|
||||
hideMenu();
|
||||
}
|
||||
});
|
||||
|
||||
const containerClass = computed(() => {
|
||||
return {
|
||||
'layout-theme-light': !layoutConfig.darkTheme,
|
||||
|
||||
@@ -8,17 +8,17 @@ const userPrefStore = UserPrefStore();
|
||||
|
||||
|
||||
const model = ref([
|
||||
{
|
||||
label: '',
|
||||
items: []
|
||||
//items: [{ label: 'ATF-Notifier', icon: 'pi pi-fw pi-id-card', to: '/app-browser' }]
|
||||
} ,
|
||||
|
||||
{
|
||||
label: 'Scenarios',
|
||||
items: [
|
||||
{ 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',
|
||||
items: [{ label: 'New Canvas', icon: 'pi pi-fw pi-id-card', to: '/mdcanvas' }]
|
||||
}
|
||||
@@ -32,24 +32,24 @@ function updateApplicationsMenu() {
|
||||
|
||||
if (selectedApp!=null) {
|
||||
// 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
|
||||
model.value[0].items = [
|
||||
model.value[1].items = [
|
||||
{ label: 'Rev Eng Code', icon: 'pi pi-fw pi-id-card', to: '/app-browser' }
|
||||
];
|
||||
|
||||
if( selectedApp.available_scenarios.length > 0) {
|
||||
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 {
|
||||
// Se selectedApp è nullo, svuota gli item
|
||||
model.value[0].label = '';
|
||||
model.value[0].items = [];
|
||||
model.value[1].label = '';
|
||||
model.value[1].items = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ watch(() => userPrefStore.getSelApp, updateApplicationsMenu, { immediate: true }
|
||||
<template v-for="(item, i) in model" :key="item">
|
||||
<app-menu-item v-if="!item.separator" :item="item" :index="i"></app-menu-item>
|
||||
<li v-if="item.separator" class="menu-separator"></li>
|
||||
<hr v-if="i === 0" class="menu-separator"/>
|
||||
</template>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
@@ -97,13 +97,20 @@ watch(() => userPrefStore.getSelApp, appUpdated, { immediate: true });
|
||||
</button>
|
||||
<AppConfigurator />
|
||||
</div>
|
||||
<div>
|
||||
<h1 v-if="userPrefStore.user.selectedProject">
|
||||
{{ userPrefStore.user.selectedProject.fe_name }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<Dropdown
|
||||
v-model="selectedApp"
|
||||
:options="userPrefStore.availableApp"
|
||||
optionLabel="fe_name"
|
||||
placeholder="Select an Option"
|
||||
placeholder="Select an Application"
|
||||
class="dropdown-list"
|
||||
@change="updateApplication()"
|
||||
:disabled="route.path === '/projects'"
|
||||
|
||||
@@ -62,6 +62,11 @@ export function useLayout() {
|
||||
}
|
||||
};
|
||||
|
||||
const hideMenu = () => {
|
||||
console.log('hideMenu');
|
||||
layoutState.staticMenuDesktopInactive = true;
|
||||
};
|
||||
|
||||
const resetMenu = () => {
|
||||
layoutState.overlayMenuActive = false;
|
||||
layoutState.staticMenuMobileActive = false;
|
||||
@@ -74,5 +79,5 @@ export function useLayout() {
|
||||
|
||||
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 filterString = ref('')
|
||||
const allScenarios = ref([])
|
||||
const typeFilter = ref('all')
|
||||
const typeFilter = ref({ name: 'All', value: 'all' })
|
||||
|
||||
const userPrefStore = UserPrefStore()
|
||||
const loadingStore = LoadingStore()
|
||||
|
||||
Reference in New Issue
Block a user