diff --git a/server/routing.js b/server/routing.js index f47afa0..9dba66d 100755 --- a/server/routing.js +++ b/server/routing.js @@ -148,6 +148,22 @@ module.exports = function(app, sql, uuidv4, app_cfg, passport, auth, waip, udp) }); }); + /* ######################## */ + /* ###### Dashboard ####### */ + /* ######################## */ + + // Dasboard-Uebersicht + app.get('/dbrd', function(req, res, next) { + sql.db_get_active_waips(function(data) { + res.render('overview', { + public: app_cfg.public, + title: 'Einsatzübersicht', + user: req.user, + dataSet: data + }); + }); + }); + /* ######################## */ /* ##### Rueckmeldung ##### */ /* ######################## */ diff --git a/server/waip.js b/server/waip.js index 09b9422..b194d84 100755 --- a/server/waip.js +++ b/server/waip.js @@ -10,12 +10,7 @@ module.exports = function (io, sql, tw, async, app_cfg) { if (socket_rooms) { socket_rooms.forEach(function (rooms) { // fuer jede Wache(rooms.room) die verbundenen Sockets(Clients) ermitteln und den Einsatz verteilen - //io.to(rooms.room).emit('io.response', rmld); var room_sockets = io.sockets.adapter.rooms[rooms.room]; - //console.log(row); - //console.log(row.room); - //console.log(room_sockets); - //console.log(io.sockets.adapter); if (typeof room_sockets !== 'undefined') { //Object.keys(room_sockets.sockets).forEach(function (socketId) { Object.keys(room_sockets).forEach(function (socket) { diff --git a/views/overview.pug b/views/overview.pug new file mode 100755 index 0000000..e479600 --- /dev/null +++ b/views/overview.pug @@ -0,0 +1,27 @@ +extends layout + +block content + main(role='main') + .container + .row + each val in dataSet + .col-12.d-flex.align-self-stretch + .card.border-dark.mb-3.w-100 + .card-header + case val.einsatzart + when 'Brandeinsatz' + h5.font-weight-bold.text-danger.ion-md-flame= ' ' + val.einsatzart + ' - ' + val.stichwort + when 'Hilfeleistungseinsatz' + h5.font-weight-bold.text-info.ion-md-construct= ' ' + val.einsatzart + ' - ' + val.stichwort + when 'Rettungseinsatz' + h5.font-weight-bold.text-warning.ion-md-midikit= ' ' + val.einsatzart + ' - ' + val.stichwort + when 'Krankentransport' + h5.font-weight-bold.text-success.ion-md-medical= ' ' + val.einsatzart + ' - ' + val.stichwort + default + h5.font-weight-bold.ion-md-information-circle= ' ' + val.einsatzart + ' - ' + val.stichwort + .card-body.d-flex.justify-content-between + if val.ortsteil + p= val.ort + ', ' + val.ortsteil + else + p= val.ort + p.btn.btn-primary.mx-2.ion-md-arrow-round-forward(href='/dbrd/' + val.uuid, role='button') Dashboard aufrufen