Cataloghi...

This commit is contained in:
Surya Paolo
2025-02-05 12:13:36 +01:00
parent 979f90f980
commit 2533da3692
20 changed files with 171 additions and 105 deletions

View File

@@ -7506,9 +7506,9 @@ export const tools = {
// console.log('arrimage', arrimage)
if (shared_consts.TABLES_DIRECTORY_A_PARTE.includes(table)) {
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0].imagefile
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0]?.imagefile
} else if (shared_consts.TABLES_DIRECTORY_SINGLE_IMG.includes(table)) {
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0].imagefile
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0]?.imagefile
} else {
// console.log('username', username, 'table', table)
if (arrimage && arrimage.length > 0) {
@@ -7540,7 +7540,7 @@ export const tools = {
return true
}
}
if (shared_consts.TABLES_WITH_ADMINS.includes(tablesel)) {
if (userStore.isAdmin)
return true
@@ -9317,6 +9317,21 @@ export const tools = {
return rec ? rec.strsingolo : ''
},
getMainUrl(fullUrl: string) {
try {
// Crea un oggetto URL dall'input
const url = new URL(fullUrl);
// Estrai il protocollo (http o https) e l'host (dominio)
const mainUrl = `${url.host}`;
return mainUrl;
} catch (error) {
console.error("URL non valido:", error);
return null;
}
},
getGradientByColors(col1: string, col2: string, col3: string): string {
let mystr = ''
if (col1) {