• Creato un nuovo file CSS per gli stili del chiosco (kiosk) con variabili, stili per le schede (card) e animazioni. • Aggiunto un file HTML per l'interfaccia della mappa utilizzando Mapbox, inclusi gli stili e il JavaScript per le funzionalità della mappa. • Introdotto un file JSON per i riferimenti ai sensori, definendo percorsi ed elementi per i dati di temperatura, vento, onde, posizione, batteria, motore e sistema. Co-authored-by: Copilot <copilot@github.com>
34 lines
998 B
JavaScript
34 lines
998 B
JavaScript
const fs = require('fs');
|
|
const { listDataFiles } = require('../commands/backuplogs');
|
|
|
|
module.exports = {
|
|
prefix: 'bkdl:',
|
|
handler: async (bot, query) => {
|
|
const chatId = query.message.chat.id;
|
|
|
|
const parts = query.data.split(':');
|
|
const fileIdx = parseInt(parts[1]);
|
|
const userMessageId = parts[2];
|
|
|
|
const files = await listDataFiles();
|
|
const file = files[fileIdx];
|
|
|
|
if (!file || !fs.existsSync(file.path)) {
|
|
bot.answerCallbackQuery(query.id, { text: 'File non trovato', show_alert: true });
|
|
return;
|
|
}
|
|
|
|
try {
|
|
await bot.sendDocument(chatId, file.path, {
|
|
caption: `\`${file.name}\``,
|
|
parse_mode: 'Markdown'
|
|
});
|
|
} catch (e) {
|
|
bot.answerCallbackQuery(query.id, { text: 'Errore invio file', show_alert: true });
|
|
return;
|
|
}
|
|
|
|
bot.answerCallbackQuery(query.id, { text: 'File inviato' });
|
|
}
|
|
};
|