Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/UserTask.cshtml @ 11222

Last change on this file since 11222 was 11222, checked in by mroscoe, 10 years ago
File size: 5.7 KB
Line 
1@model HeuristicLab.Services.Hive.Statistics.Models.UserModel
2
3@{
4    ViewBag.Title = "Task Information";
5}
6
7<h1>Task Information for User: @Model.UserName</h1>
8<button id="TaskInformationButton" class="tabButton">Task Information</button>
9<button id="TaskOverviewButton" class="tabButton">Task Overview</button>
10<section id="TaskInformationTab" class="tabSection">
11  <fieldset class="filterChoices">
12    <legend>Filter by</legend>
13    <label>Date</label>
14    <input type="checkbox" name="filterChoice" value="Date" checked="checked">
15    <label>Job Name</label>
16    <input type="checkbox" name="filterChoice" value="JobName">
17    <label>Task State</label>
18    <input type="checkbox" name="filterChoice" value="TaskState">
19    <label>Limit</label>
20    <select id="Limit">
21      <option>20</option>
22      <option>50</option>
23      <option selected="selected">100</option>
24      <option>200</option>
25    </select>
26  </fieldset>
27  <fieldset class="filters">
28    <legend>Filters</legend>
29    <fieldset id="FilterDate" class="filterContainer">
30      <legend>Date</legend>
31      <label>Start</label>
32      @Html.TextBox("InfoStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
33      <label>End</label>
34      @Html.TextBox("InfoEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
35    </fieldset>
36    <fieldset id="FilterJobName" class="filterContainer">
37      <legend>Job Name</legend>
38      @Html.DropDownList("JobNames")
39    </fieldset>
40    <fieldset id="FilterTaskState" class="filterContainer">
41      <legend>Task State</legend>
42      @Html.DropDownList("TaskStates")
43    </fieldset>
44    <button id="Apply">Apply</button>
45  </fieldset>
46  <button id="ScrollTop">^</button>
47  <section id="TasksContainer" class="tabDataContainer"></section>
48</section>
49<section id="TaskOverviewTab" class="tabSection">
50  <fieldset id="TaskOverviewFilter" class="usersField">
51    <legend>Filters</legend>
52    <label id="TaskOverviewFilterFirst">Start</label>
53    @Html.TextBox("OverviewStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
54    <label>End</label>
55    @Html.TextBox("OverviewEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
56  </fieldset>
57  <section id="TaskStatsContainer" class="tabDataContainer taskOverview"></section>
58</section>
59
60@section Styles {
61  @Styles.Render("~/Styles/jqPlot/jquery.jqplot")
62  @Styles.Render("~/Content/themes/base/css")
63}
64
65@section Scripts {
66  @Scripts.Render("~/bundles/jqueryui")
67  @Scripts.Render("~/Scripts/CollapsingSection.js")
68  @Scripts.Render("~/Scripts/jquery.scrollstop.js")
69  @Scripts.Render("~/Scripts/jqPlot/jquery.jqplot")
70  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.barRenderer.min.js")
71  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js")
72  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.pointLabels.min.js")
73
74  @ChartHelper.AjaxDataRenderer()
75 
76  <script>
77    $("#Apply").button({
78      icons: {
79        primary: "ui-icon-refresh"
80      }
81    });
82    $("#Apply").click(function () {
83      TaskInformation();
84    });
85
86    $(document).ready(function () {
87      $("#InfoStart, #InfoEnd").datepicker({
88        dateFormat: "yy-mm-dd",
89        onSelect: function () { TaskInformation(); }
90      });
91      $("#OverviewStart, #OverviewEnd").datepicker({
92        dateFormat: "yy-mm-dd",
93        onSelect: function () { TaskOverview(); }
94      });
95    });
96
97    $("[name='filterChoice']").click(function () {
98      var filterName = $(this).val();
99      if ($(this).is(':checked')) {
100        $("#Filter" + filterName).css("display", "inline-block");
101      }
102      else {
103        $("#Filter" + filterName).css("display", "none");
104      }
105    });
106
107    var userName = "@Model.UserName";
108    var limit = $('#Limit').val();
109    var startDate = $('#InfoStart').val();
110    var endDate = $('#InfoEnd').val();
111    var jobId;
112    var taskState;
113    var pageNumber;
114
115    function TaskInformation() {
116      limit = $('#Limit').val();
117      startDate = null;
118      endDate = null;
119      jobId = null;
120      taskState = null;
121      if ($("[value='Date']").is(":checked")) {
122        startDate = $('#InfoStart').val();
123        endDate = $('#InfoEnd').val();
124      }
125      if ($("[value='JobName']").is(':checked')) {
126        jobId = $('#JobNames').val();
127      }
128      if ($("[value='TaskState']").is(':checked')) {
129        taskState = $('#TaskStates').val();
130      }
131      @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"limit","userName","startDate","endDate","jobId","taskState")
132      @ChartHelper.TasksForUser("TasksContainer",Url.Action("UserTask", "ChartData"),"TaskInformation","userName","limit","startDate","endDate","jobId","taskState","pageNumber")
133      pageNumber = null;
134    }
135
136    function TaskOverview() {
137      startDate = $('#OverviewStart').val();
138      endDate = $('#OverviewEnd').val();
139      @AdminHelper.UserTaskStats("TaskStatsContainer",Url.Action("TaskStats", "AdminData"),"userName","startDate","endDate")
140    }
141
142    $(".tabButton").click(function () {
143      var sender = $(this).attr('id');
144      $(".tabButton").css({ 'border-bottom': '1px solid #8297F5', 'background': 'none' });
145      $(this).css({ 'border-bottom': '1px solid #E0E6FF', 'background-color': '#E0E6FF' });
146      $(".tabSection").css('display', 'none');
147      $("#" + sender.slice(0, -6) + "Tab").css('display', 'block');
148    })
149
150    TaskInformation();
151    @ChartHelper.ResizeCharts()
152    @ExceptionHelper.ScrollToException()
153    @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
154  </script>
155}
Note: See TracBrowser for help on using the repository browser.