- Timestamp:
- 06/19/15 18:06:19 (9 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataController.cs
r12477 r12484 41 41 get { return ServiceLocator.Instance.UserManager; } 42 42 } 43 private IRoleVerifier RoleVerifier { 44 get { return ServiceLocator.Instance.RoleVerifier; } 45 } 46 private IAuthorizationManager AuthorizationManager { 47 get { return ServiceLocator.Instance.AuthorizationManager; } 48 } 43 49 44 50 public IEnumerable<DTO.Job> GetJobs() { … … 47 53 48 54 public IEnumerable<DTO.Job> GetJobsByUserId(Guid id) { 55 if (id != UserManager.CurrentUserId) { 56 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator); 57 } 49 58 using (var pm = PersistenceManager) { 50 59 return pm.UseTransaction(() => { … … 62 71 using (var pm = PersistenceManager) { 63 72 return pm.UseTransaction(() => { 73 var dimJobDao = pm.JobDao; 64 74 var factTaskDao = pm.FactTaskDao; 75 var job = dimJobDao.GetById(id); 76 if (job != null && job.OwnerUserId != UserManager.CurrentUserId) { 77 RoleVerifier.AuthenticateForAllRoles(HiveRoles.Administrator); 78 } 65 79 return factTaskDao.GetByJobId(id).Select(x => new DTO.Task { 66 TotalRuntime = x.TotalRuntime, 67 TotalWaitingTime = x.TotalWaitingTime, 68 TotalTransferTime = x.TotalTransferTime, 80 Id = x.TaskId, 81 CalculatingTime = x.CalculatingTime, 82 WaitingTime = x.WaitingTime, 83 TransferTime = x.TransferTime, 84 InitialWaitingTime = x.InitialWaitingTime, 69 85 NumCalculationRuns = x.NumCalculationRuns, 70 86 NumRetries = x.NumRetries, … … 72 88 MemoryRequired = x.MemoryRequired, 73 89 Priority = x.Priority, 90 State = x.TaskState.ToString(), 74 91 LastClientId = x.LastClientId, 75 92 StartTime = x.StartTime, 76 EndTime = x.EndTime 93 EndTime = x.EndTime, 94 Exception = x.Exception 77 95 }).ToList(); 78 96 }); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataTransfer/Task.cs
r12477 r12484 24 24 namespace HeuristicLab.Services.WebApp.Statistics.WebApi.DataTransfer { 25 25 public class Task { 26 public double TotalRuntime { get; set; } 27 public double TotalWaitingTime { get; set; } 28 public double TotalTransferTime { get; set; } 26 public Guid Id { get; set; } 27 public double CalculatingTime { get; set; } 28 public double WaitingTime { get; set; } 29 public double TransferTime { get; set; } 30 public double InitialWaitingTime { get; set; } 29 31 public int NumCalculationRuns { get; set; } 30 32 public int NumRetries { get; set; } … … 32 34 public int MemoryRequired { get; set; } 33 35 public int Priority { get; set; } 36 public string State { get; set; } 34 37 public Guid? LastClientId { get; set; } 35 public DateTime StartTime { get; set; }38 public DateTime? StartTime { get; set; } 36 39 public DateTime? EndTime { get; set; } 40 public string Exception { get; set; } 37 41 } 38 42 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/jobs.cshtml
r12477 r12484 27 27 </div> 28 28 <div class="panel-body"> 29 <table class="table table-hover ">29 <table class="table table-hover table-condensed"> 30 30 <thead> 31 <tr> 32 <th>#</th> 33 <th>Job Name</th> 34 <th>Date Created</th> 35 </tr> 31 <tr> 32 <th>#</th> 33 <th>Job Name</th> 34 <th>Date Created</th> 35 <th></th> 36 </tr> 36 37 </thead> 37 38 <tr ng-repeat="job in jobs"> … … 39 40 <td>{{job.Name}}</td> 40 41 <td>{{job.DateCreated}}</td> 42 <td><a ng-href="" data-ng-click="getTasksByJobId(job.Id)">Load Tasks</a></td> 41 43 </tr> 42 44 <tr ng-hide="jobs.length"> … … 49 51 </div> 50 52 53 <div class="row" ng-show="tasks.length"> 54 55 <div class="col-lg-3 col-md-6" ng-repeat="task in tasks"> 56 <div class="panel panel-default"> 57 58 <div class="panel-heading"> 59 <h3 class="panel-title">Task {{$index + 1}}</h3> 60 </div> 61 <div class="panel-body"> 62 <table class="table table-hover table-condensed table-no-border table-auto-width"> 63 <tr> 64 <td>Initial Waiting Time:</td> 65 <td>{{task.InitialWaitingTime}}</td> 66 </tr> 67 <tr> 68 <td>Waiting Time:</td> 69 <td>{{task.WaitingTime}}</td> 70 </tr> 71 <tr> 72 <td>Calculating Time:</td> 73 <td>{{task.CalculatingTime}}</td> 74 </tr> 75 <tr> 76 <td>Transfer Time:</td> 77 <td>{{task.TransferTime}}</td> 78 </tr> 79 <tr> 80 <td>Start Time:</td> 81 <td>{{task.StartTime}}</td> 82 </tr> 83 <tr> 84 <td>End Time:</td> 85 <td>{{task.EndTime}}</td> 86 </tr> 87 <tr> 88 <td>Calculation Runs:</td> 89 <td>{{task.NumCalculationRuns}}</td> 90 </tr> 91 <tr> 92 <td>Retries Runs:</td> 93 <td>{{task.NumRetries}}</td> 94 </tr> 95 <tr> 96 <td>Cores Required:</td> 97 <td>{{task.CoresRequired}}</td> 98 </tr> 99 <tr> 100 <td>Memory Required:</td> 101 <td>{{task.MemoryRequired}}</td> 102 </tr> 103 <tr> 104 <td>Priority:</td> 105 <td>{{task.Priority}}</td> 106 </tr> 107 </table> 108 </div> 109 110 </div> 111 </div> 112 </div> 51 113 </div> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/jobsCtrl.js
r12477 r12484 8 8 }); 9 9 }; 10 11 $scope.getTasksByJobId = function(id) { 12 statisticsService.getTasksByJobId({ id: id }, function(tasks) { 13 $scope.tasks = tasks; 14 }); 15 }; 16 10 17 getJobs(); 11 18 }]
Note: See TracChangeset
for help on using the changeset viewer.