Add support for refreshing a query once a week

This commit is contained in:
Arik Fraimovich 2013-12-13 18:46:14 +02:00
parent 030864b72b
commit 4afb12669a
2 changed files with 5 additions and 2 deletions

View File

@ -98,7 +98,7 @@
})
$scope.refreshOptions.push({value: 24*3600, name: 'Every 24h'});
$scope.refreshOptions.push({value: 7*24*3600, name: 'Once a week'});
$scope.$watch('queryResult && queryResult.getError()', function (newError, oldError) {
if (newError == undefined) {

View File

@ -4,8 +4,11 @@ var durationHumanize = function (duration) {
humanized = "-";
} else if (duration < 60) {
humanized = Math.round(duration) + "s";
} else if (duration > 3600*24) {
var days = Math.round(parseFloat(duration) / 60.0 / 60.0 / 24.0);
humanized = days + "days";
} else if (duration >= 3600) {
var hours = Math.round(parseFloat(duration) / 60.0 / 60.0)
var hours = Math.round(parseFloat(duration) / 60.0 / 60.0);
humanized = hours + "h";
} else {
var minutes = Math.round(parseFloat(duration) / 60.0);