aggiornamenti vari...
This commit is contained in:
@@ -409,32 +409,56 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const connectWebSocket = () => {
|
||||
const myurlws = tools.getWssUrl()
|
||||
ws = new WebSocket(myurlws)
|
||||
console.log('connectWebSocket...')
|
||||
|
||||
const myurlws = tools.getWssUrl();
|
||||
console.log('myurlws', myurlws)
|
||||
ws = new WebSocket(myurlws);
|
||||
|
||||
const input = ref('');
|
||||
|
||||
console.log('connectWebSocket ... ' + myurlws)
|
||||
|
||||
console.log(`connectWebSocket ... ${myurlws}`);
|
||||
|
||||
ws.onmessage = (event: any) => {
|
||||
const data = JSON.parse(event.data);
|
||||
if (data.type === 'output' || data.type === 'error') {
|
||||
messages.value += data.data;
|
||||
scrollToBottom()
|
||||
} else if (data.type === 'input_required') {
|
||||
inputRequired.value = true;
|
||||
inputPrompt.value = data.prompt;
|
||||
} else if (data.type === 'close') {
|
||||
messages.value += '\n' + data.data
|
||||
console.log('onmessage', event);
|
||||
try {
|
||||
const data = JSON.parse(event.data);
|
||||
switch (data.type) {
|
||||
case 'output':
|
||||
case 'error':
|
||||
messages.value += data.data;
|
||||
scrollToBottom();
|
||||
break;
|
||||
case 'input_required':
|
||||
inputRequired.value = true;
|
||||
inputPrompt.value = data.prompt;
|
||||
break;
|
||||
case 'close':
|
||||
messages.value += `\n${data.data}`;
|
||||
break;
|
||||
default:
|
||||
console.warn('Unhandled message type:', data.type);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error parsing message:', error);
|
||||
}
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
console.log('onclose');
|
||||
statusWs.value = 'CLOSE';
|
||||
messages.value += '\nConnessione chiusa. Riconnessione...'
|
||||
messages.value += '\nConnessione chiusa. Riconnessione...';
|
||||
setTimeout(connectWebSocket, 5000);
|
||||
};
|
||||
|
||||
ws.onerror = (error) => {
|
||||
console.error('WebSocket error:', error);
|
||||
};
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log('onopen');
|
||||
statusWs.value = 'OPEN';
|
||||
};
|
||||
};
|
||||
|
||||
const startScript = (scriptName: string) => {
|
||||
|
||||
@@ -163,7 +163,7 @@ export default defineComponent({
|
||||
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
|
||||
// Set a threshold value based on how much scroll is needed to fix the components
|
||||
const threshold = 300;
|
||||
const threshold = 300
|
||||
|
||||
// Update the isFixed ref based on the scroll position
|
||||
isFixed.value = scrollTop > threshold;
|
||||
@@ -970,7 +970,7 @@ export default defineComponent({
|
||||
}
|
||||
}*/
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean, addnone?: boolean = false) => {
|
||||
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean = false) => {
|
||||
// console.log('valoriopt', item.table)
|
||||
return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user