1 | @model HeuristicLab.Services.Hive.Statistics.Models.AdminModel
|
---|
2 |
|
---|
3 | @{
|
---|
4 | ViewBag.Title = "Admin";
|
---|
5 | }
|
---|
6 |
|
---|
7 | @if(!Model.IsAdmin) {
|
---|
8 | <h1>The user you are logged in as: @Model.UserName, is not an administrator.</h1>
|
---|
9 | }
|
---|
10 | else {
|
---|
11 | <!--[if gte IE 9]>
|
---|
12 | <style type="text/css">
|
---|
13 | .innerBar {
|
---|
14 | filter: none;
|
---|
15 | }
|
---|
16 | </style>
|
---|
17 | <![endif]-->
|
---|
18 | <h1>Welcome to the administrator page @Model.UserName!</h1>
|
---|
19 | <button id="UserOverviewButton" class="tabButton">User Overview</button>
|
---|
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>
|
---|
23 | //User overview
|
---|
24 | <section id="UserOverviewTab" class="tabSection">
|
---|
25 | <fieldset id="Users" class="usersField">
|
---|
26 | <legend>Users</legend>
|
---|
27 | <select id="UserList" class="mainList">
|
---|
28 | </select>
|
---|
29 | <fieldset class="filterChoices">
|
---|
30 | <legend>Filter by</legend>
|
---|
31 | <label>Date</label>
|
---|
32 | <input type="checkbox" name="filterChoice" value="UserDate" checked="checked">
|
---|
33 | <label>Job Name</label>
|
---|
34 | <input type="checkbox" name="filterChoice" value="JobName">
|
---|
35 | <label>Task State</label>
|
---|
36 | <input type="checkbox" name="filterChoice" value="TaskState">
|
---|
37 | <label>Limit</label>
|
---|
38 | <select id="UserLimit">
|
---|
39 | <option>20</option>
|
---|
40 | <option>50</option>
|
---|
41 | <option selected="selected">100</option>
|
---|
42 | <option>200</option>
|
---|
43 | </select>
|
---|
44 | </fieldset>
|
---|
45 | </fieldset>
|
---|
46 | <fieldset class="filters">
|
---|
47 | <legend>Filters</legend>
|
---|
48 | <fieldset id="FilterUserDate" class="filterContainer">
|
---|
49 | <legend>Date</legend>
|
---|
50 | <label>Start</label>
|
---|
51 | @Html.TextBox("UserStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
52 | <label>End</label>
|
---|
53 | @Html.TextBox("UserEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
54 | </fieldset>
|
---|
55 | <fieldset id="FilterJobName" class="filterContainer">
|
---|
56 | <legend>Job Name</legend>
|
---|
57 | @Html.DropDownList("JobNames")
|
---|
58 | </fieldset>
|
---|
59 | <fieldset id="FilterTaskState" class="filterContainer">
|
---|
60 | <legend>Task State</legend>
|
---|
61 | @Html.DropDownList("TaskStates")
|
---|
62 | </fieldset>
|
---|
63 | <button id="UserApply">Apply</button>
|
---|
64 | </fieldset>
|
---|
65 | <section id="TasksContainer" class="tabDataContainer"></section>
|
---|
66 | </section>
|
---|
67 | //Task overview
|
---|
68 | <section id="TaskOverviewTab" class="tabSection">
|
---|
69 | <fieldset id="TaskUsers" class="usersField">
|
---|
70 | <legend>Users</legend>
|
---|
71 | <select id="TaskUserList" class="mainList">
|
---|
72 | </select>
|
---|
73 | <label>Start</label>
|
---|
74 | @Html.TextBox("TaskStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
75 | <label>End</label>
|
---|
76 | @Html.TextBox("TaskEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
77 | </fieldset>
|
---|
78 | <section id="TaskStatsContainer" class="tabDataContainer taskOverview"></section>
|
---|
79 | </section>
|
---|
80 | //Slave overview
|
---|
81 | <section id="SlaveOverviewTab" class="tabSection">
|
---|
82 | <fieldset class="filterChoices">
|
---|
83 | <legend>Filter by</legend>
|
---|
84 | <label>Date</label>
|
---|
85 | <input type="checkbox" name="filterChoice" value="SlaveDate" checked="checked">
|
---|
86 | <label>Users</label>
|
---|
87 | <input type="checkbox" name="filterChoice" value="User">
|
---|
88 | <label>Limit</label>
|
---|
89 | <select id="SlaveLimit">
|
---|
90 | <option>20</option>
|
---|
91 | <option>50</option>
|
---|
92 | <option selected="selected">100</option>
|
---|
93 | <option>200</option>
|
---|
94 | </select>
|
---|
95 | </fieldset>
|
---|
96 | <fieldset class="filters">
|
---|
97 | <legend>Filters</legend>
|
---|
98 | <fieldset id="FilterSlaveDate" class="filterContainer">
|
---|
99 | <legend>Date</legend>
|
---|
100 | <label>Start</label>
|
---|
101 | @Html.TextBox("SlaveStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
102 | <label>End</label>
|
---|
103 | @Html.TextBox("SlaveEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
104 | </fieldset>
|
---|
105 | <fieldset id="FilterUser" class="filterContainer">
|
---|
106 | <legend>User</legend>
|
---|
107 | <select id="SlaveUserList">
|
---|
108 | </select>
|
---|
109 | </fieldset>
|
---|
110 | <button id="SlaveApply">Apply</button>
|
---|
111 | </fieldset>
|
---|
112 | <section id="SlavesContainer" class="tabDataContainer"></section>
|
---|
113 | </section>
|
---|
114 | //Exception overview
|
---|
115 | <section id="ExceptionOverviewTab" class="tabSection">
|
---|
116 | <fieldset class="filterChoices">
|
---|
117 | <legend>Filter by</legend>
|
---|
118 | <label>Date</label>
|
---|
119 | <input type="checkbox" name="filterChoice" value="ExceptionDate" checked="checked">
|
---|
120 | <label>Slave</label>
|
---|
121 | <input type="checkbox" name="filterChoice" value="ExceptionSlave">
|
---|
122 | <label>Limit</label>
|
---|
123 | <select id="ExceptionLimit">
|
---|
124 | <option>20</option>
|
---|
125 | <option>50</option>
|
---|
126 | <option selected="selected">100</option>
|
---|
127 | <option>200</option>
|
---|
128 | </select>
|
---|
129 | </fieldset>
|
---|
130 | <fieldset class="filters">
|
---|
131 | <legend>Filters</legend>
|
---|
132 | <fieldset id="FilterExceptionDate" class="filterContainer">
|
---|
133 | <legend>Date</legend>
|
---|
134 | <label>Start</label>
|
---|
135 | @Html.TextBox("ExceptionStart", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
136 | <label>End</label>
|
---|
137 | @Html.TextBox("ExceptionEnd", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
138 | </fieldset>
|
---|
139 | <fieldset id="FilterExceptionSlave" class="filterContainer">
|
---|
140 | <legend>Slave</legend>
|
---|
141 | @Html.DropDownList("Slaves")
|
---|
142 | </fieldset>
|
---|
143 | <button id="ExceptionApply">Apply</button>
|
---|
144 | </fieldset>
|
---|
145 | <section id="ExceptionContainer" class="tabDataContainer"></section>
|
---|
146 | </section>
|
---|
147 | <button id="ScrollTop">^</button>
|
---|
148 | }
|
---|
149 |
|
---|
150 | @section Styles {
|
---|
151 | @Styles.Render("~/Styles/jqPlot/jquery.jqplot")
|
---|
152 | @Styles.Render("~/Content/themes/base/css")
|
---|
153 | }
|
---|
154 |
|
---|
155 | @section Scripts {
|
---|
156 | @Scripts.Render("~/bundles/jqueryui")
|
---|
157 | @Scripts.Render("~/Scripts/CollapsingSection.js")
|
---|
158 | @Scripts.Render("~/Scripts/jquery.scrollstop.js")
|
---|
159 | @Scripts.Render("~/Scripts/jqPlot/jquery.jqplot")
|
---|
160 | @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.barRenderer.min.js")
|
---|
161 | @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js")
|
---|
162 | @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.pointLabels.min.js")
|
---|
163 |
|
---|
164 | @AdminHelper.UserList("UserList", Url.Action("UserList", "AdminData"), true)
|
---|
165 | @AdminHelper.UserList("TaskUserList", Url.Action("UserList", "AdminData"), false)
|
---|
166 | @AdminHelper.UserList("SlaveUserList", Url.Action("UserList", "AdminData"), false)
|
---|
167 |
|
---|
168 | <script>
|
---|
169 | var startDate;
|
---|
170 | var endDate;
|
---|
171 | var selectedUser;
|
---|
172 | var selectedSlave;
|
---|
173 | var limit;
|
---|
174 | var pageNumber;
|
---|
175 | var userId;
|
---|
176 |
|
---|
177 | $(document).ready(function () {
|
---|
178 | $("#UserStart, #UserEnd").datepicker({
|
---|
179 | dateFormat: "yy-mm-dd",
|
---|
180 | onSelect: function () { RefreshUser(); }
|
---|
181 | });
|
---|
182 | $("#TaskStart, #TaskEnd").datepicker({
|
---|
183 | dateFormat: "yy-mm-dd",
|
---|
184 | onSelect: function () { RefreshTask(); }
|
---|
185 | });
|
---|
186 | $("#SlaveStart, #SlaveEnd").datepicker({
|
---|
187 | dateFormat: "yy-mm-dd",
|
---|
188 | onSelect: function () { RefreshSlave(); }
|
---|
189 | });
|
---|
190 | $("#ExceptionStart, #ExceptionEnd").datepicker({
|
---|
191 | dateFormat: "yy-mm-dd",
|
---|
192 | onSelect: function () { RefreshException(); }
|
---|
193 | });
|
---|
194 | });
|
---|
195 |
|
---|
196 | $("#UserApply").button({ icons: { primary: "ui-icon-refresh" } });
|
---|
197 | $("#UserApply").click(function () { RefreshUser(); });
|
---|
198 |
|
---|
199 | $("#SlaveApply").button({ icons: { primary: "ui-icon-refresh" } });
|
---|
200 | $("#SlaveApply").click(function () { RefreshSlave(); });
|
---|
201 |
|
---|
202 | $("#ExceptionApply").button({ icons: { primary: "ui-icon-refresh" } });
|
---|
203 | $("#ExceptionApply").click(function () { RefreshException(); });
|
---|
204 |
|
---|
205 | $("#UserList").change(function () {
|
---|
206 | RefreshUser();
|
---|
207 | });
|
---|
208 |
|
---|
209 | $("[name='filterChoice']").click(function () {
|
---|
210 | var filterName = $(this).val();
|
---|
211 | if ($(this).is(':checked')) {
|
---|
212 | $("#Filter" + filterName).css("display", "inline-block");
|
---|
213 | }
|
---|
214 | else {
|
---|
215 | $("#Filter" + filterName).css("display", "none");
|
---|
216 | }
|
---|
217 | });
|
---|
218 |
|
---|
219 | $(".tabButton").click(function () {
|
---|
220 | var sender = $(this).attr('id');
|
---|
221 | $(".tabButton").css({ 'border-bottom': '1px solid #8297F5', 'background': 'none' });
|
---|
222 | $(this).css({ 'border-bottom': '1px solid #E0E6FF', 'background-color': '#E0E6FF' });
|
---|
223 | $(".tabSection").css('display', 'none');
|
---|
224 | $("#" + sender.slice(0, -6) + "Tab").css('display', 'block');
|
---|
225 | })
|
---|
226 |
|
---|
227 | //User Overview
|
---|
228 | function RefreshUser() {
|
---|
229 | CheckFilters("User");
|
---|
230 | @ExceptionHelper.UserExceptions("TasksContainer", Url.Action("TaskExceptions", "ExceptionData"), "limit", "selectedUser", "startDate", "endDate", "jobId", "taskState")
|
---|
231 | @ChartHelper.TasksForUser("TasksContainer",Url.Action("UserTask", "ChartData"), "RefreshUser", "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState", "pageNumber")
|
---|
232 | pageNumber = null;
|
---|
233 | }
|
---|
234 |
|
---|
235 | //Task Overview
|
---|
236 | $("#TaskUserList").change(function () {
|
---|
237 | RefreshTask();
|
---|
238 | });
|
---|
239 |
|
---|
240 | function RefreshTask() {
|
---|
241 | CheckFilters("Task");
|
---|
242 | @AdminHelper.UserTaskStats("TaskStatsContainer", Url.Action("TaskStats", "AdminData"), "selectedUser", "startDate", "endDate")
|
---|
243 | }
|
---|
244 |
|
---|
245 | //Slave Overview
|
---|
246 | function RefreshSlave() {
|
---|
247 | CheckFilters("Slave");
|
---|
248 | @ChartHelper.SlaveInfoChart("SlavesContainer", Url.Action("SlaveInfo", "ChartData"), "limit", false, "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber")
|
---|
249 | pageNumber = null;
|
---|
250 | }
|
---|
251 |
|
---|
252 | //Exceptions Overview
|
---|
253 | $("#ExceptionSlaveList").change(function () {
|
---|
254 | RefreshException();
|
---|
255 | });
|
---|
256 |
|
---|
257 | function RefreshException() {
|
---|
258 | CheckFilters("Exception");
|
---|
259 | @ExceptionHelper.UserExceptions("ExceptionContainer",Url.Action("TaskExceptions","ExceptionData"),"limit",null,"startDate","endDate",null,null,"selectedSlave")
|
---|
260 | @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer",Url.Action("SlaveExceptions","ExceptionData"),"limit","startDate","endDate","selectedSlave","RefreshException","pageNumber")
|
---|
261 | }
|
---|
262 | @ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo","ChartData"),"limit","startDate","endDate")
|
---|
263 |
|
---|
264 | //General Chart Methods
|
---|
265 | function CheckFilters(currentTab) {
|
---|
266 | startDate = null;
|
---|
267 | endDate = null;
|
---|
268 | switch(currentTab) {
|
---|
269 | case "User":
|
---|
270 | selectedUser = $("#UserList").val();
|
---|
271 | jobId = null;
|
---|
272 | taskState = null;
|
---|
273 | limit = $("#UserLimit").val();
|
---|
274 | if ($("[value='UserDate']").is(":checked")) {
|
---|
275 | startDate = $('#UserStart').val();
|
---|
276 | endDate = $('#UserEnd').val();
|
---|
277 | }
|
---|
278 | if ($("[value='JobName']").is(':checked')) {
|
---|
279 | jobId = $('#JobNames').val();
|
---|
280 | }
|
---|
281 | if ($("[value='TaskState']").is(':checked')) {
|
---|
282 | taskState = $('#TaskStates').val();
|
---|
283 | }
|
---|
284 | break;
|
---|
285 | case "Task":
|
---|
286 | selectedUser = $("#TaskUserList").val();
|
---|
287 | startDate = $('#TaskStart').val();
|
---|
288 | endDate = $('#TaskEnd').val();
|
---|
289 | break;
|
---|
290 | case "Slave":
|
---|
291 | selectedUser = null;
|
---|
292 | limit = $("#SlaveLimit").val();
|
---|
293 | if ($("[value='SlaveDate']").is(":checked")) {
|
---|
294 | startDate = $('#SlaveStart').val();
|
---|
295 | endDate = $('#SlaveEnd').val();
|
---|
296 | }
|
---|
297 | if ($("[value='User']").is(':checked')) {
|
---|
298 | selectedUser = $('#SlaveUserList').val();
|
---|
299 | }
|
---|
300 | break;
|
---|
301 | case "Exception":
|
---|
302 | selectedSlave = null;
|
---|
303 | limit = $("#ExceptionLimit").val();
|
---|
304 | if ($("[value='ExceptionDate']").is(":checked")) {
|
---|
305 | startDate = $('#ExceptionStart').val();
|
---|
306 | endDate = $('#ExceptionEnd').val();
|
---|
307 | }
|
---|
308 | if ($("[value='ExceptionSlave']").is(':checked')) {
|
---|
309 | selectedSlave = $('#Slaves').val();
|
---|
310 | }
|
---|
311 | }
|
---|
312 | }
|
---|
313 |
|
---|
314 | @ChartHelper.ResizeCharts()
|
---|
315 | @ExceptionHelper.ScrollToException()
|
---|
316 | @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
|
---|
317 | @AdminHelper.MoreSlaveInfo(Url.Action("MoreSlaveInfo","AdminData"))
|
---|
318 | </script>
|
---|
319 | } |
---|