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