diff --git a/server/sql_cfg.js b/server/sql_cfg.js index c7d317b..619d627 100644 --- a/server/sql_cfg.js +++ b/server/sql_cfg.js @@ -88,7 +88,8 @@ module.exports = function (fs, bcrypt, app_cfg) { // Rueckmelde-Tabelle erstellen db.run(`CREATE TABLE waip_response ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, - waip_einsaetze_id INTEGER NOT NULL, + waip_uuid TEXT, + rmld_uuid TEXT, response_json TEXT)`); // Benutzer-Tabelle erstellen db.run(`CREATE TABLE waip_users ( diff --git a/server/sql_qry.js b/server/sql_qry.js index 6247a0d..703f6a3 100644 --- a/server/sql_qry.js +++ b/server/sql_qry.js @@ -655,14 +655,15 @@ module.exports = function(db, async, app_cfg) { db.get(`select name_wache from waip_wachen where id = ?;`, [reuckmeldung.wache_id], function(err, row) { if (err == null && row) { - reuckmeldung.wache_name = row; + reuckmeldung.wache_name = row.name_wache; - db.run((`INSERT INTO waip_response - (waip_einsaetze_id, response_json) - VALUES ( - \'` + reuckmeldung.waip_uuid + `\', + db.run((`insert or replace into waip_response (id, waip_uuid, rmld_uuid, response_json) + values + ((select id from waip_response where rmld_uuid = \'` + reuckmeldung.rmld_uuid + `\'), + \'` + reuckmeldung.waip_uuid + `\', + \'` + reuckmeldung.rmld_uuid + `\', \'` + JSON.stringify(reuckmeldung) + `\')`), function(err) { - console.log(err); + //console.log(err); if (err == null) { callback && callback('OK'); } else { diff --git a/views/includes/master_wachalarm.pug b/views/includes/master_wachalarm.pug index a2a6609..a6c3cb1 100644 --- a/views/includes/master_wachalarm.pug +++ b/views/includes/master_wachalarm.pug @@ -19,29 +19,39 @@ .row.no-gutters.h-100.pt-3 .col-12.h-10.h-100.w-100 .d-flex.fustify-content-between.font-weight-bold - #rueckmeldung.list-group.list-group-horizontal.text-center.w-100 - a.list-group-item.bg-secondary.flex-fill.text-success 3 EK - a.list-group-item.bg-secondary.flex-fill.text-info 2 MA - a.list-group-item.bg-secondary.flex-fill.text-light 1 FK - #rueckmeldung.list-group.list-group-horizontal.text-center - a.list-group-item.bg-warning.flex-fill.text-dark 2 AGT + .list-group.list-group-horizontal.text-center.w-100 + .list-group-item.flex-fill.text-success + a#ek-counter 0 + a  EK + .list-group-item.flex-fill.text-info + a#ma-counter 0 + a  MA + .list-group-item.flex-fill.text-light + a#fk-counter 0 + a  FK + .list-group.text-center + .list-group-item.border.border-warning.flex-fill.text-warning + a#agt-counter 0 + a  AGT //a.badge.badge-warning 2 AGT .row - .col-4 - .progress.mt-1 - .progress-bar.progress-bar-striped.bg-success(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') 2min - .progress.mt-1.border.border-warning - .progress-bar.progress-bar-striped.bg-success(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') 2min - .progress.mt-1 + .col-4#pg-ek + //.progress.mt-1 + .progress-bar.progress-bar-striped.bg-success(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') + a(style='') 2min + //.progress.mt-1.border.border-warning(style='height: 20px;') + .progress-bar.progress-bar-striped.bg-success(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') + h 2min + //.progress.mt-1 .progress-bar.progress-bar-striped.bg-success.ion-md-checkmark-circle(role='progressbar', style='width: 100%', aria-valuenow='100', aria-valuemin='0', aria-valuemax='100') - .col-4 - .progress.mt-1 + .col-4#pg-ma + //.progress.mt-1 .progress-bar.progress-bar-striped.bg-info(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') 3min - .progress.mt-1 + //.progress.mt-1 .progress-bar.progress-bar-striped.bg-info(role='progressbar', style='width: 25%', aria-valuenow='25', aria-valuemin='0', aria-valuemax='100') 1min - .col-4 - .progress.mt-1.border.border-warning - .progress-bar.progress-bar-striped.bg-light(role='progressbar', style='width: 50%', aria-valuenow='50', aria-valuemin='0', aria-valuemax='100') 10min + .col-4#pg-fk + //.progress.mt-1.border.border-warning + .progress-bar.progress-bar-striped.bg-light(role='progressbar', style='width: 50%', aria-valuenow='50', aria-valuemin='0', aria-valuemax='100') 10min .col-6.h-65.d-flex.align-items-end.justify-content-start.tf_multiline #ortsdaten.flex-fill -Objekt- br