chat for admin
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
import { UserPrefStore } from '../stores/UserPrefStore.js';
|
||||
@@ -25,10 +25,19 @@ const model = ref([
|
||||
{
|
||||
label: 'Canvas',
|
||||
items: [{ label: 'New Canvas', icon: 'pi pi-fw pi-pencil', to: '/mdcanvas' }]
|
||||
}
|
||||
}
|
||||
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
if(userPrefStore.user.role == 'ADMIN'){
|
||||
model.value.push({
|
||||
label: 'Chat',
|
||||
items: [{ label: 'Chat', icon: 'pi pi-fw pi-comments', to: '/chat' }]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Funzione per aggiornare la sezione "Your Applications" in base a selectedApp
|
||||
function updateApplicationsMenu() {
|
||||
const selectedApp = userPrefStore.getSelApp;
|
||||
@@ -95,28 +104,10 @@ function updateApplicationsMenu() {
|
||||
model.value[1].label = '';
|
||||
model.value[1].items = [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Funzione per creare un item scenario con Execution List
|
||||
/*function createScenarioItem(app) {
|
||||
return {
|
||||
label: app.label,
|
||||
icon: 'pi pi-fw pi-wrench',
|
||||
items: [
|
||||
{
|
||||
label: 'Execution List',
|
||||
icon: 'pi pi-fw pi-list',
|
||||
to: '/executions/filter',
|
||||
command: () => {
|
||||
userPrefStore.setSelectedScenario(app.label);
|
||||
}
|
||||
}
|
||||
],
|
||||
command: () => {
|
||||
route.push({ path: `/scenario/exec/${app.scenario_id}` });
|
||||
}
|
||||
};
|
||||
}*/
|
||||
|
||||
function createScenarioItem(app) {
|
||||
|
||||
@@ -148,6 +139,8 @@ function createScenarioItem(app) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +149,6 @@ function createScenarioItem(app) {
|
||||
|
||||
// Monitora i cambiamenti in selectedApp dallo store
|
||||
watch(() => userPrefStore.getSelApp, updateApplicationsMenu, { immediate: true });
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user