Changeset 11246 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code
- Timestamp:
- 07/30/14 16:41:08 (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
r11222 r11246 50 50 url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end + "&userName=" + @userName, datatype: "json", success: function (userResult) { 51 51 $("#" + "@destinationTag").html(""); 52 var appendUnits; 52 53 for (var i = 0; i < userResult.length; i++) { 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 } 53 63 $("#" + "@destinationTag").append('<label class="barLabel">' + userResult[i].Key + '</label>'); 54 $("#" + "@destinationTag").append('<div class="outerBar"><div class="innerBar" id="InnerBar' + i + '"><label class="innerBarText">' + +userResult[i].Value.toFixed(4) + '</label></div></div><label class="outerBarText" id="OuterText' + i + '">' + +overallResult[i].Value.toFixed(4) + '</label>'); 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 ); 55 72 $("#InnerBar" + i).css('width',((userResult[i].Value/overallResult[i].Value)*100).toFixed(2) + '%'); 56 73 } … … 71 88 $.ajax({ 72 89 url: "@(new HtmlString(url))?taskId=" + taskId, datatype: "json", success: function (result) { 90 var appendUnits; 73 91 var appendString = '<table class="moreInfoTable"><tr>'; 74 92 for (var i = 0; i < result.length; i++) { 93 if (result[i].Key == "Memory Required") { 94 appendUnits = " KB"; 95 } 96 else { 97 appendUnits = ""; 98 } 75 99 if(i % 2 == 0 && i != 0) { 76 100 appendString += '</tr><tr>'; 77 101 } 78 102 appendString += '<td class="taskInfoCell"><label class="taskInfoKey">' + result[i].Key + '</label>'; 79 appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed( 4)+ '</label></td>';103 appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(2) + appendUnits + '</label></td>'; 80 104 } 81 105 appendString += '</tr></table>' … … 93 117 } 94 118 95 @helper MoreSlaveInfo(string url )119 @helper MoreSlaveInfo(string url, string startDate, string endDate) 96 120 { 97 121 <text> 98 122 function MoreSlaveInfo(caller) { 123 CheckFilters(); 99 124 if($(caller).siblings('.moreInfoTable').length == 0) { 100 125 var slaveId = $(caller).attr('id'); 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 } 101 137 $.ajax({ 102 url: "@(new HtmlString(url)) ?slaveId=" + slaveId, datatype: "json", success: function (result) {138 url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function (result) { 103 139 var appendString = '<table class="moreInfoTable"><tr>'; 104 140 for (var i = 0; i < result[0].length; i++) { -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
r11222 r11246 36 36 } 37 37 38 @helper LineChartTime(string destinationTag, string url, string title = "", double? minY = null, double? maxY = null, string axisYFormat = null) { 38 @helper LineChartTime(string destinationTag, string url, string title = "", double? minY = null, double? maxY = null, string axisYFormat = null) 39 { 39 40 <script> 40 41 var @(destinationTag)Plot = $.jqplot("@destinationTag", "@url", { … … 89 90 } 90 91 91 @helper RefreshChart(string destinationTag, string url, string startDate, string endDate, double? minY=null, double? maxY=null) { 92 @helper RefreshChart(string destinationTag, string url, string startDate, string endDate, double? minY = null, double? maxY = null) 93 { 92 94 <text> 93 95 $.ajax({url: "@(new HtmlString(url))?start=" + @startDate + "&end=" + @endDate, datatype: "json", success: function(result) { … … 97 99 //Resets only the xaxis, still need to resize y with given min/max 98 100 @(destinationTag)Plot.replot({resetAxes:true}); 99 @if(minY != null) { 101 @if (minY != null) 102 { 100 103 //If min Y was provided set the plot's min Y value 101 104 @:@(destinationTag)Plot.axes.yaxis.min = @minY; 102 105 } 103 @if(maxY != null) { 106 @if (maxY != null) 107 { 104 108 //If max Y was provided set the plot's max Y value 105 109 @:@(destinationTag)Plot.axes.yaxis.max = @maxY; … … 162 166 <text> 163 167 if(@(records).length > @limit) { 164 $("#@container").append('<label class="pageTitle">Page: </label>')168 var appendPages = '<section class="pageContainer"><label class="pageTitle">Page: </label>'; 165 169 var pages = Math.floor(@(records).length/@(limit)) + 1; 166 170 for(var i=0; i < pages; i++) { 167 $("#" + "@container").append('<a id="@(container)Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>') 168 } 171 appendPages += '<a id="@(container)Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>'; 172 } 173 appendPages += '</section>'; 174 $("#@container").append(appendPages); 169 175 if(@currentPage != null) { 170 176 $("#@(container)Page" + @currentPage).css('color','#F7921D'); … … 190 196 } 191 197 192 @helper Task sForUser(string destinationTag, string url, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string pageNumber = null)198 @helper TaskContainers(string destinationTag, string url, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string pageNumber = null) 193 199 { 194 200 <text> … … 235 241 } 236 242 else { 237 var waitTime;238 var transferTime;239 var runTime;240 var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"];241 242 243 //Checks if multipage display, if it is then trims results to 243 244 //the results for the page to be displayed 244 245 @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber) 245 246 246 //Globally accesible, for use when resizing, eliminates extra DB request247 window["numberTasks"] = result.length;248 249 247 //Set display of all errors to none, errors matching the tasks will be reset below 250 248 $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','none'); … … 252 250 //Set variable for tracking jobId and open first job grouping 253 251 var currentJob = result[0].JobId; 254 $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[0].JobId + '"><h1>' + result[0].JobName + '</h1></section>');255 252 256 253 //For each result create a seperate collapsable section with a chart and info label 257 254 for(var i = 0; i < result.length; i++){ 258 if(currentJob != result[i].JobId) { 259 $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[i].JobId + '"><h1>' + result[i].JobName + '</h1></section>'); 255 if(currentJob != result[i].JobId || i == 0) { 256 $("#@(destinationTag)").append( 257 '<section class="jobTaskGroup" id="' + result[i].JobId + '">' + 258 '<h1>' + result[i].JobName + '</h1>' + 259 '<section class="chartContainer">' + 260 '<h1 class="title" id="@(destinationTag)' + result[i].JobId + 'PlotTitle">Job Overview - ' + result[i].JobName + '</h1>' + 261 '<button class="collapse" onclick="LoadJob(this)">+</button>' + 262 '<div id="@(destinationTag)JobOverviewPlot' + i + '"></div>' + 263 '<label id="@(destinationTag)JobOverviewPlotInfo' + i + '"></label>' + 264 '</section>' + 265 '</section>' 266 ); 267 CollapsedByDefault(document.getElementById("@(destinationTag)JobOverviewPlot" + i)); 260 268 currentJob = result[i].JobId; 261 269 } … … 263 271 '<section class="chartContainer">' + 264 272 '<h1 class="title" id="@(destinationTag)' + result[i].TaskId + 'PlotTitle">Task ' + result[i].TaskId + '</h1>' + 265 '<button class="collapse" onclick=" CollapseSection(this)">+</button>' +273 '<button class="collapse" onclick="LoadTask(this)">+</button>' + 266 274 '<div id="@(destinationTag)Plot' + i + '"></div>' + 267 275 '<label id="@(destinationTag)PlotInfo' + i + '"></label>' + 268 276 '<a id="' + result[i].TaskId + '" class="moreInfo" onclick="MoreTaskInfo(this)">More Info</a>' + 269 277 '</section>' 270 ) 278 ); 271 279 //Re-enables the error display if any of the tasks on the page have Ids matching 272 280 //those of errors … … 280 288 } 281 289 }); 282 waitTime = [result[i].TotalWaiting]; 283 transferTime = [result[i].TotalTransfer]; 284 runTime = [result[i].TotalRuntime]; 285 window["@(destinationTag)Plot" + i] = $.jqplot("@(destinationTag)Plot" + i, [waitTime,transferTime,runTime], { 290 CollapsedByDefault(document.getElementById("@(destinationTag)Plot" + i)); 291 } 292 } 293 }}); 294 </text> 295 } 296 297 @helper LoadJob(string url) 298 { 299 <text> 300 function LoadJob(caller) { 301 CheckFilters(); 302 if($(caller).next().html()=="") { 303 var plotName = $(caller).next().attr('id'); 304 //Set current job id 305 var jobId = $(caller).parent().parent().attr('id'); 306 var GetRequest = "?jobId=" + jobId; 307 308 $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 309 CollapseSection(caller); 310 var seriesDescription = ['Waiting','Transferring','Calculating','Finished','Error']; 311 window[plotName] = $.jqplot(plotName, [[result.Wait],[result.Transfer],[result.Calculate],[result.Finish],[result.Error]], { 286 312 seriesDefaults:{ 287 313 renderer:$.jqplot.BarRenderer, 288 314 shadowAngle: 135, 289 pointLabels: {show: true, formatString: '%. 3f'}315 pointLabels: {show: true, formatString: '%.0f'} 290 316 }, 291 317 series:[ 292 {label:'Waiting'}, 293 {label:'Transferring'}, 294 {label:'Calculating'} 318 {label:seriesDescription[0]}, 319 {label:seriesDescription[1]}, 320 {label:seriesDescription[2]}, 321 {label:seriesDescription[3]}, 322 {label:seriesDescription[4]} 295 323 ], 296 324 legend: { … … 306 334 }, 307 335 yaxis: { 308 pad : 0336 padMax: 1.5 309 337 } 310 338 }, … … 315 343 /* Bind a datalistener to each chart and display details of clicked 316 344 upon data in the label below the chart */ 317 $("#" + "@(destinationTag)Plot" + i).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {318 $(this).next("label").html( seriesDescriptions[seriesIndex] + ": " + data[1]);345 $("#" + plotName).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { 346 $(this).next("label").html("Tasks " + seriesDescription[seriesIndex] + ": " + data[1]); 319 347 }); 320 321 CollapsedByDefault(document.getElementById("@(destinationTag)Plot" + i)); 322 } 323 } 324 }}); 348 }}); 349 } 350 else { 351 CollapseSection(caller); 352 } 353 } 354 </text> 355 } 356 357 @helper LoadTask(string url) 358 { 359 <text> 360 function LoadTask(caller) { 361 CheckFilters(); 362 if($(caller).next().html()=="") { 363 var plotName = $(caller).next().attr('id'); 364 //Set current slave id 365 var currentTask = $(caller).siblings('a.moreInfo').attr('id'); 366 var GetRequest = "?taskId=" + currentTask; 367 368 $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 369 var waitTime; 370 var transferTime; 371 var runTime; 372 var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"]; 373 CollapseSection(caller); 374 for(i = 0; i < result.length; i++) { 375 waitTime = [result[i].TotalWaiting]; 376 transferTime = [result[i].TotalTransfer]; 377 runTime = [result[i].TotalRuntime]; 378 window[plotName] = $.jqplot(plotName, [waitTime,transferTime,runTime], { 379 seriesDefaults:{ 380 renderer:$.jqplot.BarRenderer, 381 shadowAngle: 135, 382 pointLabels: {show: true, formatString: '%.3f'} 383 }, 384 series:[ 385 {label:'Waiting'}, 386 {label:'Transferring'}, 387 {label:'Calculating'} 388 ], 389 legend: { 390 show: true, 391 location: 'e', 392 placement: 'outside' 393 }, 394 axes: { 395 xaxis: { 396 renderer: $.jqplot.CategoryAxisRenderer, 397 showLabel: false, 398 pad: 0 399 }, 400 yaxis: { 401 pad: 0 402 } 403 }, 404 cursor: { 405 showTooltip: false 406 } 407 }); 408 /* Bind a datalistener to each chart and display details of clicked 409 upon data in the label below the chart */ 410 $("#" + plotName).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { 411 $(this).next("label").html(seriesDescriptions[seriesIndex] + ": " + data[1].toFixed(4) + " seconds"); 412 }); 413 } 414 }}); 415 } 416 else { 417 CollapseSection(caller); 418 } 419 } 325 420 </text> 326 421 } … … 467 562 } 468 563 469 @helper Slave InfoChart(string destinationTag, string url, string limit, bool singleSlave, string startDate = null, string endDate = null, string userName = null, string functionName = null, string pageNumber = null, string slaveId = null)564 @helper SlaveContainers(string destinationTag, string url, string limit, bool singleSlave, string startDate = null, string endDate = null, string userName = null, string functionName = null, string pageNumber = null, string slaveId = null) 470 565 { 471 566 <text> … … 515 610 @:} 516 611 } 517 $.ajax({ 518 async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 519 520 //Set chart names for use in creation below, must be set identically in 521 //ResizeSlaves 612 $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 613 //Set chart names for use in creation below, must be set identically in LoadSlave and ResizeSlaves 522 614 var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"]; 523 615 524 var destTag = eval("@(destinationTag)"); 525 if(typeof eval("@(destinationTag)") != "string") { 526 destTag = "@(destinationTag)"; 616 @if (!singleSlave) { 617 @:$('#@(destinationTag)').html(""); 618 619 //Checks if multipage display, if it is then trims results to 620 //the results for the page to be displayed 621 @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber) 622 623 624 @:var destTag = "@(destinationTag)"; 625 } 626 else { 627 @:var destTag = @(destinationTag); 527 628 } 528 629 529 630 if(result.length == 0) { 530 @if (!singleSlave) { 631 @if (!singleSlave) 632 { 531 633 @:$('#' + destTag).html(""); 532 634 } … … 537 639 ) 538 640 } 539 else { 540 var time = new Date(); 541 542 @if (!singleSlave) 641 642 for(i = 0; i < result.length; i++) { 643 $('#' + destTag).append( 644 '<section class="chartContainer">' + 645 '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' + 646 '<button class="collapse" onclick="LoadSlave(this)">+</button>' + 647 '<div id="' + destTag + slaveChartNames[0] + 'Plot' + result[i][0].SlaveID + '"></div>' + 648 '<div id="' + destTag + slaveChartNames[1] + 'Plot' + result[i][0].SlaveID + '"></div>' + 649 '<div id="' + destTag + slaveChartNames[2] + 'Plot' + result[i][0].SlaveID + '"></div>' + 650 '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' + 651 '</section>'); 652 for(k = 0; k < slaveChartNames.length; k++) { 653 CollapsedByDefault(document.getElementById(destTag + slaveChartNames[k] + "Plot" + result[i][0].SlaveID)); 654 } 655 } 656 }}); 657 </text> 658 } 659 660 @helper LoadSlave(string url, string limit, string startDate = null, string endDate = null, string userName = null, string pageNumber = null) { 661 <text> 662 function LoadSlave(caller) { 663 CheckFilters(); 664 if($(caller).next().html()=="") { 665 var destTag = $(caller).parent().parent().attr('id'); 666 //Set current slave id 667 var currentSlave = $(caller).siblings('a.moreInfo').attr('id'); 668 var GetRequest = "?slaveId=" + currentSlave; 669 @if (startDate != null) 543 670 { 544 @:$('#' + destTag).html(""); 545 546 //Checks if multipage display, if it is then trims results to 547 //the results for the page to be displayed 548 @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber) 549 } 550 551 for(i = 0; i < result.length; i++) { 671 @:if(@(startDate)!=null) { 672 @:GetRequest += "&start=" + @startDate; 673 @:} 674 } 675 @if (endDate != null) 676 { 677 @:if(@(endDate)!=null) { 678 @:GetRequest += "&end=" + @endDate; 679 @:} 680 } 681 @if (userName != null) 682 { 683 @:if(@(userName)!=null) { 684 @:GetRequest += "&userName=" + @userName; 685 @:} 686 } 687 $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 688 //Set chart names for use in creation below, must be set identically in SlaveContainers and ResizeSlaves 689 var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"]; 690 CollapseSection(caller); 691 var time = new Date(); 552 692 var coreSeries = []; 553 693 coreSeries[0] = []; … … 558 698 var cpuSeries = []; 559 699 cpuSeries[0] = []; 560 $('#' + destTag).append( 561 '<section class="chartContainer">' + 562 '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' + 563 '<button class="collapse" onclick="CollapseSection(this)">+</button>' + 564 '<div id="' + destTag + slaveChartNames[0] + 'Plot' + i + '"></div>' + 565 '<div id="' + destTag + slaveChartNames[1] + 'Plot' + i + '"></div>' + 566 '<div id="' + destTag + slaveChartNames[2] + 'Plot' + i + '"></div>' + 567 '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' + 568 '</section>'); 569 for(j = 0; j < result[i].length; j++) { 570 time.setTime(result[i][j].Time.replace(/\D/g,'')); 571 coreSeries[0].push([time.toUTCString(),result[i][j].TotalCores]); 572 coreSeries[1].push([time.toUTCString(),result[i][j].UsedCores]); 573 memorySeries[0].push([time.toUTCString(),(result[i][j].TotalMemory / 1000)]); 574 memorySeries[1].push([time.toUTCString(),(result[i][j].UsedMemory / 1000)]); 575 cpuSeries[0].push([time.toUTCString(),result[i][j].CPUUtilization]); 576 } 577 if(result[i].length > 1) { 578 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[0]", "i", "coreSeries", "Total/Used Cores") 579 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[1]", "i", "memorySeries", "Total/Used Memory", 0) 580 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[2]", "i", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%") 700 for(i = 0; i < result.length; i++) { 701 time.setTime(result[i].Time.replace(/\D/g,'')); 702 coreSeries[0].push([time.toUTCString(),result[i].TotalCores]); 703 coreSeries[1].push([time.toUTCString(),result[i].UsedCores]); 704 memorySeries[0].push([time.toUTCString(),(result[i].TotalMemory / 1000)]); 705 memorySeries[1].push([time.toUTCString(),(result[i].UsedMemory / 1000)]); 706 cpuSeries[0].push([time.toUTCString(),result[i].CPUUtilization]); 707 } 708 if(result.length > 1) { 709 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[0]", "currentSlave", "coreSeries", "Total/Used Cores") 710 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[1]", "currentSlave", "memorySeries", "Total/Used Memory", 0) 711 @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[2]", "currentSlave", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%") 581 712 } 582 713 else { 583 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[0]", " i", "coreSeries", "Total/Used Cores")584 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[1]", " i", "memorySeries", "Total/Used Memory", 0)585 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[2]", " i", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%")586 } 587 for(k = 0; k < slaveChartNames.length; k++) {588 CollapsedByDefault(document.getElementById(destTag + slaveChartNames[k] + "Plot" + i));589 }590 }591 } 592 } });714 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[0]", "currentSlave", "coreSeries", "Total/Used Cores") 715 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[1]", "currentSlave", "memorySeries", "Total/Used Memory", 0) 716 @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[2]", "currentSlave", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%") 717 } 718 }}); 719 } 720 else { 721 CollapseSection(caller); 722 } 723 } 593 724 </text> 594 725 } … … 686 817 </text> 687 818 } 819 820 @helper UserTasks(string url, string insertAfter, string taskState) { 821 <text> 822 var GetRequest = "?taskState=@(taskState)"; 823 824 $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 825 if(result.length==0) { 826 $("@(insertAfter)").after( 827 '<section class="chartContainer">' + 828 '<h1 class="title">No users currently have any tasks ' + @(taskState) + '!</h1>' + 829 '</section>' 830 ) 831 } 832 else { 833 $("@(insertAfter)").after( 834 '<section class="chartContainer">' + 835 '<h1 class="title" id="UserTask@(taskState)PlotTitle">@(taskState) Tasks</h1>' + 836 '<button class="collapse" onclick="CollapseSection(this)">-</button>' + 837 '<div id="UserTask@(taskState)Plot" class="noXTicks"></div>' + 838 '</section>' 839 ); 840 } 841 var userTasks = []; 842 var userNames = []; 843 for (i=0; i < result.length; i++) { 844 userTasks[i] = [result[i].Value]; 845 userNames[i] = { label: result[i].Key }; 846 } 847 window["UserTask@(taskState)Plot"] = $.jqplot("UserTask@(taskState)Plot", userTasks, { 848 title: "Users with @(taskState) Tasks", 849 seriesDefaults:{ 850 renderer:$.jqplot.BarRenderer, 851 shadowAngle: 135, 852 pointLabels: {show: true, formatString: '%.3f'} 853 }, 854 series: userNames, 855 legend: { 856 show: true, 857 location: 'e', 858 placement: 'outside' 859 }, 860 axes: { 861 xaxis: { 862 renderer: $.jqplot.CategoryAxisRenderer, 863 showTicks: false, 864 pad: 0 865 }, 866 yaxis: { 867 padMax: 1.5 868 } 869 }, 870 cursor: { 871 showTooltip: false 872 } 873 }); 874 }}); 875 </text> 876 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml
r11222 r11246 18 18 *@ 19 19 20 @helper UserExceptions(string destinationTag, string url, string limit, stringuserName = null, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string slaveId=null)20 @helper UserExceptions(string destinationTag, string url, string userName = null, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string slaveId=null) 21 21 { 22 22 <text> … … 88 88 } 89 89 90 $.ajax({async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) { 90 $.ajax({async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", 91 error: function(xhr,err) { 92 alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status); 93 alert("responseText: "+xhr.responseText); 94 }, 95 success: function(result) { 91 96 $("#" + "@destinationTag").html(""); 92 97 if(result.Key.length > 0) { … … 96 101 '<label class="errorMessage underline">Error</label>'; 97 102 for (var i = 0; i < result.Key.length; i++) { 98 ErrorHTML += '<a class="errorTask" onclick="ScrollTo(this)">' + result.Key[i] + '</a>' + 99 '<label class="errorMessage">' + result.Value[i] + '</label>'; 103 ErrorHTML += '<a class="errorTask" onclick="ScrollTo(this)">' + result.Key[i] + '</a>'; 104 if(result.Value[i].length > 100) { 105 ErrorHTML += '<a class="errorMessage shortVerison" onclick="ShowFullError(this)">Click to show full message</a>'; 106 ErrorHTML += '<label class="errorMessage longVersion">' + result.Value[i] + '</label>'; 107 } 108 else { 109 ErrorHTML += '<label class="errorMessage">' + result.Value[i] + '</label>'; 110 } 100 111 } 101 112 ErrorHTML += '</section>'; … … 118 129 function ScrollTo(caller) { 119 130 var taskErrorId = $(caller).parent().parent().attr('id') + $(caller).html() + "PlotTitle"; 120 OpenOnError(document.getElementById(taskErrorId));131 $("#" + taskErrorId).parent().find("button").click(); 121 132 $('html, body').animate({ 122 133 scrollTop: $("#" + taskErrorId).parent().offset().top … … 238 249 function ShowSlaveInfo(caller) { 239 250 var taskSlaveId = $(caller).attr('id'); 251 CheckFilters(); 240 252 if($(caller).parent().parent().children(".chartContainer").length == 0) { 241 @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId") 253 var destinationTag = $(caller).parent().parent().attr('id'); 254 @ChartHelper.SlaveContainers("destinationTag",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId") 242 255 } 243 256 else { … … 247 260 </text> 248 261 } 262 263 @helper ShowFullError() { 264 <text> 265 function ShowFullError(caller) { 266 $(caller).css('display','none'); 267 $(caller).next().css('display','inline-block'); 268 } 269 </text> 270 }
Note: See TracChangeset
for help on using the changeset viewer.