- Gruppi si chiamano ora "Organizzazioni".
- Categorie dei Gruppi aggiornate. - Email ora compare sul profilo se non hai telegram e anche sugli annunci.
This commit is contained in:
@@ -127,5 +127,6 @@
|
||||
"🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.": "🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.",
|
||||
"🚫 %s ha rifiutato l'accesso alla App a %s !": "🚫 %s ha rifiutato l'accesso alla App a %s !",
|
||||
"✅ Hai Ammesso l'accesso alla App a %s !": "✅ Hai Ammesso l'accesso alla App a %s !",
|
||||
"Good: %": "Good: %"
|
||||
"Good: %": "Good: %",
|
||||
"Service: %": "Service: %"
|
||||
}
|
||||
@@ -34,9 +34,9 @@ const MyGroupSchema = new Schema({
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
idCatGrp: {
|
||||
idCatGrp: [{
|
||||
type: Number,
|
||||
},
|
||||
}],
|
||||
userId: {
|
||||
type: String,
|
||||
},
|
||||
@@ -348,6 +348,17 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
|
||||
},
|
||||
},
|
||||
{ $project: whatToShow },
|
||||
{
|
||||
$lookup: {
|
||||
from: 'catgrps',
|
||||
localField: 'idCatGrp',
|
||||
foreignField: '_id',
|
||||
as: 'recCatGrp',
|
||||
},
|
||||
},
|
||||
{
|
||||
$project: shared_consts.getProjectByTable(shared_consts.TABLES_MYGROUPS, {}),
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -2,79 +2,105 @@ module.exports = {
|
||||
list: [
|
||||
{
|
||||
_id: 1,
|
||||
descr: 'Abitare',
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
descr: 'Arte',
|
||||
descr: 'Ospitalità ed accoglienza',
|
||||
color: '#00BCD4',
|
||||
icon: 'fa fa-bed'
|
||||
},
|
||||
{
|
||||
_id: 3,
|
||||
descr: 'Alimentazione',
|
||||
descr: 'Prodotti Alimentari',
|
||||
color: '#4CAF50',
|
||||
icon: 'fa fa-apple-alt'
|
||||
},
|
||||
{
|
||||
_id: 4,
|
||||
descr: 'Artigianato',
|
||||
descr: 'Prodotti Artigianali e Artistici',
|
||||
color: '#9C27B0',
|
||||
icon: 'fa fa-paint-brush'
|
||||
},
|
||||
{
|
||||
_id: 5,
|
||||
descr: 'Assistenza Legale',
|
||||
},
|
||||
{
|
||||
_id: 6,
|
||||
descr: 'Benessere',
|
||||
},
|
||||
{
|
||||
_id: 7,
|
||||
descr: 'Gruppi Locali',
|
||||
descr: 'Servizi di Assistenza e Integrazione',
|
||||
color: '#2196F3',
|
||||
icon: 'fa fa-hands-helping'
|
||||
},
|
||||
{
|
||||
_id: 8,
|
||||
descr: 'Istruzione',
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
descr: 'Arte',
|
||||
},
|
||||
{
|
||||
_id: 9,
|
||||
descr: 'Mobilità',
|
||||
},
|
||||
{
|
||||
_id: 10,
|
||||
descr: 'Sport',
|
||||
},
|
||||
{
|
||||
_id: 11,
|
||||
descr: 'Servizi',
|
||||
descr: 'Servizi Formativi ed Educativi',
|
||||
color: '#FFC107',
|
||||
icon: 'fa fa-book'
|
||||
},
|
||||
{
|
||||
_id: 12,
|
||||
descr: 'Tecnologia',
|
||||
},
|
||||
{
|
||||
_id: 13,
|
||||
descr: 'Turismo',
|
||||
color: '#607D8B',
|
||||
icon: 'fa fa-laptop'
|
||||
},
|
||||
{
|
||||
_id: 14,
|
||||
descr: 'Ecovillaggi / Comunità',
|
||||
},
|
||||
{
|
||||
_id: 15,
|
||||
descr: 'Feste',
|
||||
},
|
||||
{
|
||||
_id: 16,
|
||||
descr: 'Altro',
|
||||
},
|
||||
{
|
||||
_id: 17,
|
||||
descr: 'AutoProduzione',
|
||||
descr: 'Comunità ed Ecovillaggi',
|
||||
color: '#8BC34A',
|
||||
icon: 'fa fa-users'
|
||||
},
|
||||
{
|
||||
_id: 18,
|
||||
descr: 'Salute',
|
||||
descr: 'Salute e Benessere',
|
||||
color: '#E91E63',
|
||||
icon: 'fa fa-heart'
|
||||
},
|
||||
{
|
||||
_id: 20,
|
||||
descr: 'Progetti Umanitari (Volontari)',
|
||||
color: '#F44336',
|
||||
icon: 'fa fa-hands'
|
||||
},
|
||||
{
|
||||
_id: 31,
|
||||
descr: 'Servizi per l\'Agricoltura, orto',
|
||||
color: '#009688',
|
||||
icon: 'fa fa-leaf'
|
||||
},
|
||||
{
|
||||
_id: 32,
|
||||
descr: 'Servizi di Distribuzione e Logistica',
|
||||
color: '#3F51B5',
|
||||
icon: 'fa fa-truck'
|
||||
},
|
||||
{
|
||||
_id: 33,
|
||||
descr: 'Servizi di Consulenza',
|
||||
color: '#CDDC39',
|
||||
icon: 'fa fa-briefcase'
|
||||
},
|
||||
{
|
||||
_id: 34,
|
||||
descr: 'Attività Ricreative e di Intrattenim.',
|
||||
color: '#FF5722',
|
||||
icon: 'fa fa-music'
|
||||
},
|
||||
{
|
||||
_id: 36,
|
||||
descr: 'Manutenzione e riparazioni',
|
||||
color: '#673AB7',
|
||||
icon: 'fa fa-wrench'
|
||||
},
|
||||
{
|
||||
_id: 37,
|
||||
descr: 'Cura della persona',
|
||||
color: '#FFEB3B',
|
||||
icon: 'fa fa-user'
|
||||
},
|
||||
{
|
||||
_id: 40,
|
||||
descr: 'Energia',
|
||||
color: '#03A9F4',
|
||||
icon: 'fa fa-bolt'
|
||||
},
|
||||
{
|
||||
_id: 41,
|
||||
descr: 'Servizi e prodotti per la casa',
|
||||
color: '#FF9800',
|
||||
icon: 'fa fa-home'
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -17,7 +17,7 @@ module.exports = {
|
||||
const mydbfile = require(pathfile);
|
||||
|
||||
if (mydbfile && mydbfile.list) {
|
||||
return table.insertMany(mydbfile.list, {ordered: false}).
|
||||
return table.insertMany(mydbfile.list, { ordered: false }).
|
||||
then((ris) => {
|
||||
console.log('Populate table ', tablename);
|
||||
return !!ris;
|
||||
@@ -31,52 +31,62 @@ module.exports = {
|
||||
},
|
||||
|
||||
async insertIntoDb_NoDuplicate(attiva, tablename, table, field) {
|
||||
|
||||
let numrec = 0;
|
||||
let numupdated = 0;
|
||||
try {
|
||||
|
||||
if (!attiva && await table.countDocuments({}) > 0)
|
||||
return;
|
||||
if (!attiva && await table.countDocuments({}) > 0) return;
|
||||
|
||||
const pathfile = Path.join(__dirname, tablename + '.js');
|
||||
if (tools.isFileExists(pathfile)) {
|
||||
|
||||
const mydbfile = require(pathfile);
|
||||
|
||||
if (mydbfile && mydbfile.list) {
|
||||
for (const rec of mydbfile.list) {
|
||||
let obj = {};
|
||||
obj[field] = rec[field];
|
||||
let query = {};
|
||||
query[field] = rec[field];
|
||||
|
||||
var mynewrec = new table(rec);
|
||||
if (rec.hasOwnProperty('_id')) {
|
||||
query._id = rec._id;
|
||||
}
|
||||
|
||||
if (rec.hasOwnProperty('idapp')) {
|
||||
obj.idapop = rec['idapp'];
|
||||
query.idapp = rec.idapp;
|
||||
}
|
||||
|
||||
const exist = await table.find(obj);
|
||||
if (exist.length <= 0) {
|
||||
try {
|
||||
const ris = await mynewrec.save();
|
||||
if (ris) {
|
||||
const existingDoc = await table.findOne(query);
|
||||
if (!existingDoc) {
|
||||
|
||||
const { value: existingDoc, upserted } = await table.findOneAndUpdate(
|
||||
query,
|
||||
{ $set: rec },
|
||||
{ upsert: true, new: true }
|
||||
);
|
||||
|
||||
if (upserted) {
|
||||
// Il documento non esisteva, è stato creato
|
||||
console.log('Inserted document with _id:', existingDoc._id);
|
||||
numrec++;
|
||||
}
|
||||
|
||||
} else {
|
||||
// Il documento esiste, lo aggiorniamo
|
||||
await table.updateOne({ _id: existingDoc._id }, { $set: rec });
|
||||
numupdated++;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('error ', e);
|
||||
}
|
||||
|
||||
console.log('Error processing record:', e);
|
||||
}
|
||||
}
|
||||
|
||||
if (numrec > 0)
|
||||
console.log('*** Insert', numrec, 'record on ' + tablename);
|
||||
|
||||
if (numrec > 0 || numupdated > 0) {
|
||||
console.log(`*** Inserted ${numrec} and updated ${numupdated} records in ${tablename}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('error insertIntoDb', e);
|
||||
console.log('Error in insertIntoDb_NoDuplicate:', e);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
async rewriteTable(table) {
|
||||
@@ -85,15 +95,15 @@ module.exports = {
|
||||
let field = '';
|
||||
|
||||
try {
|
||||
const {City} = require('../models/city');
|
||||
const {Province} = require('../models/province');
|
||||
const {Sector} = require('../models/sector');
|
||||
const {SectorGood} = require('../models/sectorgood');
|
||||
const {Skill} = require('../models/skill');
|
||||
const {Good} = require('../models/good');
|
||||
const { City } = require('../models/city');
|
||||
const { Province } = require('../models/province');
|
||||
const { Sector } = require('../models/sector');
|
||||
const { SectorGood } = require('../models/sectorgood');
|
||||
const { Skill } = require('../models/skill');
|
||||
const { Good } = require('../models/good');
|
||||
// const {SubSkill} = require('../models/subskill');
|
||||
const {Contribtype} = require('../models/contribtype');
|
||||
const {Level} = require('../models/level');
|
||||
const { Contribtype } = require('../models/contribtype');
|
||||
const { Level } = require('../models/level');
|
||||
|
||||
if (table === 'cities') {
|
||||
mytab = City;
|
||||
@@ -131,7 +141,7 @@ module.exports = {
|
||||
// await mytab.remove({});
|
||||
|
||||
this.insertIntoDb_NoDuplicate(false, table, mytab, field);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
||||
@@ -19,7 +19,8 @@ module.exports = {
|
||||
{_id: 17, descr: 'Attrezzature', icon: 'fas fa-tools', color: 'blue-7'},
|
||||
{_id: 18, descr: 'Animali', icon: 'fas fa-paw', color: 'green-7'},
|
||||
{_id: 19, descr: 'Arte / Decorazioni', icon: 'fas fa-palette', color: 'purple-7'},
|
||||
{_id: 20, descr: 'Agricoltura', icon: 'fa-seedling', color: 'green-7'},
|
||||
{_id: 20, descr: 'Agricoltura', icon: 'fas fa-seedling', color: 'green-7'},
|
||||
{_id: 21, descr: 'Elettrodomestici', icon: 'fas fa-blender', color: 'green-7'},
|
||||
|
||||
],
|
||||
};
|
||||
|
||||
@@ -28,6 +28,11 @@ async function getCircuitRecAdminsInfo(idapp, data) {
|
||||
if (myuser && myuser.profile)
|
||||
admin.profile = { img: myuser.profile.img };
|
||||
}
|
||||
|
||||
if (data.admins.length === 0) {
|
||||
data.admins.push({username: shared_consts.USER_ADMIN_CIRCUITS})
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
@@ -44,7 +44,8 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
|
||||
|
||||
const whatshow = MyGroup.getWhatToShow(idapp, req.user.username);
|
||||
let data = await MyGroup.findOne({ idapp, groupname }, whatshow).lean();
|
||||
// let data = await MyGroup.findOne({ idapp, groupname }, whatshow).lean();
|
||||
let data = await MyGroup.getInfoGroupByGroupname(idapp, groupname);
|
||||
|
||||
/*
|
||||
if (data.mycircuits) {
|
||||
@@ -55,6 +56,7 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (data.mycircuits) {
|
||||
for (let i = 0; i < data.mycircuits.length; i++) {
|
||||
const mycirc = await Circuit.findOne({ idapp, name: data.mycircuits[i].circuitname }).lean();
|
||||
|
||||
@@ -503,7 +503,7 @@ const txt = {
|
||||
MSG_EXIT_TELEGRAM: 'L\'account è stato ora scollegato da questo Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
' Si è appena Registrato "%s" (n. %s)\nInvitato da %s',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando alla App %d e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_FRIENDS_NOT_ACCEPTED_CONFIRMED: '🚫 Hai rifiutato la richiesta di Amicizia di %s !',
|
||||
MSG_HANDSHAKE_NOT_ACCEPTED_CONFIRMED: '🚫 Hai rifiutato la richiesta di Stretta di mano di %s !',
|
||||
@@ -552,7 +552,7 @@ const txt_es = {
|
||||
MSG_EXIT_TELEGRAM: 'La cuenta ha sido desconectada de Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
' Acaba de registrarse "%s (n. %s)"\n(Invitado de %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s Abilita Nuova Registrazione:',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
|
||||
@@ -585,7 +585,7 @@ const txt_fr = {
|
||||
MSG_EXIT_TELEGRAM: 'L\'account a été déconnecté de Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
' Vous venez à peine de vous inscrire "%s (n. %s) %s',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s Abilita Nuova Registrazione:',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
|
||||
@@ -616,7 +616,7 @@ const txt_si = {
|
||||
MSG_EXIT_TELEGRAM: 'Račun se nahaja v programu Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
'Registracija registracije %s (n. %s)\n(povabil ga %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s Abilita Nuova Registrazione:',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
|
||||
@@ -646,7 +646,7 @@ const txt_en = {
|
||||
MSG_EXIT_TELEGRAM: 'The account has now been disconnected from this Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
' He/She\'s just registered "%s (n. %s)"\n(Invited from %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s Abilita Nuova Registrazione:',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
|
||||
@@ -679,7 +679,7 @@ const txt_pt = {
|
||||
MSG_EXIT_TELEGRAM: 'A conta foi agora desconectada deste Telegrama BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE +
|
||||
' Acabou de se registar "%s (n. %s)"\n(Convidado por %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s Abilita Nuova Registrazione:',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ %s si sta registrando su %s e ti chiede di poter entrare. Confermi di conoscerla ?',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Ammesso correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Ammesso correttamente da %s!',
|
||||
@@ -939,7 +939,7 @@ const MyTelegramBot = {
|
||||
await setVerifiedReg(myuser.idapp, myuser.lang, myuser.username, userDest);
|
||||
} else {
|
||||
|
||||
msg_notifpush = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username);
|
||||
msg_notifpush = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username, nomeapp);
|
||||
domanda = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username, nomeapp) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
@@ -1539,7 +1539,7 @@ async function local_sendMsgTelegram(idapp, username, text) {
|
||||
|
||||
}
|
||||
|
||||
function getstr(lang, key, param1) {
|
||||
function getstr(lang, key, ...params) {
|
||||
|
||||
let mystr = '';
|
||||
|
||||
@@ -1578,8 +1578,8 @@ function getstr(lang, key, param1) {
|
||||
if (!mystr || mystr === '')
|
||||
mystr = txt[key];
|
||||
|
||||
if (!!param1) {
|
||||
mystr = printf(mystr, param1);
|
||||
if (params.length > 0) {
|
||||
mystr = printf(mystr, ...params);
|
||||
}
|
||||
|
||||
return mystr;
|
||||
@@ -2523,7 +2523,10 @@ class Telegram {
|
||||
|
||||
async menuRestartSrv(rec, msg, cmd2) {
|
||||
if (cmd2 === '6711') {
|
||||
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS...');
|
||||
const freeSpace = await tools.getFreeDiskSpace();
|
||||
const strfree = `Spazio libero su disco: ${freeSpace}`;
|
||||
|
||||
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS... \n' + strfree);
|
||||
let file = '~/batch/production_restart_server.sh';
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
file = '~/batch/test_restart_server.sh';
|
||||
@@ -2543,7 +2546,10 @@ class Telegram {
|
||||
|
||||
async menuLogSrv(rec, msg, cmd2) {
|
||||
if (cmd2 === '6711') {
|
||||
const ris = await tools.execScriptByTelegram(this.idapp, msg, '~/batch/logserver.sh', this.chisono(rec) + ' Visualizzo il Log del Server...');
|
||||
const freeSpace = await tools.getFreeDiskSpace();
|
||||
const strfree = `Spazio libero su disco: ${freeSpace}`;
|
||||
console.log(strfree);
|
||||
const ris = await tools.execScriptByTelegram(this.idapp, msg, '~/batch/logserver.sh', this.chisono(rec) + ' Visualizzo il Log del Server... \n' + strfree);
|
||||
} else {
|
||||
this.nonAbilitato(msg);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ const sanitizeHtml = require('sanitize-html');
|
||||
|
||||
const { exec } = require('child_process');
|
||||
|
||||
const util = require('util');
|
||||
const execPromise = util.promisify(exec);
|
||||
|
||||
const { spawn } = require('child_process');
|
||||
const readline = require('readline');
|
||||
|
||||
@@ -5348,6 +5351,8 @@ module.exports = {
|
||||
if (username_telegram) {
|
||||
contatto_telegram = `@${username_telegram}`;
|
||||
contatto = contatto_telegram;
|
||||
} else {
|
||||
contatto = myrec.email;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
@@ -5937,7 +5942,20 @@ module.exports = {
|
||||
console.log(JSON.stringify(result, null, 2)); // Stampa il risultato in formato JSON
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async getFreeDiskSpace(path = '/') {
|
||||
try {
|
||||
const { stdout } = await execPromise(`df -k ${path} | tail -1 | awk '{print $4}'`);
|
||||
const freeSpaceKB = parseInt(stdout.trim());
|
||||
const freeSpaceGB = (freeSpaceKB / 1024 / 1024).toFixed(2);
|
||||
return `${freeSpaceGB} GB`;
|
||||
} catch (error) {
|
||||
console.error('Errore nel recupero dello spazio libero su disco:', error);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -979,6 +979,7 @@ module.exports = {
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
email: 1,
|
||||
groupname: 1,
|
||||
lasttimeonline: 1,
|
||||
comune: 1,
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.17
|
||||
1.1.18
|
||||
Reference in New Issue
Block a user