- piuchebuono: possiblità di modificare l'immagine dalla scheda direttamente
- migliorata di poco la grafica dell'immagine.
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
DATABASE=test_PiuCheBuono
|
DATABASE=test_FreePlanet
|
||||||
UDB=paofreeplanet
|
UDB=paofreeplanet
|
||||||
PDB=mypassword@1A
|
PDB=mypassword@1A
|
||||||
SEND_EMAIL=0
|
SEND_EMAIL=0
|
||||||
SEND_EMAIL_ORDERS=1
|
SEND_EMAIL_ORDERS=1
|
||||||
PORT=3000
|
PORT=3000
|
||||||
appTelegram_TEST=["1","17","18"]
|
appTelegram_TEST=["1","13"]
|
||||||
appTelegram=["1","17","18"]
|
appTelegram=["1","13"]
|
||||||
appTelegram_DEVELOP=["17"]
|
appTelegram_DEVELOP=["13"]
|
||||||
DOMAIN=mongodb://localhost:27017/
|
DOMAIN=mongodb://localhost:27017/
|
||||||
AUTH_MONGODB=1
|
AUTH_MONGODB=1
|
||||||
MONGODB_USER=admin
|
MONGODB_USER=admin
|
||||||
@@ -42,6 +42,3 @@ FTPSERVER_PWD=ftpmypwd@1A_
|
|||||||
AUTH_NEW_SITES=123123123
|
AUTH_NEW_SITES=123123123
|
||||||
SCRIPTS_DIR=admin_scripts
|
SCRIPTS_DIR=admin_scripts
|
||||||
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
|
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
|
||||||
MIAB_HOST=box.lamiaposta.org
|
|
||||||
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
|
|
||||||
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
|
|
||||||
BIN
public/upload/products/LQ_Letsee_100x1120jpeg.jpg
Normal file
BIN
public/upload/products/LQ_Letsee_100x1120jpeg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 629 KiB |
@@ -230,7 +230,7 @@ module.exports.getProductByCode = function (idapp, code) {
|
|||||||
module.exports.replaceProductImgToImageFile = async function () {
|
module.exports.replaceProductImgToImageFile = async function () {
|
||||||
const ProductInfo = this;
|
const ProductInfo = this;
|
||||||
|
|
||||||
let abilitaserver = false;
|
let abilitaserver = true;
|
||||||
|
|
||||||
if (abilitaserver) {
|
if (abilitaserver) {
|
||||||
// const result = await ProductInfo.updateMany({ "img": { $exists: true } }, { $rename: { 'img': 'imagefile' } });
|
// const result = await ProductInfo.updateMany({ "img": { $exists: true } }, { $rename: { 'img': 'imagefile' } });
|
||||||
@@ -240,9 +240,9 @@ module.exports.replaceProductImgToImageFile = async function () {
|
|||||||
|
|
||||||
// Aggiorna ciascun documento
|
// Aggiorna ciascun documento
|
||||||
for (let doc of documents) {
|
for (let doc of documents) {
|
||||||
if (doc.img && doc.img.startsWith('/upload/products/')) {
|
if (doc.img && doc.img.startsWith('upload/products/')) {
|
||||||
// Rimuovi il prefisso '/upload/products' dal campo `img`
|
// Rimuovi il prefisso '/upload/products' dal campo `img`
|
||||||
doc.imagefile = doc.img.replace(/^\/upload\/products\//, '');
|
doc.imagefile = doc.img.replace(/^\upload\/products\//, '');
|
||||||
doc.img = undefined; // Può anche rimuovere il campo img corrente se desiderato
|
doc.img = undefined; // Può anche rimuovere il campo img corrente se desiderato
|
||||||
await doc.save(); // Salva il documento aggiornato
|
await doc.save(); // Salva il documento aggiornato
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1919,8 +1919,15 @@ function uploadFile(req, res, version) {
|
|||||||
let mydircurrent = process.cwd() + '/src/server/router/upload/' + dir;
|
let mydircurrent = process.cwd() + '/src/server/router/upload/' + dir;
|
||||||
fromfile = mydircurrent + '/' + oldpath;
|
fromfile = mydircurrent + '/' + oldpath;
|
||||||
tofile = mydir + '/' + file.originalFilename;
|
tofile = mydir + '/' + file.originalFilename;
|
||||||
|
|
||||||
|
// ------------
|
||||||
|
// ++TODO: Questo non funziona perché dovrei passargli il nomefile aggiornato a Vue.js
|
||||||
|
// tofile = tools.cleanFileName(tofile)
|
||||||
|
// ------------
|
||||||
|
|
||||||
let newname = tofile;
|
let newname = tofile;
|
||||||
file.path = newname;
|
file.path = newname;
|
||||||
|
|
||||||
console.log('fromfile', fromfile, 'tofile', tofile)
|
console.log('fromfile', fromfile, 'tofile', tofile)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,12 @@ myLoad().then(ris => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Serve il tuo service worker da una certa directory
|
||||||
|
/*app.get('/service-worker.js', (req, res) => {
|
||||||
|
res.set('Cache-Control', 'no-cache'); // Aggiunge l'intestazione
|
||||||
|
// res.sendFile(path.join(__dirname, 'service-worker.js')); // Modifica il percorso secondo la tua struttura
|
||||||
|
});*/
|
||||||
|
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
exposedHeaders: ['x-auth', 'x-refrtok'],
|
exposedHeaders: ['x-auth', 'x-refrtok'],
|
||||||
}));
|
}));
|
||||||
@@ -806,6 +812,54 @@ function startServer(app, port) {
|
|||||||
|
|
||||||
console.log('isProduction', isProduction);
|
console.log('isProduction', isProduction);
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
const CORS_ENABLE_FOR_ALL_SITES = true;
|
||||||
|
|
||||||
|
let corsOptions = {};
|
||||||
|
|
||||||
|
if (CORS_ENABLE_FOR_ALL_SITES) {
|
||||||
|
corsOptions = {
|
||||||
|
exposedHeaders: ['x-auth', 'x-refrtok'], // Intestazioni da esporre al client
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
let myhosts = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < domains.length; i++) {
|
||||||
|
myhosts.push('https://' + domains[i].hostname);
|
||||||
|
myhosts.push('https://' + 'api.' + domains[i].hostname);
|
||||||
|
myhosts.push('https://' + 'test.' + domains[i].hostname);
|
||||||
|
myhosts.push('https://' + 'testapi.' + domains[i].hostname);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('myhosts', myhosts);
|
||||||
|
|
||||||
|
console.log('CORS');
|
||||||
|
|
||||||
|
corsOptions = {
|
||||||
|
origin: (origin, callback) => {
|
||||||
|
if (myhosts.indexOf(origin) !== -1 || !origin) {
|
||||||
|
callback(null, true);
|
||||||
|
} else {
|
||||||
|
callback(new Error('Not allowed by CORS'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
||||||
|
allowedHeaders: ['Content-Type', 'Authorization', 'x-auth', 'x-refrtok'], // Intestazioni consentite
|
||||||
|
exposedHeaders: ['x-auth', 'x-refrtok'], // Intestazioni da esporre al client
|
||||||
|
credentials: true, // Consenti l'invio di cookie
|
||||||
|
preflightContinue: false,
|
||||||
|
optionsSuccessStatus: 204,
|
||||||
|
};
|
||||||
|
|
||||||
|
app.use(cors(corsOptions));
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isProduction) {
|
if (isProduction) {
|
||||||
for (let i = 0; i < domains.length; i++) {
|
for (let i = 0; i < domains.length; i++) {
|
||||||
const credentials = getCredentials(domains[i].hostname);
|
const credentials = getCredentials(domains[i].hostname);
|
||||||
|
|||||||
@@ -5646,7 +5646,7 @@ module.exports = {
|
|||||||
|
|
||||||
// mystr = t('movement.from') + userfrom + ' ' + t('movement.to') + userto
|
// mystr = t('movement.from') + userfrom + ' ' + t('movement.to') + userto
|
||||||
|
|
||||||
return { userfrom: {profile: profilefrom, username: userfrom}, userto: {profile: profileto, username: userto}, tipocontofrom, tipocontoto }
|
return { userfrom: { profile: profilefrom, username: userfrom }, userto: { profile: profileto, username: userto }, tipocontofrom, tipocontoto }
|
||||||
},
|
},
|
||||||
|
|
||||||
ImageDownloader,
|
ImageDownloader,
|
||||||
@@ -5707,4 +5707,16 @@ module.exports = {
|
|||||||
return annunciFields;
|
return annunciFields;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Funzione per pulire il nome del file
|
||||||
|
cleanFileName(filePath) {
|
||||||
|
// Ottieni solo il nome del file dall'intero percorso
|
||||||
|
// const fileName = filePath.split('/').pop();
|
||||||
|
|
||||||
|
// Rimuovi apostrofi e sostituisci gli spazi con underscore
|
||||||
|
const cleanedName = fileName.replace(/'/g, '').replace(/\s+/g, '_');
|
||||||
|
|
||||||
|
// Restituisci il percorso chiaro; puoi decidere di mantenere il resto del percorso
|
||||||
|
return cleanedName;
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.1.0
|
1.1.3
|
||||||
Reference in New Issue
Block a user