diff --git a/src/assets/tailwind.css b/src/assets/tailwind.css
index e0f80af..a734097 100644
--- a/src/assets/tailwind.css
+++ b/src/assets/tailwind.css
@@ -8,6 +8,6 @@
.editor ol, .md-editor-preview ol{
list-style-type: decimal !important;
}
-.editor .md-editor-preview{
- word-break: break-word;
+.editor, .md-editor-preview{
+ word-break: break-word !important;
}
diff --git a/src/layout/AppMenu.vue b/src/layout/AppMenu.vue
index 2c8a32a..af33bfe 100644
--- a/src/layout/AppMenu.vue
+++ b/src/layout/AppMenu.vue
@@ -83,7 +83,7 @@ function updateApplicationsMenu() {
//Aggiungi "Rev Eng Code" alla fine della lista
model.value[1].items.push({
- label: 'Rev Eng Code',
+ label: 'Application Code',
icon: 'pi pi-fw pi-cog',
command: () => {
route.push({ path: '/app-browser' });
diff --git a/src/layout/AppProfileMenu.vue b/src/layout/AppProfileMenu.vue
index d3e347b..5b7facb 100644
--- a/src/layout/AppProfileMenu.vue
+++ b/src/layout/AppProfileMenu.vue
@@ -6,7 +6,9 @@
{{ user.name + " " + user.surname }}
- Logout
+
+ Logout
+
@@ -16,14 +18,26 @@
import { useAuth } from '@websanova/vue-auth/src/v3.js';
import { computed } from 'vue';
import { useRouter } from 'vue-router';
+import { ScenarioStore } from '@/stores/ScenarioStore';
const auth = useAuth();
const user = computed(() => auth.user());
const router = useRouter();
+const scenario_store = ScenarioStore();
+
function redirectProject() {
router.push('/projects'); // Specifica il percorso per la pagina "Projects"
}
+function logout() {
+ auth.logout().then(() => {
+ scenario_store.resetStore();
+ router.push('/auth/login');
+ }).catch(err => {
+ console.error("Errore durante il logout:", err);
+ });
+}
+
diff --git a/src/stores/ScenarioStore.js b/src/stores/ScenarioStore.js
index aa0c9e4..44d2565 100644
--- a/src/stores/ScenarioStore.js
+++ b/src/stores/ScenarioStore.js
@@ -6,7 +6,6 @@ import { UserPrefStore } from './UserPrefStore'
export const ScenarioStore = defineStore('scenario_store', () => {
-
const projectScenarios = ref([])
const globalScenarios = ref([])
const applicationScenarios = ref([])
@@ -18,7 +17,6 @@ export const ScenarioStore = defineStore('scenario_store', () => {
const userPrefStore = UserPrefStore()
const loadingStore = LoadingStore()
-
async function fetchScenarios() {
loadingStore.scenario_loading = true;
await ScenarioService.getScenariosProject(userPrefStore.selectedProject).then(resp => {
@@ -26,7 +24,6 @@ export const ScenarioStore = defineStore('scenario_store', () => {
allScenarios.value = [...projectScenarios.value]
loadingStore.scenario_loading = false;
});
-
}
async function fetchScenariosForRE() {
@@ -35,7 +32,6 @@ export const ScenarioStore = defineStore('scenario_store', () => {
scenariosForRE.value = resp.data;
loadingStore.scenario_loading = false;
});
-
}
async function fetchScenariosCross() {
@@ -45,19 +41,16 @@ export const ScenarioStore = defineStore('scenario_store', () => {
allScenarios.value = [...globalScenarios.value]
loadingStore.scenario_loading = false;
});
-
}
-
async function fetchApplicationScenarios() {
loadingStore.scenario_loading = true;
- console.log("fetchApplicationScenarios >= selectedApp", userPrefStore.selectedApp) ;
- await ScenarioService.getScenariosApplication(userPrefStore.selectedApp).then(resp=>{
+ console.log("fetchApplicationScenarios >= selectedApp", userPrefStore.selectedApp);
+ await ScenarioService.getScenariosApplication(userPrefStore.selectedApp).then(resp => {
console.log("response scenari", resp);
applicationScenarios.value = resp.data
allScenarios.value = [...projectScenarios.value, ...applicationScenarios.value]
loadingStore.scenario_loading = false;
-
})
}
@@ -65,7 +58,6 @@ export const ScenarioStore = defineStore('scenario_store', () => {
return allScenarios.value
})
-
const filteredScenarios = computed(() => {
console.log("scenarios", allScenarios.value);
var filteredScenario = []
@@ -91,12 +83,43 @@ export const ScenarioStore = defineStore('scenario_store', () => {
});
})
+ const filteredScenariosCanvas = computed(() => {
+ console.log("scenarios", allScenarios.value);
+ var filteredScenario = []
- return {filteredScenarios,
- projectScenarios,
- applicationScenarios,
- fetchScenarios,
- fetchApplicationScenarios,
- scenarios,
- filterString , typeFilter, fetchScenariosCross, globalScenarios, fetchScenariosForRE, scenariosForRE}
- })
\ No newline at end of file
+ if(userPrefStore.getSelApp != null) {
+ filteredScenario = [...globalScenarios.value,...projectScenarios.value, ...applicationScenarios.value]
+ } else {
+ filteredScenario = [...globalScenarios.value,...projectScenarios.value]
+ }
+
+ return filteredScenario
+ })
+
+ function resetStore() {
+ projectScenarios.value = []
+ globalScenarios.value = []
+ applicationScenarios.value = []
+ filterString.value = ''
+ allScenarios.value = []
+ typeFilter.value = { name: 'All', value: 'all' }
+ scenariosForRE.value = []
+ }
+
+ return {
+ filteredScenarios,
+ filteredScenariosCanvas,
+ projectScenarios,
+ applicationScenarios,
+ fetchScenarios,
+ fetchApplicationScenarios,
+ scenarios,
+ filterString,
+ typeFilter,
+ fetchScenariosCross,
+ globalScenarios,
+ fetchScenariosForRE,
+ scenariosForRE,
+ resetStore
+ }
+})
\ No newline at end of file
diff --git a/src/views/pages/ProjectList.vue b/src/views/pages/ProjectList.vue
index 3c0af0e..1f15601 100644
--- a/src/views/pages/ProjectList.vue
+++ b/src/views/pages/ProjectList.vue
@@ -79,12 +79,14 @@ import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import { LoadingStore } from '../../stores/LoadingStore.js';
import { UserPrefStore } from '../../stores/UserPrefStore.js';
+import { ScenarioStore } from '../../stores/ScenarioStore.js';
const loadingStore = LoadingStore()
const userPrefStore = UserPrefStore();
const auth = useAuth();
const user = computed(() => auth.user());
+const scenario_store = ScenarioStore();
const router = useRouter()
@@ -122,6 +124,7 @@ const user = computed(() => auth.user());
const openProject = async (project) => {
try {
// Esegui l'update del progetto
+ scenario_store.resetStore();
await userPrefStore.updateSelectedProject(project);
console.log('Progetto aggiornato e dati utente ricaricati');
diff --git a/src/views/pages/ScenarioExec.vue b/src/views/pages/ScenarioExec.vue
index 3461e99..028fc0d 100644
--- a/src/views/pages/ScenarioExec.vue
+++ b/src/views/pages/ScenarioExec.vue
@@ -1,262 +1,199 @@
-
-
-
- {{ scenario.name }}
-
-
-
-
- {{ scenario.description }}
-
-
-
-
-
- {{ scenario.hint }}
-
-
-
-
-
-
-
- {{ input.label }}
-
-
-
-
-
onUpload(event, 'SingleFileUpload')"
- :multiple="false"
- :accept="acceptedFormats"
- auto
- :showUploadButton="false"
- :showCancelButton="false"
- :maxFileSize="10000000"
- v-model:files="uploadedFiles"
-
-
- >
-
-
-
-
-
-
-
-
- Name
- Dimension
- Status
- Actions
-
-
-
-
+
+ {{ scenario.name }}
+
+
+
+
+ {{ scenario.description }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ input.label }}
+
+
+
+ onUpload(event, 'SingleFileUpload')"
+ :multiple="false"
+ :accept="acceptedFormats"
+ auto
+ :showUploadButton="false"
+ :showCancelButton="false"
+ :maxFileSize="10000000"
+ v-model:files="uploadedFiles"
>
- {{ file.name }}
- {{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ Name
+ Dimension
+ Status
+ Actions
+
+
+
+
+ {{ file.name }}
+ {{ formatSize(file.size) }}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
Drag and drop files to here to upload.
-
-
-
-
-
-
-
-
-
- {{ input.label }}
-
-
-
-
-
-
onUpload(event, 'MultiFileUpload')"
- :multiple="true"
- accept=".msg,.txt,.docx"
- auto
- :showUploadButton="false"
- :showCancelButton="false"
- :maxFileSize="10000000"
- v-model:files="uploadedFiles"
-
-
- >
-
-
-
-
-
-
-
-
- Name
- Dimension
- Status
- Actions
-
-
-
-
- {{ file.name }}
- {{ formatSize(file.size) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Drag and drop files to here to upload.
-
-
-
-
-
-
-
-
{{ input.label }}
-
-
-
-
-
-
-
+
+
+
+
Drag and drop files to here to upload.
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scenario_response_message }}
-
-
- Starting execution...
-
-
-
Time elapsed:
-
00:00
-
+
+
+ {{ input.label }}
+
+
+
+
onUpload(event, 'MultiFileUpload')"
+ :multiple="true"
+ accept=".msg,.txt,.docx"
+ auto
+ :showUploadButton="false"
+ :showCancelButton="false"
+ :maxFileSize="10000000"
+ v-model:files="uploadedFiles"
+ >
+
+
+
+
+
+
+
+ Name
+ Dimension
+ Status
+ Actions
+
+
+
+
+ {{ file.name }}
+ {{ formatSize(file.size) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Drag and drop files to here to upload.
+
+
+
+
+
+
+
{{ input.label }}
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+ {{ scenario_response_message }}
+
+
Starting execution...
+
+
Time elapsed:
+
00:00
+
+
+
+
+
Workflow Response
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sf_document-{{exec_id}}
-
-
-
-
-
-
-
-
-
+
+
+
+ sf_document-{{ exec_id }}
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
+}
+
diff --git a/src/views/pages/ScenarioList.vue b/src/views/pages/ScenarioList.vue
index 32e1b91..b144e70 100644
--- a/src/views/pages/ScenarioList.vue
+++ b/src/views/pages/ScenarioList.vue
@@ -58,13 +58,12 @@
{{ item.name }}
{{ item.description }}
-
- {{ item.visible }}
-
-
-
-
+
+
+ {{ item.visible }}
+
+
@@ -102,10 +101,8 @@ const scenarioTypeOp = ref([
onMounted(() => {
userPrefStore.fetchUserData().then(() => {
-
-
- scenario_store.fetchScenarios();
scenario_store.fetchScenariosCross();
+ scenario_store.fetchScenarios();
if(userPrefStore.getSelApp != null){
scenario_store.fetchApplicationScenarios();
}
diff --git a/src/views/pages/canvas/MdCanvas.vue b/src/views/pages/canvas/MdCanvas.vue
index b9d4839..2fa7fa9 100644
--- a/src/views/pages/canvas/MdCanvas.vue
+++ b/src/views/pages/canvas/MdCanvas.vue
@@ -7,7 +7,7 @@
-
+
@@ -24,7 +24,8 @@
Add to Canvas
-
+
+
@@ -46,12 +47,16 @@ import MdScenarioExctuotionDialog from '@/views/pages/canvas/MdScenarioExecution
import { Emoji, ExportPDF, Mark } from '@vavt/v3-extension';
import '@vavt/v3-extension/lib/asset/style.css';
import axios from 'axios';
-import { MdEditor } from 'md-editor-v3';
+import { MdEditor, MdPreview } from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';
-import { computed, onMounted, ref } from 'vue';
+import { computed, onMounted, ref} from 'vue';
+import { ScenarioStore } from '@/stores/ScenarioStore';
+import { UserPrefStore } from '@/stores/UserPrefStore';
const menu = ref();
- const content = ref('# Welcome to WizardAI Canvas....');
+ const content = ref('# Welcome to WizardAI Canvas.... \n- Right-click to execute one of the available scenarios or ask general questions to Workflow.\n- Select text and right-click to summarize or rewrite it.');
+ const scenario_store = ScenarioStore();
+ const userPrefStore = UserPrefStore();
const scenarios = ref([]);
const items = ref([]);
const execScenarioDialogVisible = ref(false);
@@ -81,7 +86,7 @@ import { computed, onMounted, ref } from 'vue';
});
}
- const onRightClick = (event) => {
+ const onRightClick = async (event) => {
if(editor.value.getSelectedText().length > 0) {
items.value=[
{label: 'Summarize',icon: 'pi pi-language', command:()=>openEditorAssistant(editor.value.getSelectedText(), "summarize")},
@@ -89,28 +94,34 @@ import { computed, onMounted, ref } from 'vue';
]
}else {
items.value=[
- { label: 'Ask Workflow', icon: 'pi pi-language', command:()=>openAskDialog()},
- { separator: true},
- { label: 'Execute Scenario', icon: 'pi pi-volume-up',items: scenarioMenuItems}
- ]
- }
+ {label: 'Ask Workflow', icon: 'pi pi-language', command:()=>openAskDialog()},
+ {separator: true}
+ ]
+ if (scenarioMenuItems().length > 0) {
+ items.value.push({label: 'Execute Scenario', icon: 'pi pi-volume-up', items: scenarioMenuItems()})
+ }
+ }
menu.value.show(event);
};
-
- const scenarioMenuItems = computed(() => {
+ function scenarioMenuItems() {
const scenario_items = [];
- for (let i = 0; i < scenarios.value.length; i++) {
- scenario_items.push({
- label: scenarios.value[i].name,
- icon: 'pi pi-file',
- command: () => {
- executeScenario(scenarios.value[i]);
- }
- });
- }
+ scenario_store.filteredScenariosCanvas.forEach(scenario => {
+ if (scenario.canvasEnabled) {
+ scenario_items.push({
+ label: scenario.name,
+ icon: 'pi pi-wrench',
+ command: () => {
+ executeScenario(scenario);
+ }
+ });
+ }
+ });
return scenario_items;
- });
+ };
+
+
+
const executeScenario = (scenario) => {
@@ -197,12 +208,20 @@ import { computed, onMounted, ref } from 'vue';
};
onMounted(() => {
- ScenarioService.getScenarios().then(resp=>{
- scenarios.value = resp.data
- })
+ userPrefStore.fetchUserData().then(() => {
+ scenario_store.fetchScenariosCross();
+ scenario_store.fetchScenarios();
+ if(userPrefStore.getSelApp != null){
+ scenario_store.fetchApplicationScenarios();
+ }
+
+ });
+ scenarioMenuItems();
});
+
+
const toolbars = ref([
'bold',
'underline',
diff --git a/src/views/pages/canvas/MdScenarioExecutionDialog.vue b/src/views/pages/canvas/MdScenarioExecutionDialog.vue
index 0aa1a26..2e6df14 100644
--- a/src/views/pages/canvas/MdScenarioExecutionDialog.vue
+++ b/src/views/pages/canvas/MdScenarioExecutionDialog.vue
@@ -1,7 +1,6 @@
-
-
-
+
+
+
+
+
+ {{ input.label }}
+
+
+
+
onUpload(event, 'SingleFileUpload')"
+ :multiple="false"
+ :accept="acceptedFormats"
+ auto
+ :showUploadButton="false"
+ :showCancelButton="false"
+ :maxFileSize="10000000"
+ v-model:files="uploadedFiles"
+ >
+
+
+
+
+
+
+
+ Name
+ Dimension
+ Status
+ Actions
+
+
+
+
+ {{ file.name }}
+ {{ formatSize(file.size) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Drag and drop files to here to upload.
+
+
+
-
-
-
-
- Add to Canvas
-
-
-
-
-
-
+
+
+
+
+ {{ input.label }}
+
+
+
+
onUpload(event, 'MultiFileUpload')"
+ :multiple="true"
+ accept=".msg,.txt,.docx"
+ auto
+ :showUploadButton="false"
+ :showCancelButton="false"
+ :maxFileSize="10000000"
+ v-model:files="uploadedFiles"
+ >
+
+
+
+
+
+
+
+ Name
+ Dimension
+ Status
+ Actions
+
+
+
+
+ {{ file.name }}
+ {{ formatSize(file.size) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Drag and drop files to here to upload.
+
+
+
+
+
+
+
{{ input.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scenario_response_message }}
+
+
Starting execution...
+
+
Time elapsed:
+
00:00
+
+
+
+
+
+
+ Workflow Response
+
+
+
+
+
+
+
+
+
+
+ Add to Canvas
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
+
+pre {
+ white-space: pre-wrap; /* Fa andare a capo il contenuto automaticamente */
+ word-wrap: break-word; /* Interrompe le parole troppo lunghe */
+ overflow-wrap: break-word; /* Per compatibilità con più browser */
+ max-width: 100%; /* Imposta una larghezza massima pari al contenitore genitore */
+ overflow-x: auto; /* Aggiunge uno scorrimento orizzontale solo se necessario */
+ background-color: #f5f5f5; /* Colore di sfondo opzionale per migliorare leggibilità */
+ padding: 10px; /* Spaziatura interna */
+ border-radius: 5px; /* Bordo arrotondato opzionale */
+ font-family: monospace; /* Font specifico per codice */
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Ombra per migliorare estetica */
+}
+
+.markdown-content {
+ word-wrap: break-word; /* Spezza le parole lunghe */
+ overflow-wrap: break-word; /* Per compatibilità con più browser */
+ max-width: 100%; /* Adatta il contenuto alla larghezza del contenitore */
+ overflow-x: auto; /* Aggiunge scorrimento orizzontale solo se necessario */
+ background-color: #f5f5f5; /* Sfondo per distinguere il contenuto */
+}
+