update Mo 2. Mär 09:31:01 CET 2020

This commit is contained in:
Robert Richter 2020-03-02 09:31:01 +01:00
parent 24541d5d8a
commit 38257ce6f1
2 changed files with 23 additions and 14 deletions

View File

@ -48,7 +48,7 @@ function add_resp_progressbar(p_id, p_type, p_start, p_end) {
//
//<div class="progress mt-1">
//<div class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">2min</div></div>
$( '#pg-fk' ).append( '<div class="progress mt-1" id="pg-' + p_id + '"></div>' );
$( '#pg-fk' ).append( '<div class="progress mt-1" id="pg-' + p_id + ' style="height: 0.9375rem; font-size: 0.9375rem;"></div>' );
$( '#pg-'+ p_id ).append( '<div id="pg-bar'+ p_id +'" class="progress-bar progress-bar-striped bg-success" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>' );
@ -56,12 +56,12 @@ function add_resp_progressbar(p_id, p_type, p_start, p_end) {
clearInterval(counter_ID[p_id]);
counter_ID[p_id] = setInterval(function() {
do_progressbar('pg-bar'+ p_id, p_start, p_end);
do_progressbar(p_id, p_start, p_end);
}, 1000);
};
function do_progressbar(div_id, start, end) {
function do_progressbar(p_id, start, end) {
today = new Date();
// restliche Zeit ermitteln
//var current_progress = Math.round(100 / (end.getTime() - start.getTime()) * (end.getTime() - today.getTime()));
@ -78,11 +78,20 @@ function add_resp_progressbar(p_id, p_type, p_start, p_end) {
// Progressbar anpassen
$("#"+div_id)
if (current_progress >= 100) {
$("#pg-bar"+p_id)
.css("width", "100%")
.attr("aria-valuenow", 100)
.text("")
.addClass("ion-md-checkmark-circle");
clearInterval(counter_ID[p_id]);
} else {
$("#pg-bar"+p_id)
.css("width", current_progress + "%")
.attr("aria-valuenow", current_progress)
.text(minutes + " min");
};
};
@ -296,9 +305,7 @@ var item_id = Math.floor(Math.random() * 100) + Math.floor(Math.random() * 100);
end: new Date(arrayItem.arrival_time),
content: item_content
};
if (arrayItem.fuehrungskraft == 1){
add_resp_progressbar(item_id, item_classname, new Date(arrayItem.set_time), new Date(arrayItem.arrival_time));
};
items.add(new_item);
groups.update({ id: arrayItem.wache, content: arrayItem.wache });
});

View File

@ -237,10 +237,12 @@ style(type='text/css').
//a.badge.badge-warning 2&nbsp;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(style='height: 0.9375rem;font-size: 0.9375rem;')
.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