Changeset 11036


Ignore:
Timestamp:
06/24/14 16:20:29 (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

    r11030 r11036  
    8484        });
    8585       
    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        
    9486        $(window).resize(function() {
    9587            @(destinationTag)Plot.replot({ resetAxes: true });
     
    9890}
    9991
    100 @helper RefreshChart(string destinationTag, string url, string startDateVar, string endDateVar)
    101 {
    102   <text>
    103   $.ajax({url: "@(new HtmlString(url))?start=" + @startDateVar + "&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) {
    10496    for (var i = 0; i < result.length; i++) {
    10597      @(destinationTag)Plot.series[i].data = result[i];
     
    110102}
    111103
    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)
    113137{
    114138  <text>
     
    134158      @:}
    135159    }
    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 += "&currentPage=" + @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) {
    157163        $("#@container").append(
    158164          '<section class="chartContainer"><h1 class="title">' + @userName + ' has no tasks for the specified filters!</h1></section>'
     
    164170      var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"];
    165171
     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
    166176      //Globally accesible, for use when resizing, eliminates extra DB request
    167       window["numberTasks"] = result.Key.length;
     177      window["numberTasks"] = result.length;
    168178
    169179      //Set display of all errors to none, errors matching the tasks will be reset below
     
    171181
    172182      //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++){
    174184        $("#" + "@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 +
    176186          '</h1><button class="collapse" onclick="collapseSection(this)">+</button><div id="@(destinationTag)' + i +
    177187          '"></div><label id="@(destinationTag)' + i + 'Info"></label></section>'
    178188        )
     189        //Re-enables the error display if any of the tasks on the page have Ids matching
     190        //those of errors
    179191        $(".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");
    183195            $(".errorContainer, .errorTitle, .underline").css('display','inline-block');
    184196            $(this).css('display','inline-block');
     
    186198          }
    187199        });
    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]];
    191203        window["@(destinationTag)Plot" + i] = $.jqplot("@destinationTag" + i, [waitTime,transferTime,runTime], {
    192204          seriesDefaults:{
     
    225237        });
    226238
    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 
    235239        collapsedByDefault(document.getElementById("@(destinationTag)" + i));
    236240      }
    237241    }});
    238 
    239     $(".page").click(function () {
    240       pageNumber = $(this).html();
    241       @(functionName)();
    242     });
    243242  </text>
    244243}
     
    247246{
    248247  <text>
     248  //Resize event, resets bar width for task charts and replots them
    249249  $(window).resize(function() {
    250250    for(var i = 0; i < numberTasks; i++) {
     
    393393  </text>
    394394}
     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  
    233233}
    234234
     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
    235295/* Multi-page Task Styles */
    236296.pageTitle, .page {
     
    471531}
    472532
    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 
    510533#TaskOverviewFilterFirst {
    511534  margin-top: 0%;
    512535}
    513536
    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 
    536537/* Admin Page Styles */
    537 .usersField #FilterChoices {
     538.usersField .filterChoices {
    538539  width: 92%;
    539540  margin: 1% 0% 1% 2%;
    540541}
    541542
    542 .usersField #FilterChoices legend {
     543.usersField .filterChoices legend {
    543544  font-size: 1em;
    544545  padding-top: 6%;
    545546}
    546547
    547 .usersField #FilterChoices label {
     548.usersField .filterChoices label {
    548549  font-size: 1em;
    549550  width: 60%;
     
    551552}
    552553
    553 .usersField #FilterChoices label:last-of-type {
     554.usersField .filterChoices label:last-of-type {
    554555  width: 42%;
    555556}
    556557
    557 .usersField #FilterChoices label:last-of-type {
     558.usersField .filterChoices label:last-of-type {
    558559  margin-bottom: 8%;
    559560}
    560561
    561 .usersField #FilterChoices input[type="checkbox"] {
     562.usersField .filterChoices input[type="checkbox"] {
    562563  margin: .3em;
    563564}
    564565
    565 #UserOverviewTab #Filters {
     566#UserOverviewTab .filters {
    566567  width: 67%;
    567568  margin: 1% 0% 0% 2%;
     
    581582}
    582583
    583 .usersList {
     584.mainList {
    584585  width: 100%;
    585586  font-family: inherit;
     
    591592  margin-top: 1em;
    592593}
     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  
    156156           {
    157157             TaskID = tasks.TaskId,
    158              TotalWaiting = tasks.TotalWaitingTime,
    159              TotalTransfer = tasks.TotalTransferTime,
    160              TotalRuntime = tasks.TotalRuntime,
    161158             StartDate = tasks.StartTime
    162159           }).OrderByDescending(s => s.StartDate).ToList().Count;
     
    170167    }
    171168
    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)
    173170    {
    174171      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     
    193190           }).OrderByDescending(s => s.StartDate).ToList();
    194191
    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>>>();
    205193
    206194        List<string> id = new List<string>();
     
    208196        List<double> transfer = new List<double>();
    209197        List<double> run = new List<double>();
     198        List<double> times = new List<double>();
    210199        data.ForEach(i => id.Add(i.TaskID.ToString()));
    211200        data.ForEach(w => wait.Add(w.TotalWaiting));
     
    213202        data.ForEach(r => run.Add(r.TotalRuntime));
    214203
    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);
    221235      }
    222236    }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/Admin.cshtml

    r11030 r11036  
    1919  <button id="UserOverviewButton" class="tabButton">User Overview</button>
    2020  <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>
    2123  //User overview
    2224  <section id="UserOverviewTab" class="tabSection">
    2325    <fieldset id="Users" class="usersField">
    2426      <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">
    2830        <legend>Filter by</legend>
    2931        <label>Date</label>
    30         <input type="checkbox" name="filterChoice" value="Date" checked="checked">
     32        <input type="checkbox" name="filterChoice" value="UserDate" checked="checked">
    3133        <label>Job Name</label>
    3234        <input type="checkbox" name="filterChoice" value="JobName">
     
    3436        <input type="checkbox" name="filterChoice" value="TaskState">
    3537        <label>Limit</label>
    36         <select id="Limit">
     38        <select id="UserLimit">
    3739          <option>20</option>
    3840          <option>50</option>
     
    4244      </fieldset>
    4345    </fieldset>
    44     <fieldset id="Filters">
     46    <fieldset class="filters">
    4547      <legend>Filters</legend>
    46       <fieldset id="FilterDate" class="filterContainer">
     48      <fieldset id="FilterUserDate" class="filterContainer">
    4749        <legend>Date</legend>
    4850        <label>Start</label>
     
    5961        @Html.DropDownList("TaskStates")
    6062      </fieldset>
    61       <button id="Apply">Apply</button>
     63      <button id="UserApply">Apply</button>
    6264    </fieldset>
    6365    <button id="ScrollTop">^</button>
     
    6870    <fieldset id="TaskUsers" class="usersField">
    6971      <legend>Users</legend>
    70       <select id="TaskUserList" class="usersList">
     72      <select id="TaskUserList" class="mainList">
    7173      </select>
    7274      <label>Start</label>
     
    7678    </fieldset>
    7779    <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>
    78148  </section>
    79149}
     
    93163  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.pointLabels.min.js")
    94164
    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)
    97168
    98169  <script>
     
    102173    var limit;
    103174    var pageNumber;
     175    var userId;
     176    var numberTasks = 0;
    104177
    105178    $(document).ready(function () {
     
    112185        onSelect: function () { RefreshTask(); }
    113186      });
    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(); });
    125205
    126206    $("#UserList").change(function () {
     
    140220    function RefreshUser() {
    141221      selectedUser = $("#UserList").val();
    142       limit = $("#Limit").val();
     222      limit = $("#UserLimit").val();
    143223      startDate = null;
    144224      endDate = null;
    145225      jobId = null;
    146226      taskState = null;
    147       if ($("[value='Date']").is(":checked")) {
     227      if ($("[value='UserDate']").is(":checked")) {
    148228        startDate = $('#UserStart').val();
    149229        endDate = $('#UserEnd').val();
     
    155235        taskState = $('#TaskState').val();
    156236      }
    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;
    159240    }
    160241
     
    170251      startDate = $('#TaskStart').val();
    171252      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;
    173274    }
    174275
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/UserTask.cshtml

    r11030 r11036  
    99<button id="TaskOverviewButton" class="tabButton">Task Overview</button>
    1010<section id="TaskInformationTab" class="tabSection">
    11   <fieldset id="FilterChoices">
     11  <fieldset class="filterChoices">
    1212    <legend>Filter by</legend>
    1313    <label>Date</label>
     
    1919    <label>Limit</label>
    2020    <select id="Limit">
    21       <option>10</option>
     21      <option>20</option>
    2222      <option>50</option>
    2323      <option selected="selected">100</option>
     
    2525    </select>
    2626  </fieldset>
    27   <fieldset id="Filters">
     27  <fieldset class="filters">
    2828    <legend>Filters</legend>
    2929    <fieldset id="FilterDate" class="filterContainer">
     
    130130      }
    131131      @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")
    133133      pageNumber = null;
    134134    }
Note: See TracChangeset for help on using the changeset viewer.