From 5afd846af12379d14c567c889812b304eca2384c Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Fri, 10 Jul 2020 14:31:01 +0200 Subject: [PATCH] update Fr 10. Jul 14:31:01 CEST 2020 --- public/js/client_dbrd.js | 107 +----------------------------- public/js/client_rmld.js | 6 +- public/js/client_waip.js | 3 +- server.js | 1 + server/app_cfg.js | 1 - server/routing.js | 2 + views/dbrd.pug | 6 +- views/overviews/overview_dbrd.pug | 12 +++- views/rmld.pug | 2 + views/waip.pug | 5 +- 10 files changed, 29 insertions(+), 116 deletions(-) diff --git a/public/js/client_dbrd.js b/public/js/client_dbrd.js index 6f049c8..d472e56 100755 --- a/public/js/client_dbrd.js +++ b/public/js/client_dbrd.js @@ -23,9 +23,9 @@ var map = L.map('map', { // Layer der Karte mapLink = L.tileLayer( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - //map_tile, { - maxZoom: 18 + map_tile, { + maxZoom: 18, + attribution: map_attribution }).addTo(map); // Icon der Karte zuordnen @@ -444,104 +444,7 @@ socket.on('io.Einsatz', function (data) { // Einsatzmittel hinzuefuegen document.getElementById(wachen_idstr).appendChild(flex_div_em); - - - - - - //var newText2 = document.createTextNode(data.einsatzmittel[i].einsatzmittel); - //newCell2.appendChild(newText2); - //table_em.rows[wache_zeile].cells[1].appendChild(newText2); - //table_em.rows[wache_zeile].cells[1].setAttribute('pr-2'); - - - - - /* if (wache_vorhanden) { - var flex_div = document.createElement('div'); - flex_div.className = 'd-flex flex-wrap justify-content-between align-items-center'; - - var flex_under_div = document.createElement('div'); - flex_under_div.className = 'flex-fill rounded bg-secondary p-2 m-1'; - - var justify_div = document.createElement('div'); - justify_div.className = 'd-flex justify-content-between'; - - var em_div = document.createElement('div'); - em_div.className = 'pr-2'; - em_div.innerHTML = data.einsatzmittel[i].einsatzmittel; - - var status_div = document.createElement('div'); - status_div.className = 'p-2 badge badge-dark'; - status_div.innerHTML = data.einsatzmittel[i].status; - - flex_div.appendChild(flex_under_div); - - flex_under_div.appendChild(justify_div); - - justify_div.appendChild(em_div); - justify_div.appendChild(status_div); - - table_em.rows[wache_zeile].cells[1].appendChild(flex_div); - - //var newText2 = document.createTextNode(data.einsatzmittel[i].einsatzmittel); - //newCell2.appendChild(newText2); - //table_em.rows[wache_zeile].cells[1].appendChild(newText2); - //table_em.rows[wache_zeile].cells[1].setAttribute('pr-2'); - } else { - - - - var flex_div = document.createElement('div'); - flex_div.className = 'd-flex flex-wrap justify-content-between align-items-center'; - - var flex_under_div = document.createElement('div'); - flex_under_div.className = 'flex-fill rounded bg-secondary p-2 m-1'; - - var justify_div = document.createElement('div'); - justify_div.className = 'd-flex justify-content-between'; - - var em_div = document.createElement('div'); - em_div.className = 'pr-2'; - em_div.innerHTML = data.einsatzmittel[i].einsatzmittel; - - var status_div = document.createElement('div'); - status_div.className = 'p-2 badge badge-dark'; - status_div.innerHTML = data.einsatzmittel[i].status; - - flex_div.appendChild(flex_under_div); - - flex_under_div.appendChild(justify_div); - - justify_div.appendChild(em_div); - justify_div.appendChild(status_div); - - table_em.rows[wache_zeile].cells[1].appendChild(flex_div); - - var newCell2 = newRow.insertCell(1); - var newText2 = document.createTextNode(data.einsatzmittel[i].einsatzmittel); - newCell2.appendChild(flex_div); - };/* - -/* -th(scope='row') CB FW Cottbus 1 - td - div - - div.flex-fill.rounded.bg-secondary.p-2.m-1 - div.d-flex.justify-content-between - div.pr-2 FL CB 01/42-01 - div.p-2.badge.badge-success 2 - - div.flex-fill.rounded.bg-secondary.p-2.m-1 - div.d-flex.justify-content-between - div.pr-2 FL CB 01/82-01 - div.p-2.badge.badge-warning 3 -*/ - - - }; // Karte leeren map.removeLayer(marker); @@ -570,10 +473,6 @@ th(scope='row') CB FW Cottbus 1 timeline.customTimes[timeline.customTimes.length - 1].hammer.off("panstart panmove panend"); timeline.setCustomTimeMarker(markerText, alarm_zeit, false); - // Configuration for the Timeline - //var options2 = {}; - // Create a Timeline - //var timeline2 = new vis.Timeline(container2, items2, options2); // TODO Ablaufzeit setzen }); diff --git a/public/js/client_rmld.js b/public/js/client_rmld.js index 2e0eb2b..a03c74d 100755 --- a/public/js/client_rmld.js +++ b/public/js/client_rmld.js @@ -10,9 +10,9 @@ var map = L.map('map', { // Layer der Karte // TODO: internen Kartendienst setzten mapLink = L.tileLayer( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - //map_tile, { - maxZoom: 18 + map_tile, { + maxZoom: 18, + attribution: map_attribution }).addTo(map); // Icon der Karte zuordnen diff --git a/public/js/client_waip.js b/public/js/client_waip.js index d325813..1545a3e 100644 --- a/public/js/client_waip.js +++ b/public/js/client_waip.js @@ -236,7 +236,8 @@ var map = L.map('map', { // Layer der Karte mapLink = L.tileLayer( map_tile, { - maxZoom: 18 + maxZoom: 18, + attribution: map_attribution }).addTo(map); // Icon der Karte zuordnen diff --git a/server.js b/server.js index f89d220..01b7f48 100644 --- a/server.js +++ b/server.js @@ -20,6 +20,7 @@ const { v4: uuidv4 } = require('uuid'); // Basis-Konfiguration laden und generische App-UUID erzeugen var app_cfg = require('./server/app_cfg.js'); app_cfg.global.app_id = uuidv4(); +app_cfg.public.version = 'Version 1.2.1'; // Remote-Api aktivieren var remote_api; diff --git a/server/app_cfg.js b/server/app_cfg.js index 478cf3a..f8ee8c6 100644 --- a/server/app_cfg.js +++ b/server/app_cfg.js @@ -25,7 +25,6 @@ app_cfg.public = { url: 'https://wachalarm.mooo.com', app_name: 'Wachalarm IP-Web', company: 'Leitstelle Lausitz', - version: 'Version 1.2.1', map_tile: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', map_attribution: '© OpenStreetMap contributors', ext_imprint: false, diff --git a/server/routing.js b/server/routing.js index 23d60ad..d845815 100755 --- a/server/routing.js +++ b/server/routing.js @@ -252,6 +252,8 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, udp, saver title: 'Einsatz-Rückmeldung', user: req.user, einsatzdaten: einsatzdaten, + map_tile: app_cfg.public.map_tile, + map_attribution: app_cfg.public.map_attribution, error: req.flash("errorMessage"), success: req.flash("successMessage") }); diff --git a/views/dbrd.pug b/views/dbrd.pug index d129676..ed70637 100755 --- a/views/dbrd.pug +++ b/views/dbrd.pug @@ -10,8 +10,8 @@ block content script(src='/socket.io/socket.io.js') script(src='/js/leaflet.js') script. - dbrd_uuid="#{dbrd_uuid}" - map_tile="#{map_tile}" - map_attribution="#{map_attribution}" + dbrd_uuid='#{dbrd_uuid}' + map_tile='#{map_tile}' + map_attribution='!{map_attribution}' client_id="#{app_id}" script(src='/js/client_dbrd.js') \ No newline at end of file diff --git a/views/overviews/overview_dbrd.pug b/views/overviews/overview_dbrd.pug index e56a61c..3a83ba7 100755 --- a/views/overviews/overview_dbrd.pug +++ b/views/overviews/overview_dbrd.pug @@ -11,6 +11,9 @@ block content .card.bg-dark .card-body.text-muted.text-center h3 Dashboard-Übersicht + .col-12 + div.border-top.m-3 + .row each val, index in dataSet .col-12.col-xl-6.d-flex.align-self-stretch.p-3 .card.w-100 @@ -35,8 +38,13 @@ block content .card-footer.text-right a.btn.btn-primary.mx-2.ion-md-arrow-round-forward(href='/dbrd/' + val.uuid, role='button') Dashboard aufrufen else - li There are no values - + .col-12.p-3 + .card.bg-danger.w-100 + .card-header + h5 Achtung + .card-body + div Aktuell sind keine Einsätze verfügbar. Bitte versuchen Sie es später erneut. + script(src='/js/leaflet.js') script. var data = !{JSON.stringify(dataSet).replace(/<\//g, '<\\/')} diff --git a/views/rmld.pug b/views/rmld.pug index a84bd4f..f4170c5 100755 --- a/views/rmld.pug +++ b/views/rmld.pug @@ -9,6 +9,8 @@ block content .container-fluid include includes/master_rueckmeldung script. + map_tile='#{map_tile}' + map_attribution='!{map_attribution}' var einsatzdaten_obj = !{JSON.stringify(einsatzdaten).replace(/<\//g, '<\\/')} script(src='/js/leaflet.js') script(src='/js/client_rmld.js') \ No newline at end of file diff --git a/views/waip.pug b/views/waip.pug index 396ae39..f4ccccd 100644 --- a/views/waip.pug +++ b/views/waip.pug @@ -13,8 +13,9 @@ block content include includes/master_wachalarm script. - var map_tile = !{JSON.stringify(public.map_tile).replace(/<\//g, '<\\/')} - var client_id = !{JSON.stringify(app_id).replace(/<\//g, '<\\/')} + map_tile='#{map_tile}' + map_attribution='!{map_attribution}' + client_id="#{app_id}" script(src='/js/leaflet.js') script(src='/js/textFit.min.js') script(src='/socket.io/socket.io.js')