admin: Make propagation time smarter
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
nemunaire 2022-02-03 16:56:34 +01:00
parent 2cd40e64ab
commit 5e4c14c634
3 changed files with 44 additions and 3 deletions

View file

@ -125,6 +125,23 @@ angular.module("FICApp")
}
}
})
.filter("timer", function() {
return function(input) {
input = Math.floor(input / 1000);
var res = ""
if (input >= 3600) {
res += Math.floor(input / 3600) + ":";
input = input % 3600;
}
if (input >= 60) {
res += Math.floor(input / 60) + "'";
input = input % 60;
}
return res + (input>9?input:"0"+input) + '"';
}
})
.filter("since", function() {
return function(passed) {
if (passed < 120000) {
@ -261,6 +278,19 @@ angular.module("FICApp")
}
$rootScope.timeProgression = 1 - remain / ($rootScope.settings.end - $rootScope.settings.start);
$rootScope.timeRemaining = remain;
if ($rootScope.settings.activateTime) {
var now = new Date();
var actTime = new Date($rootScope.settings.activateTime);
if (actTime > now)
$rootScope.activateTimeCountDown = actTime - now;
else
$rootScope.activateTimeCountDown = null;
} else {
$rootScope.activateTimeCountDown = null;
}
remain = remain / 1000;