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:
30
plugin/telegram/commands/marine.js
Normal file
30
plugin/telegram/commands/marine.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const skFlow = require('../../config/skFlow');
|
||||
const { liveMarkup } = require('../utility/live');
|
||||
|
||||
module.exports = {
|
||||
command: 'marine',
|
||||
handler: (bot, msg) => {
|
||||
const chatId = msg.chat.id;
|
||||
const data = skFlow.getWithFilter('meb.marine');
|
||||
|
||||
let text = '';
|
||||
|
||||
if (!data || Object.keys(data).length === 0) {
|
||||
text = 'Nessun dato sul mare disponibile.';
|
||||
} else {
|
||||
text = '*Dati Meteo del mare*\n\n';
|
||||
for (const [path, value] of Object.entries(data)) {
|
||||
const displayValue = typeof value === 'object' ? JSON.stringify(value) : value;
|
||||
//TODO: ADD units
|
||||
//TODO: Formattare meglio i path
|
||||
text += `*${path}*: ${displayValue}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
bot.sendMessage(chatId, text, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: msg.message_id,
|
||||
reply_markup: liveMarkup(msg.message_id, 'marine')
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user