update Mi 29. Apr 13:01:01 CEST 2020

This commit is contained in:
Robert Richter 2020-04-29 13:01:01 +02:00
parent 283bbacc8d
commit e266b1c27e
5 changed files with 148 additions and 150 deletions

View File

@ -1,6 +1,5 @@
// TODO: Remote-Reload per Socket
// TODO: Client-Server-Version abgleichen
// TODO: Modal bei Chrome, dass Audio erst bei interaktion aktiv
// TODO: Modal bei Server-Verbindung, und Modal bei Reload
$(document).ready(function () {
set_clock();
@ -474,7 +473,9 @@ setInterval(set_clock, 1000);
// Uhrzeit verschieben
$(document).ready(function () {
setTimeout(function(){ animateDiv(); },1000);
setTimeout(function () {
animateDiv();
}, 1000);
});
// neue Random-Position fuer Uhrzeit ermitteln
@ -492,7 +493,10 @@ function animateDiv(){
var newq = makeNewPosition();
var oldq = $('.clock_y').offset();
var speed = calcSpeed([oldq.top, oldq.left], newq);
$('.clock_y').animate({ top: newq[0], left: newq[1] }, speed, function(){
$('.clock_y').animate({
top: newq[0],
left: newq[1]
}, speed, function () {
animateDiv();
});
};
@ -619,25 +623,6 @@ function add_resp_progressbar(p_id, p_type, p_agt, p_start, p_end) {
socket.on('io.response', function (data) {
console.log(data);
// neue Rückmeldungen hinterlegen
//$('#rueckmeldung').empty();
//{einsatzkraft: "0", maschinist: "0", fuehrungskraft: "0", atemschutz: "0"}
/*for (var i in data) {
var item_class = 'list-group-item flex-fill list-group-item-action tf_singleline';
switch (data[i]) {
case '0':
item_class = item_class + ' text-danger';
break;
case '1':
item_class = item_class + ' text-warning';
break;
default:
item_class = item_class + ' text-success';
};
$('#rueckmeldung').append('<a class="' + item_class + '">' + data[i] + ' ' + i + '</a>');
};*/
data.forEach(function (arrayItem) {
//var x = arrayItem.prop1 + 2;
//console.log(x);

View File

@ -1,10 +1,10 @@
var app_cfg = {};
app_cfg.global = {
development: true,
http_port: 3000,
https_port: 3443,
udpport: 60233,
remoteapi: 'http://localhost:8078/api',
database: './database.sqlite3',
soundpath: '/public/media/',
mediapath: '/media/',
@ -27,4 +27,11 @@ app_cfg.public = {
map_attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
};
app_cfg.remote = {
api: 'http://localhost:8078/api',
jwt_secret: 'asdfwert1234567890#'
};
remoteapi: 'http://localhost:8078/api',
module.exports = app_cfg;

View File

@ -505,6 +505,7 @@ module.exports = function (db, uuidv4, turf, app_cfg) {
};
function db_log(typ, text) {
//TODO: Debug Eintraege nur bei Development speichern
db.run(`INSERT INTO waip_log (log_typ, log_text)
VALUES (
\'` + typ + `\',

View File

@ -236,17 +236,20 @@ module.exports = function (io, sql, tw, async, app_cfg) {
sql.db_get_sockets_to_standby(function (socket_ids) {
if (socket_ids) {
socket_ids.forEach(function (row) {
var socket = io.sockets.connected[row.socket_id];
//var socket = io.sockets.connected[row.socket_id];
//nvar nsp_waip = io.of('/waip');
var nsp_waip = io.of('/waip');
console.log(JSON.stringify(row));
console.log(nsp_waip.sockets.connected[row.socket_id]);
//var socket = ;
//nsp_waip.to(rooms.room).emit('io.response', rmld_obj);
io.of('/waip').to(row.socket_id).emit('io.standby', null);
io.of('/waip').to(row.socket_id).emit('io.stopaudio', null);
//io.of('/waip').to(row.socket_id).emit('io.standby', null);
//io.of('/waip').to(row.socket_id).emit('io.stopaudio', null);
//socket.emit('io.standby', null);
//socket.emit('io.stopaudio', null);
socket.emit('io.standby', null);
socket.emit('io.stopaudio', null);
sql.db_log('WAIP', 'Standby an Socket ' + socket.id + ' gesendet');
sql.db_update_client_status(socket, null);
});

View File

@ -18,6 +18,7 @@
.col-12.col-7_ls.h-40.h-70_ls
.row.no-gutters.h-100.pt-3
.col-12.h-10.h-100.w-100
// TODO: Rueckmedlung ohne Rueckmeldung ausbleden
.d-flex.fustify-content-between.font-weight-bold
.list-group.list-group-horizontal.text-center.w-100
.list-group-item.flex-fill.text-success
@ -66,6 +67,7 @@
li.list-group-item.d-flex.justify-content-between.align-items-center -Einsatzmittel 2-
li.list-group-item.d-flex.justify-content-between.align-items-center -Einsatzmittel n-
// TODO: Status mit anzeigen (als .badge.badge-pill)
// TODO: auflistung vieler Fahrzeuge verbessern. flexfill
.col-12.h-5.d-flex.align-items-end.justify-content-center.text-dark.tf_singleline
#em_weitere -weiteres Einsatzmittel 1-, -weiteres Einsatzmittel 2-, -weiteres Einsatzmittel n-
.col-12.h-20.d-flex.align-items-center.rounded.bg-light.font-weight-bold.text-info.tf_singleline