[11020] | 1 | @* HeuristicLab
|
---|
| 2 | * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 3 | *
|
---|
| 4 | * This file is part of HeuristicLab.
|
---|
| 5 | *
|
---|
| 6 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 7 | * it under the terms of the GNU General Public License as published by
|
---|
| 8 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 9 | * (at your option) any later version.
|
---|
| 10 | *
|
---|
| 11 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 14 | * GNU General Public License for more details.
|
---|
| 15 | *
|
---|
| 16 | * You should have received a copy of the GNU General Public License
|
---|
| 17 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 18 | *@
|
---|
| 19 |
|
---|
[11222] | 20 | @helper UserList(string destinationTag, string url, bool multiline)
|
---|
| 21 | {
|
---|
[11020] | 22 | <script>
|
---|
| 23 | $.ajax({
|
---|
| 24 | url: "@(new HtmlString(url))", datatype: "json", success: function (result) {
|
---|
| 25 | $("#" + "@destinationTag").html("");
|
---|
[11222] | 26 | @if (multiline)
|
---|
| 27 | {
|
---|
[11020] | 28 | @:$("#" + "@destinationTag").attr("size", result.length);
|
---|
| 29 | }
|
---|
[11222] | 30 | else
|
---|
| 31 | {
|
---|
[11020] | 32 | @:$("#" + "@destinationTag").append("<option></option>");
|
---|
| 33 | }
|
---|
| 34 | for (var i = 0; i < result.length; i++) {
|
---|
| 35 | $("#" + "@destinationTag").append("<option>" + result[i] + "</option>");
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | });
|
---|
| 39 | </script>
|
---|
| 40 | }
|
---|
| 41 |
|
---|
[11030] | 42 | @helper UserTaskStats(string destinationTag, string url, string userName, string start, string end)
|
---|
[11020] | 43 | {
|
---|
[11222] | 44 | if (userName != "" || userName != null)
|
---|
| 45 | {
|
---|
[11020] | 46 | <text>
|
---|
| 47 | $.ajax({
|
---|
[11030] | 48 | url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end, datatype: "json", success: function (overallResult) {
|
---|
[11020] | 49 | $.ajax({
|
---|
[11030] | 50 | url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end + "&userName=" + @userName, datatype: "json", success: function (userResult) {
|
---|
[11020] | 51 | $("#" + "@destinationTag").html("");
|
---|
[11246] | 52 | var appendUnits;
|
---|
[11020] | 53 | for (var i = 0; i < userResult.length; i++) {
|
---|
[11246] | 54 | if(userResult[i].Key == "Total Waiting Time" || userResult[i].Key == "Total Transfer Time" || userResult[i].Key == "Total Runtime") {
|
---|
| 55 | appendUnits = " seconds";
|
---|
| 56 | }
|
---|
| 57 | else if (userResult[i].Key == "Memory Required") {
|
---|
| 58 | appendUnits = " KB";
|
---|
| 59 | }
|
---|
| 60 | else {
|
---|
| 61 | appendUnits = "";
|
---|
| 62 | }
|
---|
[11020] | 63 | $("#" + "@destinationTag").append('<label class="barLabel">' + userResult[i].Key + '</label>');
|
---|
[11246] | 64 | $("#" + "@destinationTag").append(
|
---|
| 65 | '<div class="outerBar">' +
|
---|
| 66 | '<div class="innerBar" id="InnerBar' + i + '">' +
|
---|
| 67 | '<label class="innerBarText">' + +userResult[i].Value.toFixed(2) + appendUnits + '</label>' +
|
---|
| 68 | '</div>' +
|
---|
| 69 | '</div>' +
|
---|
| 70 | '<label class="outerBarText" id="OuterText' + i + '">' + +overallResult[i].Value.toFixed(2) + appendUnits + '</label>'
|
---|
| 71 | );
|
---|
[11030] | 72 | $("#InnerBar" + i).css('width',((userResult[i].Value/overallResult[i].Value)*100).toFixed(2) + '%');
|
---|
[11020] | 73 | }
|
---|
| 74 | }
|
---|
| 75 | });
|
---|
| 76 | }
|
---|
| 77 | });
|
---|
| 78 | </text>
|
---|
| 79 | }
|
---|
[11222] | 80 | }
|
---|
| 81 |
|
---|
| 82 | @helper MoreTaskInfo(string url)
|
---|
| 83 | {
|
---|
| 84 | <text>
|
---|
| 85 | function MoreTaskInfo(caller) {
|
---|
| 86 | if($(caller).siblings('.moreInfoTable').length == 0) {
|
---|
| 87 | var taskId = $(caller).attr('id');
|
---|
| 88 | $.ajax({
|
---|
| 89 | url: "@(new HtmlString(url))?taskId=" + taskId, datatype: "json", success: function (result) {
|
---|
[11246] | 90 | var appendUnits;
|
---|
[11222] | 91 | var appendString = '<table class="moreInfoTable"><tr>';
|
---|
| 92 | for (var i = 0; i < result.length; i++) {
|
---|
[11246] | 93 | if (result[i].Key == "Memory Required") {
|
---|
| 94 | appendUnits = " KB";
|
---|
| 95 | }
|
---|
| 96 | else {
|
---|
| 97 | appendUnits = "";
|
---|
| 98 | }
|
---|
[11222] | 99 | if(i % 2 == 0 && i != 0) {
|
---|
| 100 | appendString += '</tr><tr>';
|
---|
| 101 | }
|
---|
| 102 | appendString += '<td class="taskInfoCell"><label class="taskInfoKey">' + result[i].Key + '</label>';
|
---|
[11246] | 103 | appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(2) + appendUnits + '</label></td>';
|
---|
[11222] | 104 | }
|
---|
| 105 | appendString += '</tr></table>'
|
---|
| 106 | $(caller).parent().append(appendString);
|
---|
| 107 | }
|
---|
| 108 | });
|
---|
| 109 | $(caller).html("Less Info");
|
---|
| 110 | }
|
---|
| 111 | else {
|
---|
| 112 | $(caller).siblings('.moreInfoTable').remove();
|
---|
| 113 | $(caller).html("More Info");
|
---|
| 114 | }
|
---|
| 115 | }
|
---|
| 116 | </text>
|
---|
| 117 | }
|
---|
| 118 |
|
---|
[11246] | 119 | @helper MoreSlaveInfo(string url, string startDate, string endDate)
|
---|
[11222] | 120 | {
|
---|
| 121 | <text>
|
---|
| 122 | function MoreSlaveInfo(caller) {
|
---|
[11246] | 123 | CheckFilters();
|
---|
[11222] | 124 | if($(caller).siblings('.moreInfoTable').length == 0) {
|
---|
| 125 | var slaveId = $(caller).attr('id');
|
---|
[11246] | 126 | var GetRequest = "?slaveId=" + slaveId;
|
---|
| 127 | @if (startDate != null) {
|
---|
| 128 | @:if(@(startDate)!=null) {
|
---|
| 129 | @:GetRequest += "&start=" + @startDate;
|
---|
| 130 | @:}
|
---|
| 131 | }
|
---|
| 132 | @if (endDate != null) {
|
---|
| 133 | @:if(@(endDate)!=null) {
|
---|
| 134 | @:GetRequest += "&end=" + @endDate;
|
---|
| 135 | @:}
|
---|
| 136 | }
|
---|
[11222] | 137 | $.ajax({
|
---|
[11246] | 138 | url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function (result) {
|
---|
[11222] | 139 | var appendString = '<table class="moreInfoTable"><tr>';
|
---|
| 140 | for (var i = 0; i < result[0].length; i++) {
|
---|
| 141 | appendString += '<th class="slaveInfoHeader">' + result[0][i].Key + '</th>'
|
---|
| 142 | }
|
---|
| 143 | appendString += '</tr>';
|
---|
| 144 | for (var j = 0; j < result.length; j++) {
|
---|
| 145 | appendString += '<tr>';
|
---|
| 146 | for (var k = 0; k < result[j].length; k++) {
|
---|
| 147 | appendString += '<td class="slaveInfoCell"><label class="slaveInfoValue">' + result[j][k].Value + '</label></td>';
|
---|
| 148 | }
|
---|
| 149 | appendString += '</tr>';
|
---|
| 150 | }
|
---|
| 151 | appendString += '</table>'
|
---|
| 152 | $(caller).parent().append(appendString);
|
---|
| 153 | }
|
---|
| 154 | });
|
---|
| 155 | $(caller).html("Less Info");
|
---|
| 156 | }
|
---|
| 157 | else {
|
---|
| 158 | $(caller).siblings('.moreInfoTable').remove();
|
---|
| 159 | $(caller).html("More Info");
|
---|
| 160 | }
|
---|
| 161 | }
|
---|
| 162 | </text>
|
---|
[11020] | 163 | } |
---|