- Timestamp:
- 07/03/15 16:35:17 (9 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/history.cshtml
r12522 r12584 15 15 <label for="fromDate">From: </label> 16 16 <div class="input-group"> 17 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="fromDate" is-open="fromIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" 17 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="fromDate" is-open="fromIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close"/> 18 18 <span class="input-group-btn"> 19 19 <button type="button" class="btn btn-default" ng-click="openFromDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button> … … 24 24 <label for="fromDate">To: </label> 25 25 <div class="input-group"> 26 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" 26 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close"/> 27 27 <span class="input-group-btn"> 28 28 <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button> 29 29 </span> 30 </div> 31 </div> 32 <div class="form-group" style="margin-left: 5px; margin-right: 5px;"> 33 <div class="btn-group" dropdown dropdown-append-to-body> 34 <button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle style="width: 130px; text-align: left;"> 35 {{curQuickSelection.name}} <span class="glyphicon glyphicon-chevron-down" style="margin-top: 3px; float:right"></span> 36 </button> 37 <ul class="dropdown-menu" role="menu"> 38 <li ng-repeat="quickSelection in quickSelectionList"> 39 <a ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a> 40 </li> 41 </ul> 30 42 </div> 31 43 </div> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/historyCtrl.js
r12551 r12584 2 2 var module = appStatusPlugin.getAngularModule(); 3 3 module.controller('app.status.historyCtrl', 4 ['$scope', '$interval', 'app.status.data.service', 5 function ($scope, $interval, dataService ) {4 ['$scope', '$interval', 'app.status.data.service', '$log', 5 function ($scope, $interval, dataService, $log) { 6 6 $scope.chartOptions = { 7 7 grid: { … … 40 40 }; 41 41 42 43 42 $scope.fromDate = new Date(); 44 43 $scope.toDate = new Date(); … … 47 46 $scope.toIsOpen = false; 48 47 48 $scope.quickSelectionList = [ 49 { id: 0, name: 'Custom' }, 50 { id: 1, name: 'Today' }, 51 { id: 2, name: 'Yesterday' }, 52 { id: 3, name: 'Last 7 Days' }, 53 { id: 4, name: 'Last 30 Days' } 54 ]; 55 $scope.changeQuickSelection = function (quickSelection) { 56 var today = new Date(); 57 var oneDayInMs = 24 * 60 * 60 * 1000; 58 switch (quickSelection.id) { 59 case 1: 60 $scope.fromDate = new Date(today.valueOf()); 61 $scope.toDate = new Date(today.valueOf()); 62 break; 63 case 2: 64 $scope.fromDate = new Date(today.valueOf() - oneDayInMs); 65 $scope.toDate = new Date(today.valueOf() - oneDayInMs); 66 break; 67 case 3: 68 $scope.fromDate = new Date(today.valueOf() - (7 * oneDayInMs)); 69 $scope.toDate = new Date(today.valueOf()); 70 break; 71 case 4: 72 $scope.fromDate = new Date(today.valueOf() - (30 * oneDayInMs)); 73 $scope.toDate = new Date(today.valueOf()); 74 break; 75 } 76 $scope.curQuickSelection = quickSelection; 77 }; 78 // set default 'today' 79 $scope.changeQuickSelection($scope.quickSelectionList[1]); 80 49 81 $scope.openFromDateSelection = function ($event) { 50 82 $event.preventDefault(); … … 52 84 $scope.toIsOpen = false; 53 85 $scope.fromIsOpen = true; 86 $scope.curQuickSelection = $scope.quickSelectionList[0]; 54 87 }; 55 88 … … 59 92 $scope.fromIsOpen = false; 60 93 $scope.toIsOpen = true; 94 $scope.curQuickSelection = $scope.quickSelectionList[0]; 61 95 }; 62 96
Note: See TracChangeset
for help on using the changeset viewer.