- Aggiunto le Statistiche di visualizzazione delle pagine.

- Aggiunto il componente per visualizzare le statistiche
This commit is contained in:
Surya Paolo
2025-07-08 16:19:12 +02:00
parent 7f5ff3da64
commit 40ec5465b2
61 changed files with 3593791 additions and 654 deletions

View File

@@ -0,0 +1,25 @@
// src/boot/trackPageViews.js
import { Api } from '@api';
import { useUserStore } from '@store/UserStore';
export default ({ router }) => {
router.afterEach((to) => {
const pageUrl = window.location.href;
const userAgent = navigator.userAgent;
const userStore = useUserStore();
const mydata = {
url: pageUrl,
userAgent,
username: userStore.my?.username,
userId: userStore.my?._id,
};
// Invia il tracciamento al backend
Api.SendReq('/api/track-pageview', 'POST', mydata).catch((err) => {
console.error('Errore nel tracking:', err);
});
});
};

View File

@@ -1,4 +1,3 @@
export const shared_consts = {
Accepted: {
CHECK_READ_GUIDELINES: {
@@ -173,6 +172,7 @@ export const shared_consts = {
CATALOGLIST: 420,
SEARCHPRODUCT: 430,
RACCOLTE_CATALOGHI: 450,
STAT_PAGES: 460,
},
QUERYTYPE_MYGROUP: 1,
@@ -291,12 +291,7 @@ export const shared_consts = {
PARAM_SHOW_PROVINCE: 1,
TABLES_ID_STRING: [
'circuits',
'accounts',
'movements',
'mygroups',
],
TABLES_ID_STRING: ['circuits', 'accounts', 'movements', 'mygroups'],
TABLES_ID_NUMBER: [
'permissions',
@@ -359,7 +354,6 @@ export const shared_consts = {
label: 'Con Provincia inserita',
value: 16777216, //FILTER_USER_PROVINCE:
},
],
RECFILTRI_UTENTE_FACIL: [
@@ -368,7 +362,7 @@ export const shared_consts = {
value: 4294967296, //FILTER_FACILITATORE: ,:
},
{
label: 'Non ancora approvati dall\'invitante',
label: "Non ancora approvati dall'invitante",
value: 2097152, // shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR
},
{
@@ -397,22 +391,19 @@ export const shared_consts = {
},
],
MYTABS: [{ id: 0, table: 'none' },
{ id: 1, table: 'myskills' },
{ id: 2, table: 'mybachecas' },
{ id: 3, table: 'myhosps' },
{ id: 4, table: 'mygoods' },
{ id: 5, table: 'myevents' },
{ id: 6, table: 'attivitas' }],
MYTABS: [
{ id: 0, table: 'none' },
{ id: 1, table: 'myskills' },
{ id: 2, table: 'mybachecas' },
{ id: 3, table: 'myhosps' },
{ id: 4, table: 'mygoods' },
{ id: 5, table: 'myevents' },
{ id: 6, table: 'attivitas' },
],
// Condivise
TABLES_FAVORITE_BOOKMARK: ['myskills', 'mygoods', 'mybachecas', 'myhosps', 'attivitas'],
TABLEFORUSERS: [
'myskills',
'mygoods',
'mybachecas',
'myhosps',
],
TABLEFORUSERS: ['myskills', 'mygoods', 'mybachecas', 'myhosps'],
// Solo per VUE.JS
@@ -423,14 +414,30 @@ export const shared_consts = {
COL_WITH_ARRFILTER_IN_AND: ['preferences'],
TABLES_WITH_DATE: ['mybachecas', 'myhosps'], // 'mybachecas'
TABLES_WITH_SORTING: ['mybachecas', 'myhosps'],
TABLES_REC_ID: ['skills', 'goods', 'subskills', 'myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_REC_ID: [
'skills',
'goods',
'subskills',
'myskills',
'mybachecas',
'myhosps',
'mygoods',
],
// costanti.VISUTABLE_SCHEDA_USER, VISUTABLE_SCHEDA_GROUP, VISUTABLE_USER_TABGROUP, VISUTABLE_USER_TABCIRCUIT, VISUTABLE_GROUP_CIRCUIT, VISUTABLE_
VERTIC_SHOW_GRID: [-1, 2, -3, -4, -5, -6, -10],
TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots'],
TABLES_FINDER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'],
TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups', 'catalogs', 'raccoltacataloghis'],
TABLES_VISU_CMYSRECCARD: [
'myskills',
'mybachecas',
'myhosps',
'mygoods',
'mygroups',
'catalogs',
'raccoltacataloghis',
],
TABLES_SHOW_ADTYPE: ['myskills', 'mygoods', 'myhosps'],
TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'users'],
@@ -575,7 +582,7 @@ export const shared_consts = {
{
value: 2,
label: 'Ospitalità',
}
},
],
TipoDiAttivita: [
@@ -672,7 +679,7 @@ export const shared_consts = {
},
{
value: 7,
label: 'Casetta sull\'Albero',
label: "Casetta sull'Albero",
},
{
value: 8,
@@ -688,7 +695,6 @@ export const shared_consts = {
},
],
People: [
{
value: 0,
@@ -763,7 +769,7 @@ export const shared_consts = {
},
{
value: 4,
label: 'E\' consentito fumare in casa',
label: "E' consentito fumare in casa",
},
{
value: 5,
@@ -807,7 +813,7 @@ export const shared_consts = {
},
{
value: 15,
label: 'Doccia all\'aperto',
label: "Doccia all'aperto",
},
{
value: 16,
@@ -930,7 +936,7 @@ export const shared_consts = {
},
{
value: 'VDA',
label: 'Valle d\'Aosta',
label: "Valle d'Aosta",
},
{
value: 'VEN',
@@ -983,19 +989,23 @@ export const shared_consts = {
Cat_Interesse_Arcadei: [
{
value: 1,
label: 'Agricoltura sostenibile e naturale, autonomia alimentare locale (orto, g.a.s.)',
label:
'Agricoltura sostenibile e naturale, autonomia alimentare locale (orto, g.a.s.)',
},
{
value: 2,
label: 'Creazione ed Integrazione ecologica di nuove strutture Abitative, rimboschimento, conservazione del territorio.',
label:
'Creazione ed Integrazione ecologica di nuove strutture Abitative, rimboschimento, conservazione del territorio.',
},
{
value: 4,
label: 'Economia circolare e creazione di sistemi di unità di conto scambio beni e servizi, sistemi di baratto, dono e solidarietà.',
label:
'Economia circolare e creazione di sistemi di unità di conto scambio beni e servizi, sistemi di baratto, dono e solidarietà.',
},
{
value: 8,
label: 'Ricerca, sviluppo e implementazione di tecnologie di approvigionamento energetico.',
label:
'Ricerca, sviluppo e implementazione di tecnologie di approvigionamento energetico.',
},
{
value: 16,
@@ -1007,11 +1017,13 @@ export const shared_consts = {
},
{
value: 64,
label: 'Formazione, informazione, divulgazione, Educazione e trasmissione generazionale della conoscenza.',
label:
'Formazione, informazione, divulgazione, Educazione e trasmissione generazionale della conoscenza.',
},
{
value: 128,
label: 'Convivialità, Arte e Cultura. Tutela, conservazione e promozione delle tradizioni e culture locali.',
label:
'Convivialità, Arte e Cultura. Tutela, conservazione e promozione delle tradizioni e culture locali.',
},
],
@@ -1026,17 +1038,16 @@ export const shared_consts = {
},
],
VisibilGroup: [
{
value: 1,
label: 'Privato',
hint: 'Solo i membri possono vedere chi fa parte del gruppo'
hint: 'Solo i membri possono vedere chi fa parte del gruppo',
},
{
value: 2,
label: 'Nascosto',
hint: 'il Gruppo non sarà visibile nella ricerca'
hint: 'il Gruppo non sarà visibile nella ricerca',
},
],
@@ -1044,7 +1055,7 @@ export const shared_consts = {
{
value: 0,
label: '',
hint: ''
hint: '',
},
{
value: 1,
@@ -1162,12 +1173,12 @@ export const shared_consts = {
{
id: 1,
label: 'Messaggio su Template',
value: 1, //MSG_OF_TEMPLATE
value: 1, //MSG_OF_TEMPLATE
},
{
id: 2,
label: 'Messaggio di Testo',
value: 2, // MSG_TEXT
value: 2, // MSG_TEXT
},
],
@@ -1230,31 +1241,27 @@ export const shared_consts = {
{
id: 5,
label: 'a un Utente',
value: 25, //TypeMsg.SEND_TO_USER
value: 25, //TypeMsg.SEND_TO_USER
},
{
id: 6,
label: 'a un Gruppo',
value: 30, //SEND_TO_GROUP: 30,
value: 30, //SEND_TO_GROUP: 30,
},
{
id: 7,
label: 'a me stesso',
value: 40, //SEND_TO_MYSELF: 40,
value: 40, //SEND_TO_MYSELF: 40,
},
{
id: 8,
label: 'Abilitati Telegram (senza Username telegram)',
value: 50, //SEND_TO_TELEG_NO_USERNAME_TELEG: 50,
value: 50, //SEND_TO_TELEG_NO_USERNAME_TELEG: 50,
},
{
id: 9,
label: 'Abilitati Telegram (Non Verificati dall\'Invitante)',
value: 60, //SEND_TO_TELEG_NO_VERIF_BY_APORTADOR: 60,
label: "Abilitati Telegram (Non Verificati dall'Invitante)",
value: 60, //SEND_TO_TELEG_NO_VERIF_BY_APORTADOR: 60,
},
],
@@ -1270,8 +1277,8 @@ export const shared_consts = {
CHECKOUT_SENT: 2,
ORDER_CONFIRMED: 3,
PAYED: 4,
DELIVERED: 5, // Consegnato
SHIPPED: 6, //Spedito
DELIVERED: 5, // Consegnato
SHIPPED: 6, //Spedito
RECEIVED: 7,
COMPLETED: 6,
CANCELED: 10,
@@ -1280,25 +1287,54 @@ export const shared_consts = {
},
OrderPages: {
LISTA_TOTALI: { label: 'Lista Totali', value: 1, icon: 'fas fa-chart-bar', color: 'text-green' },
LISTA_TOTALI: {
label: 'Lista Totali',
value: 1,
icon: 'fas fa-chart-bar',
color: 'text-green',
},
ORDINI: { label: 'Ordini', value: 2, icon: 'fas fa-tasks', color: 'text-blue' },
},
OrderStat: {
// IN_CART: { label: 'In Carrello', value: 1 }, //IN_CART
IN_CORSO: { label: 'In Corso', value: 2, icon: 'fas fa-tasks', color: 'text-black' }, //CHECKOUT_SENT
PREPARED: { label: 'Preparati', value: 15, icon: 'fas fa-archive', color: 'text-orange' },
CONFERMATI: { label: 'Confermati', value: 3, icon: 'fas fa-calendar', color: 'text-blue' }, //ORDER_CONFIRMED
PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
DELIVERED: { label: 'Consegnato', value: 5, icon: 'fas fa-calendar', color: 'text-blue' }, //DELIVERED
SHIPPED: { label: 'Spediti', value: 6, icon: 'fas fa-shipping-fast', color: 'text-green' }, //SHIPPED
PREPARED: {
label: 'Preparati',
value: 15,
icon: 'fas fa-archive',
color: 'text-orange',
},
CONFERMATI: {
label: 'Confermati',
value: 3,
icon: 'fas fa-calendar',
color: 'text-blue',
}, //ORDER_CONFIRMED
PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
DELIVERED: {
label: 'Consegnato',
value: 5,
icon: 'fas fa-calendar',
color: 'text-blue',
}, //DELIVERED
SHIPPED: {
label: 'Spediti',
value: 6,
icon: 'fas fa-shipping-fast',
color: 'text-green',
}, //SHIPPED
RECEIVED: { label: 'Ricevuti', value: 7, icon: '', color: 'text-blue' }, //RECEIVED
COMPLETATI: { label: 'Completati', value: 8, icon: 'fas fa-check', color: 'text-blue' }, //COMPLETED
COMPLETATI: {
label: 'Completati',
value: 8,
icon: 'fas fa-check',
color: 'text-blue',
}, //COMPLETED
CANCELLATI: { label: 'Cancellati', value: 10, icon: 'delete', color: 'text-red' }, //CANCELED
},
REACTIONS_FIELD:
{
REACTIONS_FIELD: {
numseen: 1,
numbook: 1,
numfav: 1,
@@ -1355,42 +1391,41 @@ export const shared_consts = {
label: 'Elimina Definitivamente !!',
value: 20,
},
],
OrderCmdStr: [
{
label: 'Imposta Ordine in Lavorazione', //CHECKOUT_SENT
label: 'Imposta Ordine in Lavorazione', //CHECKOUT_SENT
value: 2,
icon: 'fas fa-list-ol',
color: 'secondary',
},
{
label: '📩 Conferma Ordine Evaso (e aggiorna le quantità in Magsazzino)', //ORDER_CONFIRMED
label: '📩 Conferma Ordine Evaso (e aggiorna le quantità in Magsazzino)', //ORDER_CONFIRMED
value: 3,
icon: 'fas fa-calendar-check',
color: 'primary',
},
{
label: '📩 Imposta come Consegnato', //DELIVERED
label: '📩 Imposta come Consegnato', //DELIVERED
value: 5,
icon: 'fas fa-shipping-fast',
color: 'blue',
},
{
label: 'Imposta come Preparato', //PREPARED
label: 'Imposta come Preparato', //PREPARED
value: 15,
icon: 'fas fa-archive',
color: 'blue',
},
{
label: 'Imposta come Pagato', //PAYED
label: 'Imposta come Pagato', //PAYED
value: 4,
icon: 'money',
color: 'positive',
},
{
label: 'Imposta come Spedito', //DELIVERED
label: 'Imposta come Spedito', //DELIVERED
value: 5,
icon: 'fas fa-shipping-fast',
color: 'blue',
@@ -1593,7 +1628,7 @@ export const shared_consts = {
{
value: 1, // ID_FAVORITE_ADDED
labeltrans: 'notifsid.favorite_new',
}
},
],
},
{
@@ -1609,7 +1644,7 @@ export const shared_consts = {
{
value: 4, // ID_EVENTS_ATTEND
labeltrans: 'notifsid.attend_new',
}
},
],
},
{
@@ -1621,7 +1656,7 @@ export const shared_consts = {
{
value: 1, // ID_FRIENDS_NEW_REC
labeltrans: 'notifsid.friends_new',
}
},
],
},
{
@@ -1633,7 +1668,7 @@ export const shared_consts = {
{
value: 1, // ID_GROUP_NEW_REC
labeltrans: 'notifsid.groups_new',
}
},
],
},
{
@@ -1645,7 +1680,7 @@ export const shared_consts = {
{
value: 1, // ID_CIRCUIT_NEW_REC
labeltrans: 'notifsid.circuits_new',
}
},
],
},
{
@@ -1656,8 +1691,6 @@ export const shared_consts = {
},
],
UsersNotif_Adv_List: [
/*{
value: 1, // NEW_ADV_CITY
@@ -1743,27 +1776,27 @@ export const shared_consts = {
FontsInstalled: [
{
label: 'Arial',
value: 'font-Arial'
value: 'font-Arial',
},
{
label: 'Baskervville',
value: 'font-Baskervville'
value: 'font-Baskervville',
},
{
label: 'Montserrat',
value: 'font-Montserrat'
value: 'font-Montserrat',
},
{
label: 'Verdana',
value: 'font-Verdana'
value: 'font-Verdana',
},
{
label: 'Lato',
value: 'font-Lato'
value: 'font-Lato',
},
{
label: 'Source Sans Pro',
value: 'font-SourceSansPro'
value: 'font-SourceSansPro',
},
{
value: 80,
@@ -1832,6 +1865,10 @@ export const shared_consts = {
value: 450,
label: 'Raccolte Cataloghi',
},
{
value: 460,
label: 'Statistiche Pagine',
},
{
value: 430, // SEARCHPRODUCT
label: 'Cerca Prodotto',
@@ -1959,7 +1996,6 @@ export const shared_consts = {
value: 390,
label: 'EDIT ADDRESS BY COORD',
},
],
TypesElem: [
@@ -2001,7 +2037,7 @@ export const shared_consts = {
},
{
value: 110,
label: 'Galleria d\'Immagini',
label: "Galleria d'Immagini",
},
{
value: 6,
@@ -2012,55 +2048,55 @@ export const shared_consts = {
LISTBESTCOLORS: [
{
label: 'blue',
value: 'blue'
value: 'blue',
},
{
label: 'green',
value: 'green'
value: 'green',
},
{
label: 'purple',
value: 'purple'
value: 'purple',
},
{
label: 'deep-purple',
value: 'deep-purple'
value: 'deep-purple',
},
{
label: 'indigo',
value: 'indigo'
value: 'indigo',
},
{
label: 'light-blue',
value: 'light-blue'
value: 'light-blue',
},
{
label: 'cyan',
value: 'cyan'
value: 'cyan',
},
{
label: 'teal',
value: 'teal'
value: 'teal',
},
{
label: 'lime',
value: 'lime'
value: 'lime',
},
{
label: 'orange',
value: 'orange'
value: 'orange',
},
{
label: 'deeporange',
value: 'deeporange'
value: 'deeporange',
},
{
label: 'yellow',
value: 'yellow'
value: 'yellow',
},
{
label: 'white',
value: 'white'
value: 'white',
},
],
@@ -2089,43 +2125,59 @@ export const shared_consts = {
MAX_QTA_NON_IMPOSTATA: -1,
getStatusStr(status: number) {
const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status)
return (trovatorec) ? trovatorec.label : ''
const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status);
return trovatorec ? trovatorec.label : '';
},
getDirectoryImgByTable(table: string, username: string) {
let ris = ''
let ris = '';
if (this.TABLEFORUSERS.includes(table)) {
ris = 'profile/' + username + '/' + table + '/';
}
return ris;
},
getLabelByValueAndArr(value: number, array: any) {
const trovatorec = array.find((rec: any) => rec.value === value)
return (trovatorec) ? trovatorec.label : ''
const trovatorec = array.find((rec: any) => rec.value === value);
return trovatorec ? trovatorec.label : '';
},
fieldsUserToChange() {
return ['_id', 'username', 'group', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'notask_verif', 'verified_by_aportador', 'trust_modified', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
return [
'_id',
'username',
'group',
'email',
'name',
'surname',
'perm',
'date_reg',
'verified_email',
'notask_verif',
'verified_by_aportador',
'trust_modified',
'img',
'ipaddr',
'lasttimeonline',
'profile',
'news_on',
];
},
getProjectByTable(table: string, proj_add?: any) {
let proj = {}
let proj = {};
if (table === this.TABLES_MYGOODS) {
proj = {
'recGood': 1,
'sectorGood': 1,
'idSectorGood': 1,
'idGood': 1,
'idShipping': 1,
'idStatusGood': 1,
recGood: 1,
sectorGood: 1,
idSectorGood: 1,
idGood: 1,
idShipping: 1,
idStatusGood: 1,
groupname: 1,
//**ADDFIELD_MYGOOD
}
};
} else if (table === this.TABLES_MYGROUPS) {
proj = {
groupname: 1,
@@ -2146,7 +2198,7 @@ export const shared_consts = {
mycities: 1,
sector: 1,
recCatGrp: 1,
}
};
} else if (table === this.TABLES_CIRCUITS) {
proj = {
_id: 1,
@@ -2193,9 +2245,9 @@ export const shared_consts = {
admins: 1,
req_users: 1,
refused_users: 1,
'mycities': 1,
mycities: 1,
//**ADDFIELD_CIRCUITS
}
};
} else if (table === this.TABLES_MYSKILLS) {
proj = {
recSkill: 1,
@@ -2212,8 +2264,7 @@ export const shared_consts = {
website: 1,
groupname: 1,
//**ADDFIELD_MYSKILL
}
};
} else if (table === this.TABLES_MYHOSPS) {
proj = {
visibile: 1,
@@ -2229,8 +2280,7 @@ export const shared_consts = {
website: 1,
link_maplocation: 1,
groupname: 1,
}
};
} else if (table === this.TABLES_ATTIVITAS) {
proj = {
recSkill: 1,
@@ -2254,7 +2304,6 @@ export const shared_consts = {
createdBy: 1,
//**ADDFIELD_ATTIVITA
};
} else if (table === this.TABLES_MYBACHECAS) {
proj = {
recSkill: 1,
@@ -2278,25 +2327,23 @@ export const shared_consts = {
link_maplocation: 1,
groupname: 1,
//**ADDFIELD_MYBACHECAS
}
};
}
const proj_common = {
'mygrp.groupname': 1,
'mygrp.title': 1,
'mygrp.photos': 1,
}
};
proj = Object.assign({}, proj, proj_common);
if (proj_add)
proj = Object.assign({}, proj, proj_add);
if (proj_add) proj = Object.assign({}, proj, proj_add);
return proj;
},
getProjectForAll(proj_add: any, table?: string) {
let proj = {
idContribType: 1,
idCity: 1,
@@ -2341,8 +2388,7 @@ export const shared_consts = {
perm: 1,
};
if (proj_add)
proj = Object.assign({}, proj, proj_add);
if (proj_add) proj = Object.assign({}, proj, proj_add);
proj = { ...proj, ...this.REACTIONS_FIELD };
proj = { ...proj, ...this.ANNUNCI_FIELDS };
@@ -2356,28 +2402,26 @@ export const shared_consts = {
},
getDirectoryByTable(table: string, barre?: boolean) {
let add = '';
if (barre)
add = '/';
if (barre) add = '/';
if (table === 'myskills') {
return add + 'myservice' + add
return add + 'myservice' + add;
} else if (table === 'mybachecas') {
return add + 'mypage' + add
return add + 'mypage' + add;
} else if (table === 'myhosps') {
return add + 'myhosps' + add
return add + 'myhosps' + add;
} else if (table === 'mygoods') {
return add + 'mygood' + add
return add + 'mygood' + add;
} else if (table === 'mygroups') {
return add + 'grp' + add
return add + 'grp' + add;
} else if (table === 'circuits') {
return add + 'circuit' + add
return add + 'circuit' + add;
} else if (table === 'catalogs') {
return add + 'catalogs' + add
return add + 'catalogs' + add;
}
return ''
return '';
},
STATUSSKILL_DI_PERSONA: 1,
@@ -2437,7 +2481,6 @@ export const shared_consts = {
{ label: 'Discendente', value: -1 },
],
VERSIONI_PRODOTTO: [
{
label: '[Nessuno]',
@@ -2484,7 +2527,6 @@ export const shared_consts = {
value: 108,
color: 'red',
},
],
AccountType: {
@@ -2518,10 +2560,10 @@ export const shared_consts = {
},
DESTNEWSLETTER_ARRAY: [
{value: 0, label: 'LISTA_NEWSLETTER'},
{value: 1, label: 'UTENTI'},
{value: 2, label: 'DIARIO'},
{value: 10, label: 'TEST'},
{ value: 0, label: 'LISTA_NEWSLETTER' },
{ value: 1, label: 'UTENTI' },
{ value: 2, label: 'DIARIO' },
{ value: 10, label: 'TEST' },
],
WHERE_INSERT: {
@@ -2538,6 +2580,5 @@ export const shared_consts = {
SCONTI_APPLICA: {
NESSUNO: 0,
A_TUTTI: 1,
}
}
},
};

View File

@@ -21,6 +21,7 @@ import { CMyActivities } from '@src/components/CMyActivities'
import { CECommerce } from '@src/components/CECommerce'
import { CStatMacro } from '@src/components/CStatMacro'
import { CSearchProduct } from '@src/components/CSearchProduct'
import { CPageViewStats } from '@src/components/CPageViewStats'
import { CQRCode } from '@src/components/CQRCode'
import { CAITools } from '@src/components/CAITools'
import { CCatalogo } from '@src/components/CCatalogo'
@@ -78,7 +79,7 @@ export default defineComponent({
CVisuVideoPromoAndPDF, CECommerce, CCatalogo, CRaccolta, CAITools, CStatMacro,
CMapComuni, CMapUsers, CMapGetCoordinates, CMapEditAddressByCoord,
CDashGroup, CMovements, CGridOriz, CQRCode, CCatalogList,
CSearchProduct, CRaccoltaCataloghi,
CSearchProduct, CRaccoltaCataloghi, CPageViewStats,
// , //CMapMarker,
},
emits: ['selElemClick'],

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,120 @@
import { defineComponent, ref, onMounted } from 'vue';
import { tools } from '@tools';
import { Api } from 'app/src/store/Api';
interface WeeklyStat {
year: number;
week: number;
topPages: Array<{ url: string; count: number }>;
}
export default defineComponent({
name: 'CPageViewStats',
props: {},
emits: [],
setup() {
// Stati
const stats = ref({
total: 0,
today: 0,
week: 0,
month: 0,
topPages: [],
});
const selectedYear = ref(new Date().getFullYear());
const selectedWeek = ref(1);
const weeklyStats = ref([]);
const years = Array.from({ length: 3 }, (_, i) => new Date().getFullYear() - i);
const weeks = Array.from({ length: 52 }, (_, i) => i + 1);
const columns = [
{
name: 'url',
label: 'Pagina',
field: (row) => row.url,
format: (val) => val.replace(/^https?:\/\/[^/]+/, ''),
align: 'left',
},
{
name: 'count',
label: 'Visite',
field: 'count',
align: 'right',
},
];
const users = ref([]);
const selectedUser = ref<{ label: string; value: string } | null>(null);
const uniqueMode = ref(false);
const userOptions = ref<{ label: string; value: string }[]>([]);
async function loadStats() {
try {
const params = {} as any;
if (selectedUser.value?.value) {
params.userId = selectedUser.value.value;
}
if (uniqueMode.value) {
params.unique = true;
}
params.year = selectedYear.value;
params.week = selectedWeek.value;
// Carica statistiche generali
const statsRes = await Api.SendReq('/api/pageviews/stats', 'GET', params);
stats.value = statsRes.data;
// Carica statistiche settimanali
const weeklyRes = await Api.SendReq(
'/api/pageviews/weekly-top-pages',
'GET',
params
);
weeklyStats.value = weeklyRes.data;
// Se non ci sono utenti ancora caricati
if (users.value.length === 0) {
const usersRes = await Api.SendReq('/api/pageviews/users', 'GET', null);
users.value = usersRes.data;
const uniqueUsernamesOrIds = [
...new Set(
users.value.map((u: any) => u.username || u.userId).filter(Boolean)
),
];
userOptions.value = [
{ label: 'Tutti gli utenti', value: '' },
...uniqueUsernamesOrIds.map((name) => ({ label: name, value: name })),
];
}
} catch (error) {
console.error('Errore nel caricamento delle statistiche:', error);
}
}
onMounted(() => {
selectedWeek.value = tools.getWeekOfYear(new Date());
loadStats();
});
return {
stats,
weeklyStats,
users,
selectedUser,
userOptions,
loadStats,
tools,
uniqueMode,
columns,
years,
weeks,
selectedYear,
selectedWeek,
};
},
});

View File

@@ -0,0 +1,153 @@
<template>
<q-page
class="q-pa-md"
v-if="stats"
>
<div class="row q-mb-md">
<div class="col">
<h5>Statistiche Visite</h5>
</div>
<div class="row q-mb-md items-center">
<q-toggle
v-model="uniqueMode"
label="Mostra solo pagine uniche per utente"
@update:model-value="loadStats"
/>
</div>
<div class="col-auto">
<q-select
v-model="selectedUser"
:options="userOptions"
label="Filtra per utente"
dense
outlined
style="min-width: 200px"
@update:model-value="loadStats"
/>
</div>
</div>
<div class="row q-col-gutter-md">
<div class="col-xs-12 col-sm-6 col-md-4">
<q-card>
<q-card-section>
<div class="text-h6">Totale Pagine Visitate</div>
<div class="text-h4">{{ stats?.total }}</div>
</q-card-section>
</q-card>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<q-card>
<q-card-section>
<div class="text-h6">Pagine Oggi</div>
<div class="text-h4">{{ stats.today }}</div>
</q-card-section>
</q-card>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<q-card>
<q-card-section>
<div class="text-h6">Pagine Questa Settimana</div>
<div class="text-h4">{{ stats.week }}</div>
</q-card-section>
</q-card>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<q-card>
<q-card-section>
<div class="text-h6">Pagine Questo Mese</div>
<div class="text-h4">{{ stats.month }}</div>
</q-card-section>
</q-card>
</div>
</div>
<div class="q-mt-md">
<h6>Pagine più visitate</h6>
<q-list
bordered
separator
>
<q-item
v-for="(page, index) in stats.topPages"
:key="index"
>
<q-item-section>{{ tools.escludiUrlDominio(page._id) }}</q-item-section>
<q-item-section side>{{ page.count }} visite</q-item-section>
</q-item>
</q-list>
</div>
<div class="q-mt-md">
<h6>Top Pagine per Settimana</h6>
<div class="row q-col-gutter-md">
<div class="col-6">
<q-select
v-model="selectedYear"
:options="years"
label="Anno"
style="max-width: 300px"
outlined
@update:model-value="loadStats"
/>
</div>
<div class="col-6">
<q-select
v-model="selectedWeek"
:options="
weeks.map((w) => {
const date = new Date(Date.UTC(selectedYear, 0, 4 + (w - 1) * 7));
const start = new Date(Date.UTC(selectedYear, 0, 1 + (w - 1) * 7));
const end = new Date(Date.UTC(selectedYear, 0, 7 + (w - 1) * 7));
return {
label: `dal ${start.toLocaleString('it-IT', { day: '2-digit', month: 'long' })} al ${end.toLocaleString('it-IT', { day: '2-digit', month: 'long' })}`,
value: w,
};
})
"
label="Settimana"
outlined
emit-value
map-options
@update:model-value="loadStats"
/>
<div class="col-auto">
<q-btn
:disable="selectedWeek === 1"
icon="chevron_left"
flat
round
dense
@click="selectedWeek--; loadStats()"
/>
<q-btn
:disable="selectedWeek === weeks.length"
icon="chevron_right"
flat
round
dense
@click="selectedWeek++; loadStats()"
/>
</div>
</div>
</div>
<q-table
class="q-mt-md q-pa-sm"
:rows="weeklyStats"
:columns="columns"
row-key="url"
flat
bordered
/>
</div>
</q-page>
</template>
<script lang="ts" src="./CPageViewStats.ts"></script>
<style lang="scss" scoped>
@import './CPageViewStats.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CPageViewStats} from './CPageViewStats.vue'

View File

@@ -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',
@@ -84,14 +75,12 @@ const msg_website_it = {
eventodef: 'Evento:',
prova: 'prova',
dbop: 'Operazioni',
dbopmacro: 'Operazioni Macro',
projall: 'Comunitari',
groups: 'Lista Gruppi',
projectsShared: 'Condivisi da me',
myprojects: 'Privati',
favproj: 'Favoriti',
admin_ecommerce: 'ECommerce',
ecommerce: 'Prodotti',
ecommerce_menu: 'ECommerce1',
hours: 'Ore',
department: 'Uffici',
title: 'Titolo',
@@ -120,16 +109,11 @@ const msg_website_it = {
onlyif_logged: 'Solo se Loggati',
only_residenti: 'Solo Residenti',
only_consiglio: 'Solo Consiglieri',
only_collab: 'Solo Collaboratori',
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: '',

View File

@@ -1,6 +1,6 @@
/* RISO APP
/* GRUPPOMACRO APP
*/
import type {
import {
IListRoutes,
ILang,
IPreloadImages,
@@ -44,6 +44,7 @@ const firstPage = {
infooter: true,
}
function getDynamicPages(site: ISites): IListRoutes[] {
const baseroutes: IListRoutes[] = [
@@ -70,34 +71,11 @@ function getDynamicPages(site: ISites): IListRoutes[] {
},
{
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 },
order: 400,
path: '/test-lungo',
materialIcon: 'fas fa-test',
name: 'mypages.test_lungo',
component: () => import('@src/views/testLungo/testLungo.vue'),
inmenu: false,
infooter: false,
},
@@ -112,17 +90,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 +102,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 +124,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 +135,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 +146,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 +241,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 +259,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
export function firstimagehome() {
const img = 'statics/images/background.jpg'
let img = 'statics/images/background.jpg'
return img
}

View File

@@ -11138,6 +11138,19 @@ export const tools = {
}
},
escludiUrlDominio(url: string) {
const urlObj = new URL(url);
// da 'https://miodominio.com/...' diventa '/...'
return urlObj.pathname;
},
getWeekOfYear(data: Date) {
const startOfYear = new Date(data.getFullYear(), 0, 1);
const pastDaysOfYear = (data.getTime() - startOfYear.getTime()) / 86400000;
return Math.ceil((pastDaysOfYear + startOfYear.getDay() + 1) / 7);
},
// FINE !
// getLocale() {

View File

@@ -1056,6 +1056,8 @@ export const useUserStore = defineStore('UserStore', {
});
},
async addNewSite(paramquery: any) {
console.log(paramquery);