feat: Implement rulesets and layout management for kiosk plugin
- Added rulesets manager to handle various data types and updates via HTTP and WebSocket. - Introduced layout store for managing kiosk layouts with caching and server synchronization. - Enhanced dashboard and data routes to support new layout and ruleset features. - Updated kiosk HTML and JavaScript to utilize new layout rendering and data binding. - Removed obsolete map route and integrated map functionality into the new tile renderer. - Improved Telegram commands to reflect changes in data structure and logging. - Refactored weather fetching intervals to prevent multiple instances. - Added SSE stream for real-time layout updates in the kiosk.
This commit is contained in:
@@ -31,10 +31,18 @@ function getSensorCode() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ottiene il nome sensore
|
||||
* Ottiene l'id testuale del sensore (registrato sul server con POST /connect/new).
|
||||
* Fallback su SENSOR_ID env per setup standalone.
|
||||
*/
|
||||
function getSensorId() {
|
||||
return pluginOptions.sensor_id || process.env.SENSOR_ID || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated usa getSensorId. Mantenuto solo per retro-compatibilita'.
|
||||
*/
|
||||
function getSensorName() {
|
||||
return pluginOptions.sensor_name || '';
|
||||
return getSensorId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,6 +74,7 @@ module.exports = {
|
||||
init,
|
||||
getTelegramToken,
|
||||
getSensorCode,
|
||||
getSensorId,
|
||||
getSensorName,
|
||||
getSendInterval,
|
||||
getReconnectDelay,
|
||||
|
||||
@@ -31,10 +31,10 @@ module.exports = {
|
||||
description: 'Inserisci un codice identificativo per inviare i dati al server',
|
||||
default: '',
|
||||
},
|
||||
sensor_name: {
|
||||
sensor_id: {
|
||||
type: 'string',
|
||||
title: 'Nome Sensore',
|
||||
description: 'Inserisci un nome per il tuo sensore, che verrà visualizzato nel server',
|
||||
title: 'ID Sensore',
|
||||
description: 'ID del sensore generato dal server al momento della registrazione (POST /connect/new)',
|
||||
default: '',
|
||||
},
|
||||
sensor_interval: {
|
||||
|
||||
Reference in New Issue
Block a user