Changeset 13848
- Timestamp:
- 05/13/16 13:17:52 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs
r13847 r13848 36 36 /// </summary> 37 37 /// <returns></returns> 38 38 39 private bool init() 39 40 { … … 76 77 } 77 78 } 78 79 79 80 public IActionResult SelectUser(string id) 80 81 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/GraphHubber.js
r13754 r13848 1 1 var hubber = $.connection.jobUpdaterHub; 2 3 2 $(function () { 4 3 // $.connection.hub.logging = true; … … 28 27 console.log("#REFRESH ALL"); 29 28 30 }, 5000 );29 }, 5000 + (dataCollection.length * 500)); 31 30 } 32 31 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Startup.cs
r13739 r13848 40 40 }); 41 41 services.AddSingleton<IHiveServiceLocator, HiveServiceLocatorWeb>(); 42 services.AddCaching(); 42 43 services.AddSignalR(); 43 44 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/Navbar.cshtml
r13847 r13848 6 6 class="@(Model.Active == "Job" ? "active" : "")"> 7 7 <a asp-controller="Job" 8 accesskey="j" 8 9 asp-action="Index"> 9 10 Job management … … 17 18 { 18 19 <a asp-controller="User" 19 asp-action="Index"> 20 asp-action="Index" 21 accesskey="u"> 20 22 User management 21 23 </a> … … 34 36 { 35 37 <a asp-controller="Resource" 36 asp-action="Index"> 38 asp-action="Index" 39 accesskey="r"> 37 40 Resources 38 41 </a> … … 50 53 <a asp-controller="Home" 51 54 asp-action="Logout" 55 accesskey="l" 52 56 class="text-danger"> 53 57 Logout -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml
r13847 r13848 309 309 <div class="form-group"> 310 310 <label class="col-sm-3 control-label"> 311 @Model.SelectedUserRoles.Count Roles 311 @Model.SelectedUserRoles.Count Roles <br /> 312 @if (Model.SelectedUserRoles.Where(x => x.Name == "Hive User").Count() != 0) 313 { 314 if (Model.SelectedUserRoles.Where(x => x.Name == "AccessService Administrator").Count() != 0) 315 { 316 if (Model.SelectedUserRoles.Where(x => x.Name == "Hive Administrator").Count() != 0) 317 { 318 <span style="color:forestgreen">Job management<br/>User management<br />Resources</span> 319 320 } 321 else 322 { 323 <span style="color:forestgreen">Job management<br />User management</span> 324 325 } 326 } 327 else 328 { 329 <span style="color:forestgreen">Job management</span> 330 331 } 332 333 } 334 else 335 { 336 <span style="color:darkred">No access to Hive</span> 337 338 } 312 339 </label> 340 313 341 <div class="col-sm-8 control-label" style="text-align:left"> 314 342 @if (Model.SelectedUserRoles.Count > 0) … … 368 396 onclick="triggerSave()"> 369 397 @role.Name 398 <span style="color:forestgreen"> 399 @(role.Name == "Hive User" ? " (access to Hive and job manager)" : "") 400 @(role.Name == "Hive Administrator" ? " (access to resources)" : "") 401 @(role.Name == "AccessService Administrator" ? " (access to user manager)" : "") 402 </span> 370 403 </label> 371 404 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Roles.cshtml
r13847 r13848 66 66 onclick="showRole()"> 67 67 @role.Name 68 <span style="color:forestgreen"> 69 @(role.Name == "Hive User" ? " (Hive + job manager)" : "") 70 @(role.Name == "Hive Administrator" ? " (Resources)" : "") 71 @(role.Name == "AccessService Administrator" ? " (User manager)" : "") 72 </span> 68 73 </a> 69 74 } … … 101 106 @if (Model.SelectedRole.Name != "") 102 107 { 103 <i class="fa fa-gavel "></i> @Model.SelectedRole.Name; 108 <i class="fa fa-gavel "></i> @Model.SelectedRole.Name 109 <span style="color:forestgreen"> 110 @(Model.SelectedRole.Name == "Hive User" ? " (access to Hive and job manager)" : "") 111 @(Model.SelectedRole.Name == "Hive Administrator" ? " (access to resources)" : "") 112 @(Model.SelectedRole.Name == "AccessService Administrator" ? " (access to user manager)" : "") 113 </span> 114 104 115 } 105 116 else -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/graphhubber.js
r13754 r13848 1 function autoRefresh(){document.getElementById("refreshtogg").checked&&hubber.server.updateAll()}function restart(a){document.getElementById("restarterbtn"+a).disabled=!0,document.getElementById("restarterbtn"+a).value="Sending restart request...",hubber.server.restartTask(a)}function editJobData(a,b){$("#jobcalculating").html("Calculating: "+a),$("#jobfinished").html("Finished: "+b)}function editTaskData(a,b){if(null!=b.LastHeartbeat){var c=new Date(b.LastHeartbeat);$("#lastupdpar"+a).html("Last update: "+c.toUTCString())}else $("#lastupdpar"+a).html("No updates yet");if(document.getElementById("restarter"+a).style.display="none","0"==b.State)$("#statepar"+a).css({color:"gray","font-weight":"normal"}),$("#statepar"+a).html("State: Offline");else if("1"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Waiting");else if("2"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal","text-shadow":"2px 2px black"}),$("#statepar"+a).html("State: Transferring");else if("3"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Calculating");else if("4"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Paused"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task";else if("5"==b.State){$("#statepar"+a).css({color:"#009900","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Finished");var d=new Date(b.StateLog[b.StateLog.length-1].DateTime);$("#lastupdpar"+a).html("Finished: "+d.toUTCString())}else"6"==b.State?($("#statepar"+a).css({color:"#e60000","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Aborted"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task"):"7"==b.State&&($("#statepar"+a).css({color:"#e60000","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Failed"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task");$("#executionpar"+a).html(b.ExecutionTime+" executed"),null!=b.StateLog[b.StateLog.length-1].Exception?""!=b.StateLog[b.StateLog.length-1].Exception?($("#exceptionpar"+a).html("Exception: "+b.StateLog[b.StateLog.length-1].Exception),$("#exceptionpar"+a).css({color:"#e60000","font-weight":"700","text-shadow":"1px 1px black"})):"6"==b.State?($("#exceptionpar"+a).html("Task is aborted."),$("#exceptionpar"+a).css({color:"#e65c00","font-weight":"700","text-shadow":"1px 1px black"})):($("#exceptionpar"+a).html("No exceptions"),$("#exceptionpar"+a).css({color:"white","text-shadow":"2px 2px black"})):($("#exceptionpar"+a).html("No exceptions"),$("#exceptionpar"+a).css({color:"white","text-shadow":"2px 2px black"})),$("#statechangespar"+a).html("Statelogs: "+b.StateLog.length);var e=new Date(b.StateLog[0].DateTime),f=new Date(b.StateLog[b.StateLog.length-1].DateTime);$("#graphtitle"+a).html("From "+e.toUTCString()+"<br/> to "+f.toUTCString())}function initSaveData(a,b,c){var d=dataConversion(b,c);d.unshift(a),dataCollection.push(d)}function saveData(a,b,c){for(var d=dataConversion(b,c),e=0;e<dataCollection.length;e++)dataCollection[e][0]==a&&(dataCollection[e][1]=d[0],dataCollection[e][2]=d[1],dataCollection[e][3]=d[2]);redrawGraph(a)}function getDataPie(a){for(var b=0;b<dataCollection.length;b++)if(dataCollection[b][0]==a)return dataCollection[b][2]}function getDataGantt(a){for(var b=0;b<dataCollection.length;b++)if(dataCollection[b][0]==a)return dataCollection[b][3]}function dataConversion(a,b){var c=dataConversionPie(a),d=dataConversionGantt(a,b);return[null,c,d]}function dataConversionGantt(a,b){for(var c=[],d=0;d<a.length;d++){var e={};if(e.startDate=Date.parse(a[d].DateTime),d<a.length-1)e.endDate=Date.parse(a[d+1].DateTime);else{var f=Date.parse(a[d].DateTime);e.endDate=f+6e5,e.last=!0}e.taskName=b,0==a[d].State?e.status="Offline":1==a[d].State?e.status="Waiting":2==a[d].State?e.status="Transferring":3==a[d].State?e.status="Calculating":4==a[d].State?e.status="Paused":5==a[d].State?e.status="Finished":6==a[d].State?e.status="Aborted":7==a[d].State&&(e.status="Failed"),c.push(e)}return[c,b]}function dataConversionPie(a){for(var b=0,c=0,d=0,e=0;e<a.length-1;e++)1==a[e].State?b+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime):2==a[e].State?c+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime):3==a[e].State&&(d+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime));var f=[{values:[Math.round(b/1e3/60),Math.round(c/1e3/60),Math.round(d/1e3/60)],labels:["Minutes waiting","Minutes transferring","Minutes calculating"],type:"pie",marker:{colors:["#f0a742","#80d4ff","#2f6fa6"]}}];return f}function redrawGraph(a){document.getElementById("graph"+a).style.width="100%",document.getElementById("graph"+a).style.height="400px",document.getElementById("graph"+a).innerHTML="",document.getElementById("graph"+a).style.marginLeft="0px",document.getElementById("graphtoggle"+a).checked?setTimeout(function(){var b=getDataGantt(a),c=$("#graph"+a).parent().width()-30;document.getElementById("graph"+a).style.height="300px";var d=d3.gantt().selector("#graph"+a).height("200").width(c).margin({top:20,right:40,bottom:20,left:20}).drawytitles(!1).taskTypes([b[1]]).taskStatus(taskStatus);d(b[0]),document.getElementById("legend"+a).style.display=""},100):(document.getElementById("legend"+a).style.display="none",setTimeout(function(){Plotly.newPlot("graph"+a,getDataPie(a))},100))}function redrawMain(){document.getElementById("graphMain").innerHTML="";for(var a=[],b=[],c=0;c<dataCollection.length;c++){for(var d=dataCollection[c][3][0].slice(),e=d[0].taskName.substring(0,5)+" | "+(c+1),f=0;f<d.length;f++)d[f].taskName=e;a=a.concat(d),b=b.concat(e)}var g=20*b.length+100;document.getElementById("graphMain").style.height=g+"px";var h=$("#graphMain").parent().width()-100,i=d3.gantt().selector("#graphMain").height(g-50).width(h).taskTypes(b).taskStatus(taskStatus);document.getElementById("graphMain").style.marginLeft="20px",i(a)}var hubber=$.connection.jobUpdaterHub;$(function(){var a=document.getElementById("userId").innerHTML;$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){hubber.server.initConnection(),redrawMain()}),hubber.client.processData=function(a,b,c){var d=JSON.parse(b);editTaskData(a,d),saveData(a,d.StateLog,c),console.log("#UPDATED "+a)},hubber.client.processJobData=function(a,b){editJobData(a,b)},hubber.client.requestDone=function(){document.getElementById("refreshtogg").checked&&setTimeout(function(){hubber.server.updateAll(),console.log("#REFRESH ALL")},5e3 )}});var dataCollection=[],taskStatus={Offline:"bar-off",Waiting:"bar-wait",Transferring:"bar-trans",Calculating:"bar-calc",Paused:"bar-paus",Finished:"bar-fin",Aborted:"bar-abo",Failed:"bar-fail"};1 function autoRefresh(){document.getElementById("refreshtogg").checked&&hubber.server.updateAll()}function restart(a){document.getElementById("restarterbtn"+a).disabled=!0,document.getElementById("restarterbtn"+a).value="Sending restart request...",hubber.server.restartTask(a)}function editJobData(a,b){$("#jobcalculating").html("Calculating: "+a),$("#jobfinished").html("Finished: "+b)}function editTaskData(a,b){if(null!=b.LastHeartbeat){var c=new Date(b.LastHeartbeat);$("#lastupdpar"+a).html("Last update: "+c.toUTCString())}else $("#lastupdpar"+a).html("No updates yet");if(document.getElementById("restarter"+a).style.display="none","0"==b.State)$("#statepar"+a).css({color:"gray","font-weight":"normal"}),$("#statepar"+a).html("State: Offline");else if("1"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Waiting");else if("2"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal","text-shadow":"2px 2px black"}),$("#statepar"+a).html("State: Transferring");else if("3"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Calculating");else if("4"==b.State)$("#statepar"+a).css({color:"white","font-weight":"normal"}),$("#statepar"+a).html("State: Paused"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task";else if("5"==b.State){$("#statepar"+a).css({color:"#009900","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Finished");var d=new Date(b.StateLog[b.StateLog.length-1].DateTime);$("#lastupdpar"+a).html("Finished: "+d.toUTCString())}else"6"==b.State?($("#statepar"+a).css({color:"#e60000","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Aborted"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task"):"7"==b.State&&($("#statepar"+a).css({color:"#e60000","font-weight":"900","text-shadow":"1px 1px black"}),$("#statepar"+a).html("State: Failed"),document.getElementById("restarter"+a).style.display="",document.getElementById("restarterbtn"+a).disabled=!1,document.getElementById("restarterbtn"+a).value="Restart task");$("#executionpar"+a).html(b.ExecutionTime+" executed"),null!=b.StateLog[b.StateLog.length-1].Exception?""!=b.StateLog[b.StateLog.length-1].Exception?($("#exceptionpar"+a).html("Exception: "+b.StateLog[b.StateLog.length-1].Exception),$("#exceptionpar"+a).css({color:"#e60000","font-weight":"700","text-shadow":"1px 1px black"})):"6"==b.State?($("#exceptionpar"+a).html("Task is aborted."),$("#exceptionpar"+a).css({color:"#e65c00","font-weight":"700","text-shadow":"1px 1px black"})):($("#exceptionpar"+a).html("No exceptions"),$("#exceptionpar"+a).css({color:"white","text-shadow":"2px 2px black"})):($("#exceptionpar"+a).html("No exceptions"),$("#exceptionpar"+a).css({color:"white","text-shadow":"2px 2px black"})),$("#statechangespar"+a).html("Statelogs: "+b.StateLog.length);var e=new Date(b.StateLog[0].DateTime),f=new Date(b.StateLog[b.StateLog.length-1].DateTime);$("#graphtitle"+a).html("From "+e.toUTCString()+"<br/> to "+f.toUTCString())}function initSaveData(a,b,c){var d=dataConversion(b,c);d.unshift(a),dataCollection.push(d)}function saveData(a,b,c){for(var d=dataConversion(b,c),e=0;e<dataCollection.length;e++)dataCollection[e][0]==a&&(dataCollection[e][1]=d[0],dataCollection[e][2]=d[1],dataCollection[e][3]=d[2]);redrawGraph(a)}function getDataPie(a){for(var b=0;b<dataCollection.length;b++)if(dataCollection[b][0]==a)return dataCollection[b][2]}function getDataGantt(a){for(var b=0;b<dataCollection.length;b++)if(dataCollection[b][0]==a)return dataCollection[b][3]}function dataConversion(a,b){var c=dataConversionPie(a),d=dataConversionGantt(a,b);return[null,c,d]}function dataConversionGantt(a,b){for(var c=[],d=0;d<a.length;d++){var e={};if(e.startDate=Date.parse(a[d].DateTime),d<a.length-1)e.endDate=Date.parse(a[d+1].DateTime);else{var f=Date.parse(a[d].DateTime);e.endDate=f+6e5,e.last=!0}e.taskName=b,0==a[d].State?e.status="Offline":1==a[d].State?e.status="Waiting":2==a[d].State?e.status="Transferring":3==a[d].State?e.status="Calculating":4==a[d].State?e.status="Paused":5==a[d].State?e.status="Finished":6==a[d].State?e.status="Aborted":7==a[d].State&&(e.status="Failed"),c.push(e)}return[c,b]}function dataConversionPie(a){for(var b=0,c=0,d=0,e=0;e<a.length-1;e++)1==a[e].State?b+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime):2==a[e].State?c+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime):3==a[e].State&&(d+=Date.parse(a[e+1].DateTime)-Date.parse(a[e].DateTime));var f=[{values:[Math.round(b/1e3/60),Math.round(c/1e3/60),Math.round(d/1e3/60)],labels:["Minutes waiting","Minutes transferring","Minutes calculating"],type:"pie",marker:{colors:["#f0a742","#80d4ff","#2f6fa6"]}}];return f}function redrawGraph(a){document.getElementById("graph"+a).style.width="100%",document.getElementById("graph"+a).style.height="400px",document.getElementById("graph"+a).innerHTML="",document.getElementById("graph"+a).style.marginLeft="0px",document.getElementById("graphtoggle"+a).checked?setTimeout(function(){var b=getDataGantt(a),c=$("#graph"+a).parent().width()-30;document.getElementById("graph"+a).style.height="300px";var d=d3.gantt().selector("#graph"+a).height("200").width(c).margin({top:20,right:40,bottom:20,left:20}).drawytitles(!1).taskTypes([b[1]]).taskStatus(taskStatus);d(b[0]),document.getElementById("legend"+a).style.display=""},100):(document.getElementById("legend"+a).style.display="none",setTimeout(function(){Plotly.newPlot("graph"+a,getDataPie(a))},100))}function redrawMain(){document.getElementById("graphMain").innerHTML="";for(var a=[],b=[],c=0;c<dataCollection.length;c++){for(var d=dataCollection[c][3][0].slice(),e=d[0].taskName.substring(0,5)+" | "+(c+1),f=0;f<d.length;f++)d[f].taskName=e;a=a.concat(d),b=b.concat(e)}var g=20*b.length+100;document.getElementById("graphMain").style.height=g+"px";var h=$("#graphMain").parent().width()-100,i=d3.gantt().selector("#graphMain").height(g-50).width(h).taskTypes(b).taskStatus(taskStatus);document.getElementById("graphMain").style.marginLeft="20px",i(a)}var hubber=$.connection.jobUpdaterHub;$(function(){var a=document.getElementById("userId").innerHTML;$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){hubber.server.initConnection(),redrawMain()}),hubber.client.processData=function(a,b,c){var d=JSON.parse(b);editTaskData(a,d),saveData(a,d.StateLog,c),console.log("#UPDATED "+a)},hubber.client.processJobData=function(a,b){editJobData(a,b)},hubber.client.requestDone=function(){document.getElementById("refreshtogg").checked&&setTimeout(function(){hubber.server.updateAll(),console.log("#REFRESH ALL")},5e3+500*dataCollection.length)}});var dataCollection=[],taskStatus={Offline:"bar-off",Waiting:"bar-wait",Transferring:"bar-trans",Calculating:"bar-calc",Paused:"bar-paus",Finished:"bar-fin",Aborted:"bar-abo",Failed:"bar-fail"};
Note: See TracChangeset
for help on using the changeset viewer.