Fix traffic charts. Add chart vars

Add UI_TRAFFIC_STATS, UI_CHART_TYPE
This commit is contained in:
Sergei Birukov 2024-03-13 12:15:50 +03:00 committed by Philip H
parent ed0e46788a
commit aedb691b2b
6 changed files with 113 additions and 21 deletions

View file

@ -19,6 +19,7 @@ const {
PASSWORD,
LANG,
UI_TRAFFIC_STATS,
UI_CHART_TYPE,
} = require('../config');
module.exports = class Server {
@ -45,6 +46,9 @@ module.exports = class Server {
.get('/api/ui-traffic-stats', (Util.promisify(async () => {
return UI_TRAFFIC_STATS === 'true';
})))
.get('/api/ui-chart-type', (Util.promisify(async () => {
return UI_CHART_TYPE || 0;
})))
// Authentication
.get('/api/session', Util.promisify(async (req) => {