Changeset 11222 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/AdminHelper.cshtml
- Timestamp:
- 07/24/14 09:16:42 (10 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.