Changeset 11059


Ignore:
Timestamp:
06/30/14 16:35:16 (5 years ago)
Author:
mroscoe
Message:
 
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  
    202202          //Re-enables the error display if any of the tasks on the page have Ids matching
    203203          //those of errors
    204           $(".errorTask").each(function() {
     204          $(".errorTask","#" + "@(container)").each(function() {
    205205            if($(this).html()==result[i].Key) {
    206206              $("#@(container)" + result[i].Key).css("color","red");
     
    267267          series.barWidth = undefined;
    268268        });
    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        }
    270277      }
    271278    }
     
    409416}
    410417
    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) {
    412419  <text>
    413420  var GetRequest = "?limit=" + @(limit);
     
    439446    var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"];
    440447
     448    var destTag = eval("@(destinationTag)");
     449    if(typeof eval("@(destinationTag)") != "string") {
     450      destTag = "@(destinationTag)";
     451    }
     452
    441453    if(result.length == 0) {
    442       $('#' + "@(destinationTag)").append(
     454      $('#' + destTag).append(
    443455        '<section class="chartContainer">' +
    444456          '<h1 class="title">No slave information for the specified filters!</h1>' +
     
    447459    }
    448460    else {
    449       $('#' + "@(destinationTag)").html("");
    450461      var time = new Date();
    451462
    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      }
    455470
    456471      //Globally accesible, for use when resizing, eliminates extra DB request
     
    466481        var cpuSeries = [];
    467482        cpuSeries[0] = [];
    468         $('#' + "@(destinationTag)").append(
     483        $('#' + destTag).append(
    469484          '<section class="chartContainer">' +
    470485            '<h1 class="title" id="' + result[i][0].SlaveID + '">Slave ' + result[i][0].SlaveID + '</h1>' +
    471486            '<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>' +
    475490          '</section>');
    476491        for(j = 0; j < result[i].length; j++) {
     
    493508        }
    494509        for(k = 0; k < slaveChartNames.length; k++) {
    495           CollapsedByDefault(document.getElementById(slaveChartNames[k] + i));
     510          CollapsedByDefault(document.getElementById(slaveChartNames[k] + "Plot" + i));
    496511        }
    497512      }
     
    507522    if(typeof numberSlaves !== 'undefined') {
    508523
    509     //Set chart names for use in creation below, must be set identically in
    510     //ResizeSlaves
    511     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"];
    512527
    513528      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          }
    519546        }
    520547      }
     
    526553@helper LineChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) {
    527554  <text>
    528   window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + @(chartId), @series, {
     555  window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + "Plot" + @(chartId), @series, {
    529556    title: "@title",
    530557    axes: {
     
    566593@helper BarChartGivenSeries(string destinationTag, string chartId, string series, string title, double? minY = null, double? maxY = null, string axisYFormat = null) {
    567594  <text>
    568   window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + @(chartId), @series, {
     595  window[@(destinationTag) + "Plot" + @(chartId)] = $.jqplot(@(destinationTag) + "Plot" + @(chartId), @series, {
    569596    title: "@title",
    570597    seriesDefaults:{
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml

    r11053 r11059  
    129129      for(i = 0; i < result.length; i++) {
    130130        $("#" + "@(destinationTag)").append(
    131           '<section class="chartContainer">' +
     131          '<section id="' + result[i][0] + 'Container" class="chartContainer">' +
    132132            '<h1 class="title" id="@(destinationTag)' + result[i][0] + '">Task ' + result[i][0] + '</h1>' +
    133133            '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
     
    149149  //Opens a sub-container with slave information
    150150  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    }
    152157  }
    153158  </text>
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css

    r11053 r11059  
    606606}
    607607
    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 
    626608#ExceptionContainer .chartContainer label {
    627609  margin: 1% 0 1% 1%;
     
    631613  display: inline-block;
    632614}
     615
     616.chartContainer .chartContainer h1 {
     617  font-size: 1em;
     618}
     619
     620.chartContainer .chartContainer button {
     621  width: auto;
     622}
     623
     624label[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  
    1212});
    1313
    14 /* Because Task chart sections are created on the fly adding an event listener
     14/* Because some chart sections are created on the fly adding an event listener
    1515  was impossible. Therefore this function is hardcoded as an HTML onclick event
    1616  for the dynamically created buttons of these sections */
     
    1818  var jqCaller = $(caller);
    1919  if (jqCaller.html() == "-") {
    20     jqCaller.parent().children("canvas, div, fieldset, label").fadeOut();
     20    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeOut();
    2121    jqCaller.html("+");
    2222  }
    2323  else {
    24     jqCaller.parent().children("canvas, div, fieldset, label").fadeIn();
     24    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn();
    2525    jqCaller.html("-");
    2626  }
     
    3030  section */
    3131function CollapsedByDefault(caller) {
    32   $(caller).parent().children("canvas, div, fieldset, label").css("display","none");
     32  $(caller).parent().children("canvas, div, fieldset, label, .chartContainer").hide();
    3333}
    3434
     
    3636function OpenOnError(caller) {
    3737  var jqCaller = $(caller);
    38   jqCaller.parent().children("canvas, div, fieldset, label").fadeIn();
     38  jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn();
    3939  jqCaller.parent().children("button").html("-");
    4040}
     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. */
     44function 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  
    276276        selectedUser = $('#SlaveUserList').val();
    277277      }
    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")
    279279      pageNumber = null;
    280280    }
     
    303303      @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer",Url.Action("SlaveExceptions", "ExceptionData"),"limit","startDate", "endDate","selectedSlave")
    304304    }
    305     @*@ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo", "ChartData"),"limit","startDate","endDate")*@
     305    @ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo", "ChartData"),"limit","startDate","endDate")
    306306  </script>
    307307}
Note: See TracChangeset for help on using the changeset viewer.