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:
@@ -4,21 +4,23 @@ const db = require('../../config/skFlow')
|
||||
const config = require('../../config/configManager.js')
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
const { path } = req.query;
|
||||
const data = db.get(path);
|
||||
res.json(data);
|
||||
const { path, source } = req.query;
|
||||
if (source) {
|
||||
return res.json(db.getBySource(source));
|
||||
}
|
||||
res.json(db.get(path));
|
||||
});
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
const { source } = req.query;
|
||||
const data = db.getBySource(source);
|
||||
res.json(data);
|
||||
});
|
||||
const maskToken = (t) => {
|
||||
if (!t) return null;
|
||||
const s = String(t);
|
||||
return s.length > 8 ? `${s.slice(0, 5)}…${s.slice(-3)}` : '***';
|
||||
};
|
||||
|
||||
router.get('/info', (req, res) => {
|
||||
const info = {
|
||||
|
||||
telegram: config.getTelegramToken(),
|
||||
telegram_configured: Boolean(config.getTelegramToken()),
|
||||
telegram_token_preview: maskToken(config.getTelegramToken()),
|
||||
|
||||
sensor: {
|
||||
name: config.getSensorName(),
|
||||
|
||||
Reference in New Issue
Block a user