- Timestamp:
- 12/12/12 11:04:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Status.aspx.cs
r9028 r9033 55 55 var resId = dao.GetResources(x => x.Name == resourceName).Single().Id; 56 56 resourceIds = dao.GetChildResources(resId).Select(x => x.Id).Union(new List<Guid> { resId }); 57 calculatingTasksByUser = dao.GetCalculatingTasksByUserForResources(resourceIds.ToList()); 58 waitingTasksByUser = dao.GetWaitingTasksByUserForResources(resourceIds.ToList()); 57 59 }, false, false); 58 60 } else { … … 60 62 { 61 63 resourceIds = dao.GetResources(x => true).Select(y => y.Id); 64 calculatingTasksByUser = dao.GetCalculatingTasksByUser(); 65 waitingTasksByUser = dao.GetWaitingTasksByUser(); 62 66 }, false, false); 63 67 } … … 65 69 transactionManager.UseTransaction(() => 66 70 { 67 onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId)); 68 currentlyJobsWaiting = dao.GetLightweightTasks(x => x.State == DA.TaskState.Waiting).Count(); 69 calculatingTasksByUser = dao.GetCalculatingTasksByUser(); 70 waitingTasksByUser = dao.GetWaitingTasksByUser(); 71 onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId)); 72 currentlyJobsWaiting = dao.GetLightweightTasks(x => x.State == DA.TaskState.Waiting).Count(); 71 73 }, false, false); 72 74 … … 116 118 } 117 119 118 foreach (var kvp in waitingTasksByUser) { 120 GenerateTasksByUserTable(waitingTasksByUser, waitingTasksByUserTable); 121 GenerateTasksByUserTable(calculatingTasksByUser, calculatingTasksByUserTable); 122 } 123 124 private void GenerateTasksByUserTable(Dictionary<Guid, int> tasksByUser, Table table) { 125 foreach (var kvp in tasksByUser) { 119 126 TableRow curRow = new TableRow(); 120 127 TableCell cellUser = new TableCell(); … … 125 132 curRow.Cells.Add(cellUser); 126 133 curRow.Cells.Add(cellCnt); 127 waitingTasksByUserTable.Rows.Add(curRow);134 table.Rows.Add(curRow); 128 135 } 129 130 foreach (var kvp in calculatingTasksByUser) { 131 TableRow curRow = new TableRow(); 132 TableCell cellUser = new TableCell(); 133 cellUser.Text = ServiceLocator.Instance.UserManager.GetUserById(kvp.Key).UserName; 134 TableCell cellCnt = new TableCell(); 135 cellCnt.Text = kvp.Value.ToString(); 136 137 curRow.Cells.Add(cellUser); 138 curRow.Cells.Add(cellCnt); 139 calculatingTasksByUserTable.Rows.Add(curRow); 136 if (tasksByUser.Count() > 0) { 137 TableRow sumRow = new TableRow(); 138 TableCell sumCell = new TableCell(); 139 sumCell.BorderWidth = Unit.Pixel(3); 140 sumCell.Text = tasksByUser.Sum(x => x.Value).ToString(); 141 sumRow.Cells.Add(new TableCell()); 142 sumRow.Cells.Add(sumCell); 143 table.Rows.Add(sumRow); 140 144 } 141 } 145 } 142 146 }
Note: See TracChangeset
for help on using the changeset viewer.