+
{{ myel.container2 }}
-
+
{{ myel.container3 }}
Visualizzatore Tabelle
-
+
+
+
Cataloghi
-
+
+
-
+
+
+
+
+
+
-
+
+
-
+
@@ -624,61 +376,34 @@
CCheckIfIsLogged
-
+
Visu Video Promo and PDF
-
+
Versione: {{ tools.getvers() }}
-
+
Bottone Chat Territoriale
-
+
@@ -687,10 +412,7 @@
Msg di Controllo Verifica Email
-
+
{{ $t("components.authentication.email_verification.link_sent") }}
@@ -709,11 +431,7 @@
MAPPA:
@@ -725,20 +443,13 @@
MAPPA UTENTI:
-
+
-
+
EDIT ADDRESS BY COORD:
-
+
MAPPA COMUNI:
@@ -754,98 +465,53 @@
Check Sito di Test
-
+
-
+
TEST !
Controllo Nuova Versione
-
+
-
+
- Chiudere e Riaprire la App, per completare
- l'Aggiornamento
+ Chiudere e Riaprire la App, per completare
+ l'Aggiornamento
- Aggiornamento APP in corso ... Se dopo 1 minuto non dovesse
+ Aggiornamento APP in corso ... Se dopo 1 minuto non dovesse
scomparire questo messaggio, chiudere e riaprire la
- pagina.
+ pagina.
-
+
-
+
-
+
{{ $t("login.enter") }}
@@ -858,18 +524,9 @@
-
-
+
+
diff --git a/src/components/CMyPageElem/CMyPageElem.ts b/src/components/CMyPageElem/CMyPageElem.ts
index d6bbf6c0..2ea02585 100755
--- a/src/components/CMyPageElem/CMyPageElem.ts
+++ b/src/components/CMyPageElem/CMyPageElem.ts
@@ -168,9 +168,13 @@ export default defineComponent({
function selElemClick(myelem: IMyElem) {
console.log('mypageelem selElemClick', myelem)
- selElem.value = {}
- selElem.value = myelem
- visuEditor.value = !!myelem
+ try {
+ selElem.value = {}
+ selElem.value = myelem
+ visuEditor.value = !!myelem
+ } catch (error) {
+ console.log(error)
+ }
}
diff --git a/src/components/CMySelect/CMySelect.vue b/src/components/CMySelect/CMySelect.vue
index 947e85a0..ad1a7848 100755
--- a/src/components/CMySelect/CMySelect.vue
+++ b/src/components/CMySelect/CMySelect.vue
@@ -79,7 +79,6 @@
-
+
diff --git a/src/components/CMySlider/CMySlider.ts b/src/components/CMySlider/CMySlider.ts
index 7e78d64a..6e06d369 100755
--- a/src/components/CMySlider/CMySlider.ts
+++ b/src/components/CMySlider/CMySlider.ts
@@ -11,7 +11,8 @@ export default defineComponent({
props: {
modelValue: {
type: [String, Number],
- required: true,
+ required: false,
+ default: '0',
},
label: {
type: String,
diff --git a/src/components/CSearchProduct/CSearchProduct.scss b/src/components/CSearchProduct/CSearchProduct.scss
new file mode 100755
index 00000000..21ebd14f
--- /dev/null
+++ b/src/components/CSearchProduct/CSearchProduct.scss
@@ -0,0 +1,126 @@
+$heightBtn: 100%;
+$colore_titolo_libro: rgb(210, 12, 12);
+
+body {
+ line-height: 1.2 !important;
+}
+
+.card .product-image {
+ height: 300px;
+}
+
+.container {
+ margin-top: 4px;
+ margin-bottom: 4px;
+}
+
+.prod_trov {
+ font-style: italic;
+ color: grey;
+}
+
+.fixed-group {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ background-color: #ffffff;
+ /* Customize the background color as needed */
+ z-index: 1000;
+ /* Adjust the z-index to ensure it's above other elements */
+ transition: all 1s ease;
+}
+
+
+// Underline like a href
+.category {
+ color: darkblue;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ line-height: 19px;
+
+ cursor: pointer;
+}
+
+.category_sel {
+ color: white !important;
+ background: #5c8ef4 !important;
+ padding: 2px;
+}
+
+.category-title{
+ font-weight: bold;
+ font-size: 1.1rem;
+ margin-bottom: 0.5rem;
+ margin-top: 0.5rem;
+ color: black;
+ text-align: center;
+
+}
+
+.fixed-width {
+ width: var(--width) !important; /* Usa una variabile CSS */
+}
+.fixed-height {
+ height: var(--height) !important; /* Usa una variabile CSS */
+}
+
+.break {
+ flex-basis: 100%;
+ height: 0;
+}
+
+.book-title {
+ font-family: 'DINPro-CondensedBold', sans-serif;
+ color: $colore_titolo_libro;
+ text-transform: uppercase;
+ margin-top: calc(5 * var(--scalecatalog) * 1px);
+ margin-bottom: calc(5 * var(--scalecatalog) * 1px);
+ font-size: calc(20 * var(--scalecatalog) * 1px);
+ line-height: 100%;
+}
+
+.book-author {
+ font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
+ font-size: calc(18 * var(--scalecatalog) * 1px);
+}
+
+.book-descr {
+ font-family: 'DIN-Pro-Condensed-Bold-Italic', sans-serif;
+ font-size: calc(16 * var(--scalecatalog) * 1px);
+}
+
+.book-details {
+ font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
+ margin-bottom: calc(5 * var(--scalecatalog) * 1px);
+ font-size: calc(13 * var(--scalecatalog) * 1px);
+ text-align: left !important;
+}
+
+
+.book-descr-estesa {
+ font-family: 'AGaramondPro-Regular', sans-serif;
+ font-size: calc(15 * var(--scalecatalog) * 1px);
+ text-align: justify;
+ word-wrap: break-word;
+}
+
+.book-link{
+ font-style: italic;
+ font-size: calc(14 * var(--scalecatalog) * 1px);
+}
+
+.book-novita {
+ font-size: calc(20 * var(--scalecatalog) * 1px);
+}
+
+
+.book-text-up {
+ font-family: 'DINPro', sans-serif;
+ margin-bottom: calc(5 * var(--scalecatalog) * 1px);
+ font-size: calc(20 * var(--scalecatalog) * 1px);
+}
+.book-text-down {
+ font-family: 'DINPro', sans-serif;
+ margin-bottom: calc(5 * var(--scalecatalog) * 1px);
+}
diff --git a/src/components/CSearchProduct/CSearchProduct.ts b/src/components/CSearchProduct/CSearchProduct.ts
new file mode 100755
index 00000000..1445adf7
--- /dev/null
+++ b/src/components/CSearchProduct/CSearchProduct.ts
@@ -0,0 +1,192 @@
+import type { PropType } from 'vue';
+import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, nextTick } from 'vue'
+import { tools } from '@tools'
+import { useUserStore } from '@store/UserStore'
+import { useRouter } from 'vue-router'
+import { useGlobalStore } from '@store/globalStore'
+import { useProducts } from '@store/Products'
+import { useI18n } from 'vue-i18n'
+import { toolsext } from '@store/Modules/toolsext'
+import { useQuasar } from 'quasar'
+import { costanti } from '@costanti'
+
+import { shared_consts } from '@src/common/shared_vuejs'
+import { CProductCard } from '@src/components/CProductCard'
+
+import { CMySelect } from '@src/components/CMySelect'
+import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
+import { CSelectUserActive } from '@src/components/CSelectUserActive'
+import type {
+ IOptCatalogo, IDimensioni, IFilterCatalogo,
+ IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg
+} from 'model';
+
+
+import { fieldsTable } from '@store/Modules/fieldsTable'
+import { useCatalogStore } from '@src/store/CatalogStore'
+
+export default defineComponent({
+ name: 'CSearchProduct',
+ components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
+ emits: [],
+ props: {
+ modelValue: {
+ type: Object as PropType
,
+ required: true,
+ },
+ },
+ setup(props, { emit }) {
+ const userStore = useUserStore()
+ const globalStore = useGlobalStore()
+ const productStore = useProducts()
+ const router = useRouter()
+ const $q = useQuasar()
+ const { t } = useI18n()
+
+ const search = ref('')
+
+ const loadpage = ref(false)
+ const refreshpage = ref(false)
+ const show_hide = ref(false)
+
+ const mycolumns = ref([])
+
+ const idPage = ref('')
+ const selauthor = ref('')
+
+ const searchList = ref([])
+
+ const optcatalogo = ref(null);
+
+ const myproduct = ref({})
+
+ const labelcombo = computed(() => (item: any) => {
+ let lab = item.label
+ if (item.showcount)
+ lab += ' (' + valoriopt.value(item, false, false).length + ')'
+ return lab
+ })
+
+ const listaRicerca = computed(() => {
+ const mylist = searchList.value.find((rec: any) => rec.table === 'products' && rec.key === 'titolo')
+
+ return mylist
+ })
+
+
+ const searchText = computed(() => {
+ const lista = listaRicerca.value
+ return lista && lista.value && tools.existProp(lista.value, 'name') ? lista.value.name : ''
+ })
+
+ const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean = false) => {
+ // console.log('valoriopt', item.table)
+ return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
+ })
+
+ watch(() => searchText.value, (newval, oldval) => {
+ console.log('searchText=', searchText.value)
+ const id = getSearchId()
+ loadProduct(id)
+ })
+
+ async function loadProduct(id: string) {
+ // Carica il prodotto
+
+ if (id) {
+ myproduct.value = await productStore.loadProductById(id)
+ } else {
+ myproduct.value = null
+ }
+
+ if (myproduct.value) {
+ tools.setCookie(tools.COOK_LAST_PROD_SEARCH, myproduct.value._id.toString())
+ } else {
+ tools.setCookie(tools.COOK_LAST_PROD_SEARCH, '')
+ }
+
+ }
+
+ function resetSearch() {
+ const mialista = listaRicerca.value
+ if (mialista && mialista.value && tools.existProp(mialista.value, 'name')) {
+ mialista.value = null
+ }
+ search.value = ''
+ }
+
+
+ function getSearchId(): string {
+ const lista = listaRicerca.value
+ return lista && lista.value && lista.value._id ? lista.value._id : ''
+ }
+
+ async function mounted() {
+ // console.log('mounted Catalogo')
+
+ optcatalogo.value = props.modelValue
+ loadpage.value = false
+
+ const id = tools.getCookie(tools.COOK_LAST_PROD_SEARCH, '')
+
+ if (id) {
+ await loadProduct(id)
+ }
+
+ mycolumns.value = fieldsTable.getArrColsByTable('products')
+
+ searchList.value = [
+ {
+ visible: true,
+ label: 'Ricerca',
+ table: 'products',
+ key: 'titolo',
+ type: costanti.FieldType.select_by_server,
+ value: myproduct.value?.productInfo?.name,
+ // addall: true,
+ arrvalue: [],
+ useinput: true,
+ filter: null,
+ tablesel: 'products',
+ },
+ ]
+
+ // Inizializza
+ loadpage.value = true
+
+ }
+
+
+ function naviga(path: string) {
+ router.push(path)
+ }
+
+ onMounted(mounted)
+
+ return {
+ userStore,
+ costanti,
+ tools,
+ toolsext,
+ search,
+ shared_consts,
+ productStore,
+ t,
+ loadpage,
+ refreshpage,
+ show_hide,
+ searchList,
+ fieldsTable,
+ mycolumns,
+ naviga,
+ myproduct,
+ optcatalogo,
+ idPage,
+ selauthor,
+ valoriopt,
+ labelcombo,
+ searchText,
+ }
+ }
+})
+
diff --git a/src/components/CSearchProduct/CSearchProduct.vue b/src/components/CSearchProduct/CSearchProduct.vue
new file mode 100755
index 00000000..63af33f3
--- /dev/null
+++ b/src/components/CSearchProduct/CSearchProduct.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
Cerca un Titolo:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CSearchProduct/index.ts b/src/components/CSearchProduct/index.ts
new file mode 100755
index 00000000..39db3f70
--- /dev/null
+++ b/src/components/CSearchProduct/index.ts
@@ -0,0 +1 @@
+export { default as CSearchProduct } from './CSearchProduct.vue'
diff --git a/src/components/CViewTable/CViewTable.vue b/src/components/CViewTable/CViewTable.vue
index d277428f..f0afcc16 100755
--- a/src/components/CViewTable/CViewTable.vue
+++ b/src/components/CViewTable/CViewTable.vue
@@ -9,7 +9,6 @@
Query: {{ options.where }}
- risultatoHTML: {{risultatoHTML}}
diff --git a/src/db/lang/ws_it.js b/src/db/lang/ws_it.js
index 9cd59a3d..8e3eba27 100755
--- a/src/db/lang/ws_it.js
+++ b/src/db/lang/ws_it.js
@@ -1,9 +1,9 @@
const msg_website_it = {
ws: {
- sitename: 'Riso',
- siteshortname: 'RISO',
- description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.',
- keywords: 'riso, piattaforma di scambio, rete italiana scambio orizzontale, riso app, riso piattaforma, scambio e baratto, momenta RIS',
+ sitename: 'Gruppo Macro',
+ siteshortname: 'Gruppo Macro',
+ description: '',
+ keywords: '',
},
hours: {
descr: 'Descrizione',
@@ -16,29 +16,20 @@ const msg_website_it = {
pages: {
home: 'Home',
profile: 'Profilo',
+ install_site: 'Installa Sito',
profile2: 'ProfiloU',
mypage2: 'mypage2',
myservice2: 'myservice2',
myhosps2: 'myhosps2',
mygood2: 'mygood2',
+ catalogo: 'Catalogo',
fundraising: 'Sostieni il Progetto',
notifs: 'Configura le Notifiche',
unsubscribe: 'Disiscriviti',
+ unsubscribe_user: 'Disiscriviti User',
test: 'Test',
projects: 'Progetti',
report: 'Report Ore',
- producer: 'Produttore',
- orderinfo: 'Ordini Effettuati',
- products: 'Prodotti',
- productslist: 'Lista Prodotti',
- collabora: 'Collabora',
- storehouses: 'Magazzino',
- departments: 'Uffici',
- orders: 'Ordini Ricevuti',
- orders2: 'Ordini Ricevuti',
- sharewithus: 'Condividi con Noi',
- checkout: 'Carrello',
- payment: 'Pagamenti',
regok: 'Registrazione Confermata',
presentazione: 'Presentazione',
presentazione2: 'Presentazione',
@@ -89,9 +80,6 @@ const msg_website_it = {
projectsShared: 'Condivisi da me',
myprojects: 'Privati',
favproj: 'Favoriti',
- admin_ecommerce: 'ECommerce',
- ecommerce: 'Prodotti',
- ecommerce_menu: 'ECommerce1',
hours: 'Ore',
department: 'Uffici',
title: 'Titolo',
@@ -121,15 +109,9 @@ const msg_website_it = {
only_residenti: 'Solo Residenti',
only_consiglio: 'Solo Consiglieri',
color: 'Colore',
- mainMenu: 'Menu Principale',
- subtitle: 'Sottotitolo',
- lang: 'Lingua',
- keywords: 'Parole Chiave',
- desctiption: 'Descrizione',
- heightimg: 'Altezza Immagine',
},
msg: {
- myAppName: 'Riso',
+ myAppName: 'Più che Buono',
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito',
underconstruction: 'App in costruzione...',
myDescriz: '',
diff --git a/src/db/static_data.ts b/src/db/static_data.ts
index b8e31a9f..a2cc7074 100755
--- a/src/db/static_data.ts
+++ b/src/db/static_data.ts
@@ -1,6 +1,6 @@
-/* RISO APP
+/* GRUPPOMACRO APP
*/
-import type {
+import {
IListRoutes,
ILang,
IPreloadImages,
@@ -68,39 +68,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: false,
infooter: false,
},
- {
- active: true,
- order: 12,
- path: '/goods',
- materialIcon: 'fas fa-tshirt',
- name: 'mypages.goods',
- component: () => import('@src/root/goods/goods.vue'),
- meta: { requiresAuth: true },
- inmenu: true,
- infooter: true,
- },
- {
- active: true,
- order: 15,
- path: '/services',
- materialIcon: 'fas fa-house-user',
- name: 'mypages.services',
- component: () => import('@src/root/services/services.vue'),
- meta: { requiresAuth: true },
- inmenu: true,
- infooter: true,
- },
- {
- active: true,
- order: 15,
- path: '/activities',
- materialIcon: 'fas fa-house-user',
- name: 'mypages.activities',
- component: () => import('@src/root/activities/activities.vue'),
- meta: { requiresAuth: true },
- inmenu: false,
- infooter: false,
- },
{
active: true,
order: 15,
@@ -112,17 +79,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: false,
infooter: false,
},
- {
- active: true,
- order: 15,
- path: '/hosps',
- materialIcon: 'fas fa-bed',
- name: 'mypages.hosp',
- component: () => import('@src/root/hosp/hosp.vue'),
- meta: { requiresAuth: true },
- inmenu: true,
- infooter: true,
- },
{
active: site.confpages && site.confpages.enableCircuits,
order: 16,
@@ -135,7 +91,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true,
},
{
- active: true,
+ active: site.confpages && site.confpages.enableEvents,
order: 20,
path: '/events',
materialIcon: 'fas fa-bullhorn',
@@ -157,7 +113,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
- active: true,
+ active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/myprofile',
materialIcon: 'fas fa-user',
@@ -168,7 +124,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true,
},
{
- active: true,
+ active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/editprofile',
materialIcon: 'fas fa-user',
@@ -179,7 +135,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
- active: true,
+ active: site.confpages && site.confpages.showiscrittiMenu,
order: 130,
path: '/friends',
materialIcon: 'fas fa-user-friends',
@@ -274,16 +230,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: false,
infooter: false,
},
- {
- active: true,
- order: 150,
- path: '/sostieniilprogetto',
- materialIcon: 'fas fa-hand-holding-heart',
- name: 'pages.fundraising',
- component: () => import('@src/root/fundraising/fundraising.vue'),
- inmenu: false,
- infooter: false,
- },
{
active: true,
order: 80,
@@ -302,7 +248,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
export function firstimagehome() {
- const img = 'statics/images/background.jpg'
+ let img = 'statics/images/background.jpg'
return img
}
diff --git a/src/store/Api/index.ts b/src/store/Api/index.ts
index f1ca1dde..13075e9b 100755
--- a/src/store/Api/index.ts
+++ b/src/store/Api/index.ts
@@ -252,7 +252,7 @@ export const Api = {
},
// Funzione che gestisce la chiamata con retry
- async SendReq(url, method, mydata, setAuthToken = false, evitaloop = false, retryCount = 3, retryDelay = 5000, myformdata = null, responsedata = null, options = null) {
+ async SendReq(url, method, mydata, setAuthToken = false, evitaloop = false, retryCount = 1, retryDelay = 5000, myformdata = null, responsedata = null, options = null) {
try {
return await this.SendReqBase(url, method, mydata, setAuthToken, evitaloop, myformdata, responsedata, options);
} catch (error) {
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 9e862ef5..58c9a46a 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -25,7 +25,8 @@ import type {
IText,
IAreaDiStampa,
IOptCatalogo,
- IPagina
+ IPagina,
+ IMyScheda
} from '@model';
import {
Privacy,
@@ -100,6 +101,7 @@ export const tools = {
COOK_MAP_ZOOM: 'MAP_Z',
COOK_CATEGORIA: 'CATEG',
COOK_MAPBOUNDS: 'MAP-B',
+ COOK_LAST_PROD_SEARCH: 'LPR',
FRIENDS_SEARCH: 'FR_SE',
GROUP_SEARCH: 'GR_SE',
@@ -9492,6 +9494,20 @@ export const tools = {
return rec
},
+ resetRecIMyScheda(rec?: IMyScheda): IMyScheda {
+ rec.testo_right_attaccato = tools.resetIText(rec?.testo_right_attaccato)
+ rec.testo_right = tools.resetIText(rec?.testo_right)
+ rec.testo_bottom = tools.resetIText(rec?.testo_bottom)
+
+ rec.dimensioni = {pagina: null, riga: null, scheda_prodotto: {}, immagine_prodotto: {}}
+ rec.dimensioni.pagina = tools.resetRecIPagina({})
+ rec.testo_right_attaccato = tools.resetIText({})
+ rec.testo_right = tools.resetIText({})
+ rec.testo_bottom = tools.resetIText({})
+
+ return rec
+},
+
resetIBorder(rec: IBorder | null) {
if (!rec) {
rec = {}
@@ -9761,7 +9777,7 @@ export const tools = {
keycookie: '',
addall: true,
arrvalue: [],
- filter: null,
+ filter: () => {},
useinput: false,
icon: 'fas fa-user'
}]
diff --git a/src/store/Products.ts b/src/store/Products.ts
index 9754df78..6a51671f 100755
--- a/src/store/Products.ts
+++ b/src/store/Products.ts
@@ -1526,7 +1526,7 @@ export const useProducts = defineStore('Products', {
let pagename = ''
if (recscheda.scheda) {
if (recscheda.idPageOrig) {
- const page = this.mypage.find((page) => (`${page._id}`) === recscheda.idPageOrig)
+ const page = this.mypage?.find((page) => (`${page._id}`) === recscheda.idPageOrig)
pagename = page ? page.title! : ''
}
if (pagename)
diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts
index 908ec808..584b6974 100644
--- a/src/store/globalStore.ts
+++ b/src/store/globalStore.ts
@@ -2293,7 +2293,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
}
- // console.log('getServerHost', myserv)
+ console.log('getServerHost', myserv)
return myserv
} catch (e) {
@@ -2409,6 +2409,18 @@ export const useGlobalStore = defineStore('GlobalStore', {
newrec.height = 600
} else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
newrec.class2 = 'row justify-center'
+ } else if (newrec.type === shared_consts.ELEMTYPE.SEARCHPRODUCT) {
+ newrec.catalogo = {
+ productTypes: [0],
+ excludeproductTypes: [],
+ formato: [],
+ Categoria: [],
+ editore: [],
+ pdf: false,
+ dimensioni_def: {
+ pagina: tools.resetRecIDimensioni(null)
+ },
+ }
} else if (newrec.type === shared_consts.ELEMTYPE.CATALOGO) {
newrec.catalogo = {
//++AddCATALOGO_FIELDS
diff --git a/src/views/admin/server/server.ts b/src/views/admin/server/server.ts
index 27f17614..452a93c3 100755
--- a/src/views/admin/server/server.ts
+++ b/src/views/admin/server/server.ts
@@ -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) => {
diff --git a/src/views/ecommerce/catalogo/catalogo.ts b/src/views/ecommerce/catalogo/catalogo.ts
index 46e05e18..565fb642 100755
--- a/src/views/ecommerce/catalogo/catalogo.ts
+++ b/src/views/ecommerce/catalogo/catalogo.ts
@@ -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)
})