Changeset 11222 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code
- Timestamp:
- 07/24/14 09:16:42 (10 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/AdminHelper.cshtml
r11030 r11222 18 18 *@ 19 19 20 @helper UserList(string destinationTag, string url, bool multiline) { 20 @helper UserList(string destinationTag, string url, bool multiline) 21 { 21 22 <script> 22 23 $.ajax({ 23 24 url: "@(new HtmlString(url))", datatype: "json", success: function (result) { 24 25 $("#" + "@destinationTag").html(""); 25 @if(multiline) { 26 @if (multiline) 27 { 26 28 @:$("#" + "@destinationTag").attr("size", result.length); 27 29 } 28 else { 30 else 31 { 29 32 @:$("#" + "@destinationTag").append("<option></option>"); 30 33 } … … 39 42 @helper UserTaskStats(string destinationTag, string url, string userName, string start, string end) 40 43 { 41 if (userName != "" || userName != null) { 44 if (userName != "" || userName != null) 45 { 42 46 <text> 43 47 $.ajax({ … … 58 62 } 59 63 } 64 65 @helper MoreTaskInfo(string url) 66 { 67 <text> 68 function MoreTaskInfo(caller) { 69 if($(caller).siblings('.moreInfoTable').length == 0) { 70 var taskId = $(caller).attr('id'); 71 $.ajax({ 72 url: "@(new HtmlString(url))?taskId=" + taskId, datatype: "json", success: function (result) { 73 var appendString = '<table class="moreInfoTable"><tr>'; 74 for (var i = 0; i < result.length; i++) { 75 if(i % 2 == 0 && i != 0) { 76 appendString += '</tr><tr>'; 77 } 78 appendString += '<td class="taskInfoCell"><label class="taskInfoKey">' + result[i].Key + '</label>'; 79 appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(4) + '</label></td>'; 80 } 81 appendString += '</tr></table>' 82 $(caller).parent().append(appendString); 83 } 84 }); 85 $(caller).html("Less Info"); 86 } 87 else { 88 $(caller).siblings('.moreInfoTable').remove(); 89 $(caller).html("More Info"); 90 } 91 } 92 </text> 93 } 94 95 @helper MoreSlaveInfo(string url) 96 { 97 <text> 98 function MoreSlaveInfo(caller) { 99 if($(caller).siblings('.moreInfoTable').length == 0) { 100 var slaveId = $(caller).attr('id'); 101 $.ajax({ 102 url: "@(new HtmlString(url))?slaveId=" + slaveId, datatype: "json", success: function (result) { 103 var appendString = '<table class="moreInfoTable"><tr>'; 104 for (var i = 0; i < result[0].length; i++) { 105 appendString += '<th class="slaveInfoHeader">' + result[0][i].Key + '</th>' 106 } 107 appendString += '</tr>'; 108 for (var j = 0; j < result.length; j++) { 109 appendString += '<tr>'; 110 for (var k = 0; k < result[j].length; k++) { 111 appendString += '<td class="slaveInfoCell"><label class="slaveInfoValue">' + result[j][k].Value + '</label></td>'; 112 } 113 appendString += '</tr>'; 114 } 115 appendString += '</table>' 116 $(caller).parent().append(appendString); 117 } 118 }); 119 $(caller).html("Less Info"); 120 } 121 else { 122 $(caller).siblings('.moreInfoTable').remove(); 123 $(caller).html("More Info"); 124 } 125 } 126 </text> 127 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
r11196 r11222 250 250 $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','none'); 251 251 252 //Set variable for tracking jobId and open first job grouping 253 var currentJob = result[0].JobId; 254 $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[0].JobId + '"><h1>' + result[0].JobName + '</h1></section>'); 255 252 256 //For each result create a seperate collapsable section with a chart and info label 253 257 for(var i = 0; i < result.length; i++){ 254 $("#" + "@(destinationTag)").append( 258 if(currentJob != result[i].JobId) { 259 $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[i].JobId + '"><h1>' + result[i].JobName + '</h1></section>'); 260 currentJob = result[i].JobId; 261 } 262 $("#" + currentJob).append( 255 263 '<section class="chartContainer">' + 256 '<h1 class="title" id="@(destinationTag)' + result[i]. Key + 'PlotTitle">Task ' + result[i].Key+ '</h1>' +264 '<h1 class="title" id="@(destinationTag)' + result[i].TaskId + 'PlotTitle">Task ' + result[i].TaskId + '</h1>' + 257 265 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + 258 266 '<div id="@(destinationTag)Plot' + i + '"></div>' + 259 267 '<label id="@(destinationTag)PlotInfo' + i + '"></label>' + 268 '<a id="' + result[i].TaskId + '" class="moreInfo" onclick="MoreTaskInfo(this)">More Info</a>' + 260 269 '</section>' 261 270 ) … … 263 272 //those of errors 264 273 $(".errorTask","#" + "@(destinationTag)").each(function() { 265 if($(this).html()==result[i]. Key) {266 $("#@(destinationTag)" + result[i]. Key+ "PlotTitle").css("color","red");267 $("#@(destinationTag)" + result[i]. Key+ "PlotTitle").append(" - ERROR");274 if($(this).html()==result[i].TaskId) { 275 $("#@(destinationTag)" + result[i].TaskId + "PlotTitle").css("color","red"); 276 $("#@(destinationTag)" + result[i].TaskId + "PlotTitle").append(" - ERROR"); 268 277 $(".errorContainer, .errorTitle, .underline","#@(destinationTag)").css('display','inline-block'); 269 278 $(this).css('display','inline-block'); … … 271 280 } 272 281 }); 273 waitTime = [result[i]. Value[0]];274 transferTime = [result[i]. Value[1]];275 runTime = [result[i]. Value[2]];282 waitTime = [result[i].TotalWaiting]; 283 transferTime = [result[i].TotalTransfer]; 284 runTime = [result[i].TotalRuntime]; 276 285 window["@(destinationTag)Plot" + i] = $.jqplot("@(destinationTag)Plot" + i, [waitTime,transferTime,runTime], { 277 286 seriesDefaults:{ … … 307 316 upon data in the label below the chart */ 308 317 $("#" + "@(destinationTag)Plot" + i).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { 309 $(this). siblings("label").html(seriesDescriptions[seriesIndex] + ": " + data[1]);318 $(this).next("label").html(seriesDescriptions[seriesIndex] + ": " + data[1]); 310 319 }); 311 320 … … 551 560 $('#' + destTag).append( 552 561 '<section class="chartContainer">' + 553 '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0]. SlaveID+ '</h1>' +562 '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' + 554 563 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + 555 564 '<div id="' + destTag + slaveChartNames[0] + 'Plot' + i + '"></div>' + 556 565 '<div id="' + destTag + slaveChartNames[1] + 'Plot' + i + '"></div>' + 557 566 '<div id="' + destTag + slaveChartNames[2] + 'Plot' + i + '"></div>' + 567 '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' + 558 568 '</section>'); 559 569 for(j = 0; j < result[i].length; j++) { -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml
r11084 r11222 102 102 $("#" + "@destinationTag").append(ErrorHTML); 103 103 } 104 else if("@(destinationTag)" == "ExceptionContainer") { 105 $("#@(destinationTag)").append( 106 '<section class="chartContainer">' + 107 '<h1 class="title">No errors found for the specified filters!</h1>' + 108 '</section>' 109 ) 110 } 104 111 } 105 112 }); … … 144 151 @helper ShowErrors(string destinationTag) { 145 152 <text> 146 $("#@(destinationTag)"). children(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','inline-block');153 $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','inline-block'); 147 154 </text> 148 155 } … … 200 207 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + 201 208 '<label id="' + result[i][0] + 'ErrorMessage">Error Message: ' + result[i][1] + '</label>' + 202 '<label id="' + result[i][0] + 'Client">Slave: <a onclick="ShowSlaveInfo(this)">' + result[i][2] + '</a></label>' + 203 '<label id="' + result[i][0] + 'User">User Name: ' + result[i][3] + '</label>' + 204 '<label id="' + result[i][0] + 'Date">Date/Time: ' + result[i][4] + '</label>' + 209 '<label id="' + result[i][0] + 'Client">Slave: <a id="' + result[i][2] + '" onclick="ShowSlaveInfo(this)">' + result[i][3] + '</a></label>' + 210 '<label id="' + result[i][0] + 'User">User Name: ' + result[i][4] + '</label>' + 211 '<label id="' + result[i][0] + 'Job">Job Name: ' + result[i][5] + '</label>' + 212 '<label id="' + result[i][0] + 'Date">Date/Time: ' + result[i][6] + '</label>' + 205 213 '</section>' 206 214 ); … … 229 237 //Opens a sub-container with slave information 230 238 function ShowSlaveInfo(caller) { 239 var taskSlaveId = $(caller).attr('id'); 231 240 if($(caller).parent().parent().children(".chartContainer").length == 0) { 232 @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null," $(caller).html()")241 @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId") 233 242 } 234 243 else {
Note: See TracChangeset
for help on using the changeset viewer.