diff --git a/static/directives/logs-view.html b/static/directives/logs-view.html
index 5a5b2ad0a..6e6532a5e 100644
--- a/static/directives/logs-view.html
+++ b/static/directives/logs-view.html
@@ -3,12 +3,12 @@
From
-
+
to
-
+
diff --git a/static/js/directives/ui/logs-view.js b/static/js/directives/ui/logs-view.js
index 9a353b2c8..0ce684106 100644
--- a/static/js/directives/ui/logs-view.js
+++ b/static/js/directives/ui/logs-view.js
@@ -24,9 +24,11 @@ angular.module('quay').directive('logsView', function () {
$scope.chartVisible = true;
$scope.logsPath = '';
+ $scope.options = {};
+
var datetime = new Date();
- $scope.logStartDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate() - 7);
- $scope.logEndDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate());
+ $scope.options.logStartDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate() - 7);
+ $scope.options.logEndDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate());
var defaultPermSuffix = function(metadata) {
if (metadata.activating_username) {
@@ -261,9 +263,10 @@ angular.module('quay').directive('logsView', function () {
return;
}
- var twoWeeksAgo = getOffsetDate($scope.logEndDate, -14);
- if ($scope.logStartDate > $scope.logEndDate || $scope.logStartDate < twoWeeksAgo) {
- $scope.logStartDate = twoWeeksAgo;
+ var twoWeeksAgo = getOffsetDate($scope.options.logEndDate, -14);
+ if ($scope.options.logStartDate > $scope.options.logEndDate ||
+ $scope.options.logStartDate < twoWeeksAgo) {
+ $scope.options.logStartDate = twoWeeksAgo;
}
$scope.loading = true;
@@ -282,8 +285,8 @@ angular.module('quay').directive('logsView', function () {
url = UtilService.getRestUrl('superuser', 'logs')
}
- url += '?starttime=' + encodeURIComponent(getDateString($scope.logStartDate));
- url += '&endtime=' + encodeURIComponent(getDateString($scope.logEndDate));
+ url += '?starttime=' + encodeURIComponent(getDateString($scope.options.logStartDate));
+ url += '&endtime=' + encodeURIComponent(getDateString($scope.options.logEndDate));
if ($scope.performer) {
url += '&performer=' + encodeURIComponent($scope.performer.name);
@@ -300,7 +303,7 @@ angular.module('quay').directive('logsView', function () {
});
}
- $scope.chart.draw('bar-chart', resp.logs, $scope.logStartDate, $scope.logEndDate);
+ $scope.chart.draw('bar-chart', resp.logs, $scope.options.logStartDate, $scope.options.logEndDate);
$scope.kindsAllowed = null;
$scope.logs = resp.logs;
$scope.loading = false;
@@ -329,8 +332,9 @@ angular.module('quay').directive('logsView', function () {
$scope.$watch('repository', update);
$scope.$watch('makevisible', update);
$scope.$watch('performer', update);
- $scope.$watch('logStartDate', update);
- $scope.$watch('logEndDate', update);
+
+ $scope.$watch('options.logStartDate', update);
+ $scope.$watch('options.logEndDate', update);
}
};