Changeset 11059
- Timestamp:
- 06/30/14 16:35:16 (10 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
r11053 r11059 202 202 //Re-enables the error display if any of the tasks on the page have Ids matching 203 203 //those of errors 204 $(".errorTask" ).each(function() {204 $(".errorTask","#" + "@(container)").each(function() { 205 205 if($(this).html()==result[i].Key) { 206 206 $("#@(container)" + result[i].Key).css("color","red"); … … 267 267 series.barWidth = undefined; 268 268 }); 269 window["@(destinationTag)Plot" + i].replot({ resetAxes: true }); 269 if($("#@(destinationTag)Plot" + i).css("display") == "none") { 270 ResizeOpenClose($("#@(destinationTag)Plot" + i).siblings(".collapse")); 271 window["@(destinationTag)Plot" + i].replot({ resetAxes: true }); 272 ResizeOpenClose($("#@(destinationTag)Plot" + i).siblings(".collapse")); 273 } 274 else { 275 window["@(destinationTag)Plot" + i].replot({ resetAxes: true }); 276 } 270 277 } 271 278 } … … 409 416 } 410 417 411 @helper SlaveInfoChart(string destinationTag, string url, string limit, string startDate, string endDate, string userName, string functionName, string pageNumber=null, string slaveId=null) {418 @helper SlaveInfoChart(string destinationTag, string url, string limit, bool singleSlave, string startDate=null, string endDate=null, string userName=null, string functionName=null, string pageNumber=null, string slaveId=null) { 412 419 <text> 413 420 var GetRequest = "?limit=" + @(limit); … … 439 446 var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"]; 440 447 448 var destTag = eval("@(destinationTag)"); 449 if(typeof eval("@(destinationTag)") != "string") { 450 destTag = "@(destinationTag)"; 451 } 452 441 453 if(result.length == 0) { 442 $('#' + "@(destinationTag)").append(454 $('#' + destTag).append( 443 455 '<section class="chartContainer">' + 444 456 '<h1 class="title">No slave information for the specified filters!</h1>' + … … 447 459 } 448 460 else { 449 $('#' + "@(destinationTag)").html("");450 461 var time = new Date(); 451 462 452 //Checks if multipage display, if it is then trims results to 453 //the results for the page to be displayed 454 @ChartHelper.NumberPages("result",limit,destinationTag,functionName,pageNumber) 463 @if(!singleSlave) { 464 @:$('#' + destTag).html(""); 465 466 //Checks if multipage display, if it is then trims results to 467 //the results for the page to be displayed 468 @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber) 469 } 455 470 456 471 //Globally accesible, for use when resizing, eliminates extra DB request … … 466 481 var cpuSeries = []; 467 482 cpuSeries[0] = []; 468 $('#' + "@(destinationTag)").append(483 $('#' + destTag).append( 469 484 '<section class="chartContainer">' + 470 485 '<h1 class="title" id="' + result[i][0].SlaveID + '">Slave ' + result[i][0].SlaveID + '</h1>' + 471 486 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + 472 '<div id="' + slaveChartNames[0] + i + '"></div>' +473 '<div id="' + slaveChartNames[1] + i + '"></div>' +474 '<div id="' + slaveChartNames[2] + i + '"></div>' +487 '<div id="' + slaveChartNames[0] + 'Plot' + i + '"></div>' + 488 '<div id="' + slaveChartNames[1] + 'Plot' + i + '"></div>' + 489 '<div id="' + slaveChartNames[2] + 'Plot' + i + '"></div>' + 475 490 '</section>'); 476 491 for(j = 0; j < result[i].length; j++) { … … 493 508 } 494 509 for(k = 0; k < slaveChartNames.length; k++) { 495 CollapsedByDefault(document.getElementById(slaveChartNames[k] + i));510 CollapsedByDefault(document.getElementById(slaveChartNames[k] + "Plot" + i)); 496 511 } 497 512 } … … 507 522 if(typeof numberSlaves !== 'undefined') { 508 523 509 //Set chart names for use in creation below, must be set identically in510 //ResizeSlaves511 var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"];524 //Set chart names for use in creation below, must be set identically in 525 //SlaveInfoChart 526 var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"]; 512 527 513 528 for(i = 0; i < numberSlaves; i++) { 514 for(j = 0; j < slaveChartNames.length; j++) { 515 $.each(window[slaveChartNames[j] + "Plot" + i].series, function(index, series) { 516 series.barWidth = undefined; 517 }); 518 window[slaveChartNames[j] + "Plot" + i].replot({ resetAxes: true }); 529 if($("#" + slaveChartNames[0] + "Plot" + i).css("display") == "none") { 530 ResizeOpenClose($("#" + slaveChartNames[0] + "Plot" + i).siblings(".collapse")); 531 for(j = 0; j < slaveChartNames.length; j++) { 532 $.each(window[slaveChartNames[j] + "Plot" + i].series, function(index, series) { 533 series.barWidth = undefined; 534 }); 535 window[slaveChartNames[j] + "Plot" + i].replot({ resetAxes: true }); 536 } 537 ResizeOpenClose($("#" + slaveChartNames[0] + "Plot" + i).siblings(".collapse")); 538 } 539 else { 540 for(j = 0; j < slaveChartNames.length; j++) { 541 $.each(window[slaveChartNames[j] + "Plot" + i].series, function(index, series) { 542 series.barWidth = undefined; 543 }); 544 window[slaveChartNames[j] + "Plot" + i].replot({ resetAxes: true }); 545 } 519 546 } 520 547 } … … 526 553 @helper LineChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) { 527 554 <text> 528 window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + @(chartId), @series, {555 window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + "Plot" + @(chartId), @series, { 529 556 title: "@title", 530 557 axes: { … … 566 593 @helper BarChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) { 567 594 <text> 568 window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + @(chartId), @series, {595 window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + "Plot" + @(chartId), @series, { 569 596 title: "@title", 570 597 seriesDefaults:{ -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml
r11053 r11059 129 129 for(i = 0; i < result.length; i++) { 130 130 $("#" + "@(destinationTag)").append( 131 '<section class="chartContainer">' +131 '<section id="' + result[i][0] + 'Container" class="chartContainer">' + 132 132 '<h1 class="title" id="@(destinationTag)' + result[i][0] + '">Task ' + result[i][0] + '</h1>' + 133 133 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + … … 149 149 //Opens a sub-container with slave information 150 150 function ShowSlaveInfo(caller) { 151 @*@ChartHelper.SlaveInfoChart("",url,limit,startDate,endDate,"null","NotApplicable","null","$(caller).html()")*@ 151 if($(caller).parent().parent().children(".chartContainer").length == 0) { 152 @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"$(caller).html()") 153 } 154 else { 155 $(caller).parent().parent().children(".chartContainer").remove(); 156 } 152 157 } 153 158 </text> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css
r11053 r11059 606 606 } 607 607 608 /* About Page Styles */609 .aboutMain {610 width: 96%;611 margin: 1% 0% 1% 2%;612 }613 614 .aboutMain h2 {615 font-size: 1.4em;616 }617 618 .aboutMain p {619 font-size: 1.2em;620 }621 622 .aboutMain p:first-letter {623 font-size: 1.4em;624 }625 626 608 #ExceptionContainer .chartContainer label { 627 609 margin: 1% 0 1% 1%; … … 631 613 display: inline-block; 632 614 } 615 616 .chartContainer .chartContainer h1 { 617 font-size: 1em; 618 } 619 620 .chartContainer .chartContainer button { 621 width: auto; 622 } 623 624 label[id$="Client"] a:hover { 625 color: #F7921D; 626 text-decoration: underline; 627 cursor: pointer; 628 } 629 630 /* About Page Styles */ 631 .aboutMain { 632 width: 96%; 633 margin: 1% 0% 1% 2%; 634 } 635 636 .aboutMain h2 { 637 font-size: 1.4em; 638 } 639 640 .aboutMain p { 641 font-size: 1.2em; 642 } 643 644 .aboutMain p:first-letter { 645 font-size: 1.4em; 646 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/CollapsingSection.js
r11053 r11059 12 12 }); 13 13 14 /* Because Taskchart sections are created on the fly adding an event listener14 /* Because some chart sections are created on the fly adding an event listener 15 15 was impossible. Therefore this function is hardcoded as an HTML onclick event 16 16 for the dynamically created buttons of these sections */ … … 18 18 var jqCaller = $(caller); 19 19 if (jqCaller.html() == "-") { 20 jqCaller.parent().children("canvas, div, fieldset, label ").fadeOut();20 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeOut(); 21 21 jqCaller.html("+"); 22 22 } 23 23 else { 24 jqCaller.parent().children("canvas, div, fieldset, label ").fadeIn();24 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn(); 25 25 jqCaller.html("-"); 26 26 } … … 30 30 section */ 31 31 function CollapsedByDefault(caller) { 32 $(caller).parent().children("canvas, div, fieldset, label ").css("display","none");32 $(caller).parent().children("canvas, div, fieldset, label, .chartContainer").hide(); 33 33 } 34 34 … … 36 36 function OpenOnError(caller) { 37 37 var jqCaller = $(caller); 38 jqCaller.parent().children("canvas, div, fieldset, label ").fadeIn();38 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn(); 39 39 jqCaller.parent().children("button").html("-"); 40 40 } 41 42 /* Because some chart sections are collapsed(display=none) on resize the charts will not chart 43 properly unless they are opened, them updated, then closed again. */ 44 function ResizeOpenClose(caller) { 45 var jqCaller = $(caller); 46 if (jqCaller.html() == "-") { 47 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").hide(); 48 jqCaller.html("+"); 49 } 50 else { 51 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").show(); 52 jqCaller.html("-"); 53 } 54 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/Admin.cshtml
r11053 r11059 276 276 selectedUser = $('#SlaveUserList').val(); 277 277 } 278 @ChartHelper.SlaveInfoChart("SlavesContainer", Url.Action("SlaveInfo", "ChartData"), "limit", "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber")278 @ChartHelper.SlaveInfoChart("SlavesContainer", Url.Action("SlaveInfo", "ChartData"), "limit", false, "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber") 279 279 pageNumber = null; 280 280 } … … 303 303 @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer",Url.Action("SlaveExceptions", "ExceptionData"),"limit","startDate", "endDate","selectedSlave") 304 304 } 305 @ *@ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo", "ChartData"),"limit","startDate","endDate")*@305 @ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo", "ChartData"),"limit","startDate","endDate") 306 306 </script> 307 307 }
Note: See TracChangeset
for help on using the changeset viewer.