Changeset 11036
- Timestamp:
- 06/24/14 16:20:29 (11 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
r11030 r11036 84 84 }); 85 85 86 @(destinationTag)Plot.replot({ resetAxes: true });87 88 $('#@destinationTag').contextmenu(function() {89 @(destinationTag)Plot.resetZoom();90 @(destinationTag)Plot.replot({ resetAxes: true });91 return false;92 });93 94 86 $(window).resize(function() { 95 87 @(destinationTag)Plot.replot({ resetAxes: true }); … … 98 90 } 99 91 100 @helper RefreshChart(string destinationTag, string url, string startDate Var, string endDateVar)101 { 102 <text> 103 $.ajax({url: "@(new HtmlString(url))?start=" + @startDate Var + "&end=" + @endDateVar, datatype: "json", success: function(result) {92 @helper RefreshChart(string destinationTag, string url, string startDate, string endDate) 93 { 94 <text> 95 $.ajax({url: "@(new HtmlString(url))?start=" + @startDate + "&end=" + @endDate, datatype: "json", success: function(result) { 104 96 for (var i = 0; i < result.length; i++) { 105 97 @(destinationTag)Plot.series[i].data = result[i]; … … 110 102 } 111 103 112 @helper TasksForUser(string container, string destinationTag, string pageUrl, string taskUrl, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId=null, string taskState=null, string pageNumber=null) 104 @helper NumberPages(string records, string limit, string container, string functionName, string currentPage = null) 105 { 106 <text> 107 if(@(records).length > @limit) { 108 $("#@container").append('<label class="pageTitle">Page: </label>') 109 var pages = Math.floor(@(records).length/@(limit)) + 1; 110 for(var i=0; i < pages; i++) { 111 $("#" + "@container").append('<a id="@(container)Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>') 112 } 113 if(@currentPage != null) { 114 $("#@(container)Page" + @currentPage).css('color','#F7921D'); 115 } 116 else { 117 $("#@(container)Page1").css('color','#F7921D'); 118 } 119 $(".page").click(function () { 120 pageNumber = $(this).html(); 121 @(functionName)(); 122 }); 123 if(@currentPage != null) { 124 @(records).splice(0,(@(currentPage)-1)*@(limit)); 125 if (@(records).length > @(limit)) { 126 @(records).splice(@(limit), @(records).length - @(limit)); 127 } 128 } 129 else { 130 @(records).splice(@(limit), @(records).length - @(limit)); 131 } 132 } 133 </text> 134 } 135 136 @helper TasksForUser(string container, string destinationTag, string url, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId=null, string taskState=null, string pageNumber=null) 113 137 { 114 138 <text> … … 134 158 @:} 135 159 } 136 $.ajax({async: false, url: "@(new HtmlString(pageUrl))" + GetRequest, datatype: "json", success: function(result) { 137 if(result > 1) { 138 $("#@container").append('<label class="pageTitle">Page: </label>') 139 for(var i=0; i < result; i++) { 140 $("#" + "@container").append('<a id="Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>') 141 } 142 if(@pageNumber != null) { 143 $("#Page" + @pageNumber).css('color','#F7921D'); 144 } 145 else { 146 $("#Page1").css('color','#F7921D'); 147 } 148 } 149 }}); 150 @if(pageNumber!=null) { 151 @:if(@(pageNumber)!=null) { 152 @:GetRequest += "¤tPage=" + @pageNumber; 153 @:} 154 } 155 $.ajax({url: "@(new HtmlString(taskUrl))" + GetRequest, datatype: "json", success: function(result) { 156 if(result.Key.length==0) { 160 $.ajax({ 161 async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 162 if(result.length==0) { 157 163 $("#@container").append( 158 164 '<section class="chartContainer"><h1 class="title">' + @userName + ' has no tasks for the specified filters!</h1></section>' … … 164 170 var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"]; 165 171 172 //Checks if multipage display, if it is then trims results to 173 //the results for the page to be displayed 174 @ChartHelper.NumberPages("result",limit,container,functionName,pageNumber) 175 166 176 //Globally accesible, for use when resizing, eliminates extra DB request 167 window["numberTasks"] = result. Key.length;177 window["numberTasks"] = result.length; 168 178 169 179 //Set display of all errors to none, errors matching the tasks will be reset below … … 171 181 172 182 //For each result create a seperate collapsable section with a chart and info label 173 for(var i = 0; i < result. Key.length; i++){183 for(var i = 0; i < result.length; i++){ 174 184 $("#" + "@container").append( 175 '<section class="chartContainer"><h1 class="title" id="' + result .Key[i] + '">Task ' + result.Key[i]+185 '<section class="chartContainer"><h1 class="title" id="' + result[i].Key + '">Task ' + result[i].Key + 176 186 '</h1><button class="collapse" onclick="collapseSection(this)">+</button><div id="@(destinationTag)' + i + 177 187 '"></div><label id="@(destinationTag)' + i + 'Info"></label></section>' 178 188 ) 189 //Re-enables the error display if any of the tasks on the page have Ids matching 190 //those of errors 179 191 $(".errorTask").each(function() { 180 if($(this).html()==result .Key[i]) {181 $("#" + result .Key[i]).css("color","red");182 $("#" + result .Key[i]).append(" - ERROR");192 if($(this).html()==result[i].Key) { 193 $("#" + result[i].Key).css("color","red"); 194 $("#" + result[i].Key).append(" - ERROR"); 183 195 $(".errorContainer, .errorTitle, .underline").css('display','inline-block'); 184 196 $(this).css('display','inline-block'); … … 186 198 } 187 199 }); 188 waitTime = [result .Value[0][i]];189 transferTime = [result .Value[1][i]];190 runTime = [result .Value[2][i]];200 waitTime = [result[i].Value[0]]; 201 transferTime = [result[i].Value[1]]; 202 runTime = [result[i].Value[2]]; 191 203 window["@(destinationTag)Plot" + i] = $.jqplot("@destinationTag" + i, [waitTime,transferTime,runTime], { 192 204 seriesDefaults:{ … … 225 237 }); 226 238 227 window["@(destinationTag)Plot" + i].replot({ resetAxes: true });228 229 $('#@destinationTag' + i).contextmenu(function() {230 window["@(destinationTag)Plot" + i].resetZoom();231 window["@(destinationTag)Plot" + i].replot({ resetAxes: true });232 return false;233 });234 235 239 collapsedByDefault(document.getElementById("@(destinationTag)" + i)); 236 240 } 237 241 }}); 238 239 $(".page").click(function () {240 pageNumber = $(this).html();241 @(functionName)();242 });243 242 </text> 244 243 } … … 247 246 { 248 247 <text> 248 //Resize event, resets bar width for task charts and replots them 249 249 $(window).resize(function() { 250 250 for(var i = 0; i < numberTasks; i++) { … … 393 393 </text> 394 394 } 395 396 @helper SlaveInfoChart(string destinationTag, string url, string limit, string startDate, string endDate, string userName, string functionName, string pageNumber=null) 397 { 398 <text> 399 var GetRequest = "?limit=" + @(limit); 400 @if(startDate!=null) { 401 @:if(@(startDate)!=null) { 402 @:GetRequest += "&start=" + @startDate; 403 @:} 404 } 405 @if(endDate!=null) { 406 @:if(@(endDate)!=null) { 407 @:GetRequest += "&end=" + @endDate; 408 @:} 409 } 410 @if (userName != null) { 411 @:if(@(userName)!=null) { 412 @:GetRequest += "&userName=" + @userName; 413 @:} 414 } 415 $.ajax({ 416 async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 417 $("#@(destinationTag)").html(""); 418 var time = new Date(); 419 420 //Checks if multipage display, if it is then trims results to 421 //the results for the page to be displayed 422 @ChartHelper.NumberPages("result",limit,destinationTag,functionName,pageNumber) 423 424 for(i = 0; i < result.length; i++) { 425 var coreSeries = []; 426 coreSeries[0] = []; 427 coreSeries[1] = []; 428 var memorySeries = []; 429 memorySeries[0] = []; 430 memorySeries[1] = []; 431 var cpuSeries = []; 432 cpuSeries[0] = []; 433 $("#@(destinationTag)").append('<section class="chartContainer"><h1 class="title" id="' + result[i][0].SlaveID + '">Slave ' 434 + result[i][0].SlaveID + '</h1><button class="collapse" onclick="collapseSection(this)">+</button>' + 435 '<div id="TotalUsedCores' + result[i][0].SlaveID + '"></div><div id="TotalUsedMemory' + result[i][0].SlaveID + '"></div>' + 436 '<div id="CPUUtilization' + result[i][0].SlaveID + '"></div></section>'); 437 for(j = 0; j < result[i].length; j++) { 438 time.setTime(result[i][j].Time.replace(/\D/g,'')); 439 coreSeries[0].push([time.toUTCString(),result[i][j].TotalCores]); 440 coreSeries[1].push([time.toUTCString(),result[i][j].UsedCores]); 441 memorySeries[0].push([time.toUTCString(),(result[i][j].TotalMemory / 1000)]); 442 memorySeries[1].push([time.toUTCString(),(result[i][j].UsedMemory / 1000)]); 443 cpuSeries[0].push([time.toUTCString(),result[i][j].CPUUtilization]); 444 } 445 if(result[i].length > 1) { 446 @ChartHelper.LineChartGivenSeries("TotalUsedCores","result[i][0].SlaveID","coreSeries","Total/Used Cores") 447 @ChartHelper.LineChartGivenSeries("TotalUsedMemory","result[i][0].SlaveID","memorySeries","Total/Used Memory") 448 @ChartHelper.LineChartGivenSeries("CPUUtilization","result[i][0].SlaveID","cpuSeries","CPU Utilization",0,100,"%.1f%%") 449 } 450 else { 451 @ChartHelper.BarChartGivenSeries("TotalUsedCores","result[i][0].SlaveID","coreSeries","Total/Used Cores") 452 @ChartHelper.BarChartGivenSeries("TotalUsedMemory","result[i][0].SlaveID","memorySeries","Total/Used Memory") 453 @ChartHelper.BarChartGivenSeries("CPUUtilization","result[i][0].SlaveID","cpuSeries","CPU Utilization",0,100,"%.1f%%") 454 } 455 collapsedByDefault(document.getElementById("UsedTotalCores" + result[i][0].SlaveID)); 456 collapsedByDefault(document.getElementById("UsedTotalMemory" + result[i][0].SlaveID)); 457 collapsedByDefault(document.getElementById("CPUUtilization" + result[i][0].SlaveID)); 458 } 459 }}); 460 </text> 461 } 462 463 @helper LineChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) 464 { 465 <text> 466 window["@(destinationTag)" + @(chartId) + "Plot"] = $.jqplot("@(destinationTag)" + @(chartId), @series, { 467 title: "@title", 468 axes: { 469 xaxis: { 470 renderer: $.jqplot.DateAxisRenderer, 471 tickOptions:{formatString:'%b %#d, %y'}, 472 pad: 0 473 }, 474 yaxis: { 475 @if (axisYFormat != null) { 476 <text> 477 tickOptions: { 478 formatString: "@axisYFormat" 479 }, 480 </text> 481 } 482 @if (minY != null) { 483 @:min: @minY, 484 } 485 @if (maxY != null) { 486 @:max: @maxY, 487 } 488 pad: 0 489 } 490 }, 491 gridPadding: { left: 50, right: 10 }, 492 cursor: { 493 show: true, 494 showTooltip: false, 495 zoom: true, 496 clickReset: false, 497 dblClickReset: false, 498 constrainZoomTo: 'x' 499 } 500 }); 501 502 $(window).resize(function() { 503 window["@(destinationTag)" + @(chartId) + "Plot"].replot({ resetAxes: true }); 504 }); 505 </text> 506 } 507 508 @helper BarChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) 509 { 510 <text> 511 window["@(destinationTag)" + @(chartId) + "Plot"] = $.jqplot("@(destinationTag)" + @(chartId), @series, { 512 title: "@title", 513 seriesDefaults:{ 514 renderer:$.jqplot.BarRenderer, 515 shadowAngle: 135, 516 pointLabels: {show: true, formatString: '%.2f'} 517 }, 518 axes: { 519 xaxis: { 520 renderer: $.jqplot.CategoryAxisRenderer, 521 tickOptions:{formatString:'%b %#d, %y'}, 522 pad: 0 523 }, 524 yaxis: { 525 @if (axisYFormat != null) { 526 <text> 527 tickOptions: { 528 formatString: "@axisYFormat" 529 }, 530 </text> 531 } 532 @if (minY != null) { 533 @:min: @minY, 534 } 535 @if (maxY != null) { 536 @:max: @maxY, 537 } 538 pad: 0 539 } 540 }, 541 gridPadding: { left: 50, right: 10 }, 542 cursor: { 543 show: true, 544 showTooltip: false, 545 zoom: true, 546 clickReset: false, 547 dblClickReset: false, 548 constrainZoomTo: 'x' 549 } 550 }); 551 552 $(window).resize(function() { 553 $.each(window["@(destinationTag)" + @(chartId) + "Plot"].series, function(index, series) { 554 series.barWidth = undefined; 555 }); 556 window["@(destinationTag)" + @(chartId) + "Plot"].replot({ resetAxes: true }); 557 }); 558 559 </text> 560 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css
r11030 r11036 233 233 } 234 234 235 /* Filter and Filter Choices Styles */ 236 .filterChoices { 237 width: 15%; 238 padding: 0% 2% 1% 2%; 239 vertical-align: top; 240 } 241 242 .filterChoices label { 243 width: 75%; 244 } 245 246 .filterChoices label:last-of-type { 247 width: 50%; 248 } 249 250 .filterChoices input[type="checkbox"] { 251 margin: .4em; 252 } 253 254 .filterChoices input[type="checkbox"], .filterChoices label, .filters label, .filters input { 255 font-size: 1.5em; 256 display: inline-block; 257 } 258 259 .filterChoices legend, .filters legend { 260 font-size: 1.5em; 261 } 262 263 .filters, .filterChoices{ 264 margin: 2% 2% 3% 2%; 265 display: inline-block; 266 } 267 268 .filters { 269 width: 71%; 270 margin: 2% 0% 2% 0%; 271 } 272 273 .filterContainer { 274 width: 28%; 275 margin: 0% 0% 1% 1%; 276 vertical-align: top; 277 display: none; 278 } 279 280 .filterContainer:first-of-type { 281 margin-left: 2%; 282 display: inline-block; 283 } 284 285 .filterContainer input, .filterContainer select, .filterContainer label { 286 width: 90%; 287 margin-left: 5%; 288 } 289 290 .filters button{ 291 margin: 1% 0% 1% 2%; 292 display: block; 293 } 294 235 295 /* Multi-page Task Styles */ 236 296 .pageTitle, .page { … … 471 531 } 472 532 473 #FilterChoices {474 width: 15%;475 padding: 0% 2% 1% 2%;476 vertical-align: top;477 }478 479 #FilterChoices label {480 width: 75%;481 }482 483 #FilterChoices label:last-of-type {484 width: 50%;485 }486 487 #FilterChoices input[type="checkbox"] {488 margin: .4em;489 }490 491 #FilterChoices input[type="checkbox"], #FilterChoices label, #Filters label, #Filters input {492 font-size: 1.5em;493 display: inline-block;494 }495 496 #FilterChoices legend, #Filters legend {497 font-size: 1.5em;498 }499 500 #Filters, #FilterChoices{501 margin: 2% 2% 3% 2%;502 display: inline-block;503 }504 505 #Filters {506 width: 71%;507 margin: 2% 0% 2% 0%;508 }509 510 533 #TaskOverviewFilterFirst { 511 534 margin-top: 0%; 512 535 } 513 536 514 .filterContainer {515 width: 28%;516 margin: 0% 0% 1% 1%;517 vertical-align: top;518 display: none;519 }520 521 .filterContainer:first-of-type {522 margin-left: 2%;523 display: inline-block;524 }525 526 .filterContainer input, .filterContainer select, .filterContainer label {527 width: 90%;528 margin-left: 5%;529 }530 531 #Filters button{532 margin: 1% 0% 1% 2%;533 display: block;534 }535 536 537 /* Admin Page Styles */ 537 .usersField #FilterChoices {538 .usersField .filterChoices { 538 539 width: 92%; 539 540 margin: 1% 0% 1% 2%; 540 541 } 541 542 542 .usersField #FilterChoices legend {543 .usersField .filterChoices legend { 543 544 font-size: 1em; 544 545 padding-top: 6%; 545 546 } 546 547 547 .usersField #FilterChoices label {548 .usersField .filterChoices label { 548 549 font-size: 1em; 549 550 width: 60%; … … 551 552 } 552 553 553 .usersField #FilterChoices label:last-of-type {554 .usersField .filterChoices label:last-of-type { 554 555 width: 42%; 555 556 } 556 557 557 .usersField #FilterChoices label:last-of-type {558 .usersField .filterChoices label:last-of-type { 558 559 margin-bottom: 8%; 559 560 } 560 561 561 .usersField #FilterChoices input[type="checkbox"] {562 .usersField .filterChoices input[type="checkbox"] { 562 563 margin: .3em; 563 564 } 564 565 565 #UserOverviewTab #Filters {566 #UserOverviewTab .filters { 566 567 width: 67%; 567 568 margin: 1% 0% 0% 2%; … … 581 582 } 582 583 583 . usersList {584 .mainList { 584 585 width: 100%; 585 586 font-family: inherit; … … 591 592 margin-top: 1em; 592 593 } 594 595 #SlaveOverviewTab .filterChoices { 596 margin-top: 1%; 597 } 598 599 #SlaveOverviewTab .filters { 600 margin: 1% 0% 0% 0%; 601 } 602 603 #SlavesContainer .jqplot-target { 604 margin-left: 0%; 605 margin-top: 2%; 606 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs
r11030 r11036 156 156 { 157 157 TaskID = tasks.TaskId, 158 TotalWaiting = tasks.TotalWaitingTime,159 TotalTransfer = tasks.TotalTransferTime,160 TotalRuntime = tasks.TotalRuntime,161 158 StartDate = tasks.StartTime 162 159 }).OrderByDescending(s => s.StartDate).ToList().Count; … … 170 167 } 171 168 172 public JsonResult GetUserTask(string userName, string limit, DateTime? start = null, DateTime? end = null, string jobId = null, string taskState=null, string currentPage=null)169 public JsonResult UserTask(string userName, string limit, DateTime? start = null, DateTime? end = null, string jobId = null, string taskState=null) 173 170 { 174 171 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 193 190 }).OrderByDescending(s => s.StartDate).ToList(); 194 191 195 if (currentPage != null) { 196 data.RemoveRange(0, (Convert.ToInt32(currentPage) - 1) * Convert.ToInt32(limit)); 197 if (data.Count > Convert.ToInt32(limit)) { 198 data.RemoveRange(Convert.ToInt32(limit), data.Count - Convert.ToInt32(limit)); 199 } 200 } 201 else if (data.Count > Convert.ToInt32(limit)) 202 { 203 data.RemoveRange(Convert.ToInt32(limit), data.Count - Convert.ToInt32(limit)); 204 } 192 List<KeyValuePair<string, List<double>>> results = new List<KeyValuePair<string, List<double>>>(); 205 193 206 194 List<string> id = new List<string>(); … … 208 196 List<double> transfer = new List<double>(); 209 197 List<double> run = new List<double>(); 198 List<double> times = new List<double>(); 210 199 data.ForEach(i => id.Add(i.TaskID.ToString())); 211 200 data.ForEach(w => wait.Add(w.TotalWaiting)); … … 213 202 data.ForEach(r => run.Add(r.TotalRuntime)); 214 203 215 List<List<double>> taskStats = new List<List<double>>(); 216 taskStats.Add(wait); 217 taskStats.Add(transfer); 218 taskStats.Add(run); 219 220 return Json(new KeyValuePair<List<string>, List<List<double>>>(id, taskStats), JsonRequestBehavior.AllowGet); 204 for (int i = 0; i < id.Count; i++) { 205 results.Add(new KeyValuePair<string, List<double>>(id[i],new List<double>{wait[i],transfer[i],run[i]})); 206 } 207 208 return Json(results, JsonRequestBehavior.AllowGet); 209 } 210 } 211 212 public JsonResult SlaveInfo(string limit, DateTime? start = null, DateTime? end = null, string userName = null) 213 { 214 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) 215 { 216 var data = 217 (from slaves in db.FactClientInfos 218 join users in db.DimUsers 219 on slaves.UserId equals users.UserId 220 where (!start.HasValue || slaves.Time >= start) && 221 (!end.HasValue || slaves.Time < end) && 222 (string.IsNullOrEmpty(userName) || users.Name == userName) 223 select new 224 { 225 SlaveID = slaves.ClientId, 226 Time = slaves.Time, 227 UsedCores = slaves.NumUsedCores, 228 TotalCores = slaves.NumTotalCores, 229 UsedMemory = slaves.UsedMemory, 230 TotalMemory = slaves.TotalMemory, 231 CPUUtilization = slaves.CpuUtilization 232 }).OrderByDescending(s => s.Time).GroupBy(s => s.SlaveID).ToList(); 233 234 return Json(data, JsonRequestBehavior.AllowGet); 221 235 } 222 236 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/Admin.cshtml
r11030 r11036 19 19 <button id="UserOverviewButton" class="tabButton">User Overview</button> 20 20 <button id="TaskOverviewButton" class="tabButton">Task Overview</button> 21 <button id="SlaveOverviewButton" class="tabButton">Slave Overview</button> 22 <button id="ExceptionOverviewButton" class="tabButton">Exception Overview</button> 21 23 //User overview 22 24 <section id="UserOverviewTab" class="tabSection"> 23 25 <fieldset id="Users" class="usersField"> 24 26 <legend>Users</legend> 25 <select id="UserList" class=" usersList">26 </select> 27 <fieldset id="FilterChoices">27 <select id="UserList" class="mainList"> 28 </select> 29 <fieldset class="filterChoices"> 28 30 <legend>Filter by</legend> 29 31 <label>Date</label> 30 <input type="checkbox" name="filterChoice" value=" Date" checked="checked">32 <input type="checkbox" name="filterChoice" value="UserDate" checked="checked"> 31 33 <label>Job Name</label> 32 34 <input type="checkbox" name="filterChoice" value="JobName"> … … 34 36 <input type="checkbox" name="filterChoice" value="TaskState"> 35 37 <label>Limit</label> 36 <select id=" Limit">38 <select id="UserLimit"> 37 39 <option>20</option> 38 40 <option>50</option> … … 42 44 </fieldset> 43 45 </fieldset> 44 <fieldset id="Filters">46 <fieldset class="filters"> 45 47 <legend>Filters</legend> 46 <fieldset id="Filter Date" class="filterContainer">48 <fieldset id="FilterUserDate" class="filterContainer"> 47 49 <legend>Date</legend> 48 50 <label>Start</label> … … 59 61 @Html.DropDownList("TaskStates") 60 62 </fieldset> 61 <button id=" Apply">Apply</button>63 <button id="UserApply">Apply</button> 62 64 </fieldset> 63 65 <button id="ScrollTop">^</button> … … 68 70 <fieldset id="TaskUsers" class="usersField"> 69 71 <legend>Users</legend> 70 <select id="TaskUserList" class=" usersList">72 <select id="TaskUserList" class="mainList"> 71 73 </select> 72 74 <label>Start</label> … … 76 78 </fieldset> 77 79 <section id="TaskStatsContainer" class="tabDataContainer taskOverview"></section> 80 </section> 81 //Slave overview 82 <section id="SlaveOverviewTab" class="tabSection"> 83 <fieldset class="filterChoices"> 84 <legend>Filter by</legend> 85 <label>Date</label> 86 <input type="checkbox" name="filterChoice" value="SlaveDate" checked="checked"> 87 <label>Users</label> 88 <input type="checkbox" name="filterChoice" value="User"> 89 <label>Limit</label> 90 <select id="SlaveLimit"> 91 <option>10</option> 92 <option>50</option> 93 <option selected="selected">100</option> 94 <option>200</option> 95 </select> 96 </fieldset> 97 <fieldset class="filters"> 98 <legend>Filters</legend> 99 <fieldset id="FilterSlaveDate" class="filterContainer"> 100 <legend>Date</legend> 101 <label>Start</label> 102 @Html.TextBox("SlaveStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" }) 103 <label>End</label> 104 @Html.TextBox("SlaveEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" }) 105 </fieldset> 106 <fieldset id="FilterUser" class="filterContainer"> 107 <legend>User</legend> 108 <select id="SlaveUserList"> 109 </select> 110 </fieldset> 111 <button id="SlaveApply">Apply</button> 112 </fieldset> 113 <section id="SlavesContainer" class="tabDataContainer"></section> 114 </section> 115 //Slave overview 116 <section id="ExceptionOverviewTab" class="tabSection"> 117 <fieldset class="filterChoices"> 118 <legend>Filter by</legend> 119 <label>Date</label> 120 <input type="checkbox" name="filterChoice" value="ExceptionDate" checked="checked"> 121 <label>Users</label> 122 <input type="checkbox" name="filterChoice" value="ExceptionUser"> 123 <label>Limit</label> 124 <select id="ExceptionLimit"> 125 <option>20</option> 126 <option>50</option> 127 <option selected="selected">100</option> 128 <option>200</option> 129 </select> 130 </fieldset> 131 <fieldset class="filters"> 132 <legend>Filters</legend> 133 <fieldset id="FilterExceptionDate" class="filterContainer"> 134 <legend>Date</legend> 135 <label>Start</label> 136 @Html.TextBox("ExceptionStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" }) 137 <label>End</label> 138 @Html.TextBox("ExceptionEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" }) 139 </fieldset> 140 <fieldset id="FilterExceptionUser" class="filterContainer"> 141 <legend>User</legend> 142 <select id="ExceptionUserList"> 143 </select> 144 </fieldset> 145 <button id="ExcpetionApply">Apply</button> 146 </fieldset> 147 <section id="ExceptionContainer" class="tabDataContainer"></section> 78 148 </section> 79 149 } … … 93 163 @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.pointLabels.min.js") 94 164 95 @AdminHelper.UserList("UserList", Url.Action("UserList", "AdminData"),true) 96 @AdminHelper.UserList("TaskUserList", Url.Action("UserList", "AdminData"),false) 165 @AdminHelper.UserList("UserList", Url.Action("UserList", "AdminData"), true) 166 @AdminHelper.UserList("TaskUserList", Url.Action("UserList", "AdminData"), false) 167 @AdminHelper.UserList("SlaveUserList", Url.Action("UserList", "AdminData"), false) 97 168 98 169 <script> … … 102 173 var limit; 103 174 var pageNumber; 175 var userId; 176 var numberTasks = 0; 104 177 105 178 $(document).ready(function () { … … 112 185 onSelect: function () { RefreshTask(); } 113 186 }); 114 }); 115 116 $("#Apply").button({ 117 icons: { 118 primary: "ui-icon-refresh" 119 } 120 }); 121 122 $("#Apply").click(function () { 123 RefreshUser(); 124 }); 187 $("#SlaveStart, #SlaveEnd").datepicker({ 188 dateFormat: "yy-mm-dd", 189 onSelect: function () { RefreshSlave(); } 190 }); 191 $("#ExceptionStart, #ExceptionEnd").datepicker({ 192 dateFormat: "yy-mm-dd", 193 onSelect: function () { RefreshException(); } 194 }); 195 }); 196 197 $("#UserApply").button({ icons: { primary: "ui-icon-refresh" } }); 198 $("#UserApply").click(function () { RefreshUser(); }); 199 200 $("#SlaveApply").button({ icons: { primary: "ui-icon-refresh" } }); 201 $("#SlaveApply").click(function () { RefreshSlave(); }); 202 203 $("#ExceptionApply").button({ icons: { primary: "ui-icon-refresh" } }); 204 $("#ExceptionApply").click(function () { RefreshException(); }); 125 205 126 206 $("#UserList").change(function () { … … 140 220 function RefreshUser() { 141 221 selectedUser = $("#UserList").val(); 142 limit = $("# Limit").val();222 limit = $("#UserLimit").val(); 143 223 startDate = null; 144 224 endDate = null; 145 225 jobId = null; 146 226 taskState = null; 147 if ($("[value=' Date']").is(":checked")) {227 if ($("[value='UserDate']").is(":checked")) { 148 228 startDate = $('#UserStart').val(); 149 229 endDate = $('#UserEnd').val(); … … 155 235 taskState = $('#TaskState').val(); 156 236 } 157 @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"selectedUser","limit","startDate","endDate","jobId","taskState") 158 @ChartHelper.TasksForUser("TasksContainer","Task",Url.Action("NumberPages", "ChartData"),Url.Action("GetUserTask", "ChartData"),"RefreshUser","selectedUser","limit","startDate","endDate","jobId","taskState","pageNumber") 237 @ExceptionHelper.UserExceptions("TasksContainer", Url.Action("TaskExceptions", "ExceptionData"), "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState") 238 @ChartHelper.TasksForUser("TasksContainer", "Task", Url.Action("UserTask", "ChartData"), "RefreshUser", "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState", "pageNumber") 239 pageNumber = null; 159 240 } 160 241 … … 170 251 startDate = $('#TaskStart').val(); 171 252 endDate = $('#TaskEnd').val(); 172 @AdminHelper.UserTaskStats("TaskStatsContainer",Url.Action("TaskStats", "AdminData"),"selectedUser","startDate","endDate") 253 @AdminHelper.UserTaskStats("TaskStatsContainer", Url.Action("TaskStats", "AdminData"), "selectedUser", "startDate", "endDate") 254 } 255 256 $("#SlaveList").change(function () { 257 RefreshSlave(); 258 }); 259 260 function RefreshSlave() { 261 selectedUser = null; 262 limit = $("#SlaveLimit").val(); 263 startDate = null; 264 endDate = null; 265 if ($("[value='SlaveDate']").is(":checked")) { 266 startDate = $('#SlaveStart').val(); 267 endDate = $('#SlaveEnd').val(); 268 } 269 if ($("[value='User']").is(':checked')) { 270 selectedUser = $('#SlaveUserList').val(); 271 } 272 @ChartHelper.SlaveInfoChart("SlavesContainer",Url.Action("SlaveInfo","ChartData"),"limit","startDate","endDate","selectedUser","RefreshSlave","pageNumber") 273 pageNumber = null; 173 274 } 174 275 -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/UserTask.cshtml
r11030 r11036 9 9 <button id="TaskOverviewButton" class="tabButton">Task Overview</button> 10 10 <section id="TaskInformationTab" class="tabSection"> 11 <fieldset id="FilterChoices">11 <fieldset class="filterChoices"> 12 12 <legend>Filter by</legend> 13 13 <label>Date</label> … … 19 19 <label>Limit</label> 20 20 <select id="Limit"> 21 <option> 10</option>21 <option>20</option> 22 22 <option>50</option> 23 23 <option selected="selected">100</option> … … 25 25 </select> 26 26 </fieldset> 27 <fieldset id="Filters">27 <fieldset class="filters"> 28 28 <legend>Filters</legend> 29 29 <fieldset id="FilterDate" class="filterContainer"> … … 130 130 } 131 131 @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"userName","limit","startDate","endDate","jobId","taskState") 132 @ChartHelper.TasksForUser("TasksContainer","Task",Url.Action(" NumberPages", "ChartData"),Url.Action("GetUserTask", "ChartData"),"TaskInformation","userName","limit","startDate","endDate","jobId","taskState","pageNumber")132 @ChartHelper.TasksForUser("TasksContainer","Task",Url.Action("UserTask", "ChartData"),"TaskInformation","userName","limit","startDate","endDate","jobId","taskState","pageNumber") 133 133 pageNumber = null; 134 134 }
Note: See TracChangeset
for help on using the changeset viewer.