Aggiunta stili CSS per Kiosk, struttura HTML per la Mappa e Riferimenti ai Sensori
• 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>
This commit is contained in:
33
plugin/telegram/callbacks/backupdownload.js
Normal file
33
plugin/telegram/callbacks/backupdownload.js
Normal file
@@ -0,0 +1,33 @@
|
||||
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' });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user