admin: Display time before start in UI

This commit is contained in:
nemunaire 2017-01-16 13:14:55 +01:00 committed by nemunaire
parent 9e5ab64589
commit 1549a58892
3 changed files with 13 additions and 0 deletions

View File

@ -28,6 +28,11 @@ const indextpl = `<!DOCTYPE html>
</ul>
<p id="clock" class="navbar-text navbar-right" ng-controller="CountdownController">
<span ng-show="startIn > 0">
Démarrage dans :
<span>{{"{{ startIn }}"}}</span>"
<span class="point">|</span>
</span>
<span id="hours">{{"{{ time.hours | time }}"}}</span>
<span class="point">:</span>
<span id="min">{{"{{ time.minutes | time }}"}}</span>

View File

@ -26,6 +26,11 @@
</ul>
<p id="clock" class="navbar-text navbar-right" ng-controller="CountdownController">
<span ng-show="startIn > 0">
Démarrage dans :
<span>{{ startIn }}</span>"
<span class="point">|</span>
</span>
<span id="hours">{{ time.hours | time }}</span>
<span class="point">:</span>
<span id="min">{{ time.minutes | time }}</span>

View File

@ -449,7 +449,10 @@ angular.module("FICApp")
$scope.refresh(true);
}
if (time.st > 0 && time.st <= srv_cur) {
$scope.startIn = 0;
remain = time.st + time.du - srv_cur;
} else if (time.st > 0) {
$scope.startIn = Math.floor(time.st - srv_cur);
}
if (remain < 0) {
remain = 0;