- Timestamp:
- 03/16/16 16:57:46 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 15 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs
r13696 r13712 38 38 try 39 39 { 40 41 vm.userJobs = client.GetJobs(); 40 HiveClientWeb.Instance.Refresh(); 41 42 vm.userJobs = HiveClientWeb.Instance.Jobs.ToList(); 42 43 } 43 44 catch (Exception e) … … 57 58 if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin()) 58 59 { 59 vm.userJobs = client.GetJobs(); 60 vm.selectedJob = client.GetJob(id); 61 62 vm.lightJobTasks = client.GetLightweightJobTasks(id); 63 foreach (var light in vm.lightJobTasks) 64 { 65 vm.filledJobTasks.Add(client.GetTask(light.Id)); 66 } 67 ViewBag.Title = vm.selectedJob.Name + " - Jobs"; 60 HiveClientWeb.Instance.Refresh(); 61 62 vm.userJobs = HiveClientWeb.Instance.Jobs.ToList(); 63 foreach(var j in vm.userJobs) 64 { 65 if(j.Id == id) 66 { 67 vm.selectedJob = j; 68 } 69 } 70 vm.selectedJob.RefreshAutomatically = true; 71 HiveClientWeb.LoadJob(vm.selectedJob); 72 ViewBag.Title = vm.selectedJob.Job.Name + " - Jobs"; 68 73 return View("Index", vm); 69 74 } … … 81 86 vm.message = client.GetJob(id).Name + " deleted"; 82 87 client.DeleteJob(id); 83 vm.userJobs = client.GetJobs(); 88 HiveClientWeb.Instance.Refresh(); 89 90 vm.userJobs = HiveClientWeb.Instance.Jobs.ToList(); 84 91 ViewBag.Title = "Jobs"; 85 92 return View("Index", vm); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Models/AlgorithmContainer.cs
r13696 r13712 11 11 public IAlgorithm algo { get; set; } 12 12 public System.Random randy { get; set; } 13 14 public AlgorithmContainer(IAlgorithm al, System.Random r)13 public List<int[]> depth { get; set; } 14 public AlgorithmContainer(IAlgorithm al, List<int[]> d, int[] v, System.Random r) 15 15 { 16 16 algo = al; 17 depth = d; 18 depth.Add(v); 17 19 randy = r; 18 20 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ProgressHub.cs
r13696 r13712 21 21 public void ChangeName(string name) 22 22 { 23 FileOpeningService.Instance.Job.Job.Name = name; 23 if (name != null) 24 FileOpeningService.Instance.Job.Job.Name = name; 24 25 } 25 26 public void ToggleChild(int[][] arr) … … 28 29 HiveTask current = Job.HiveTasks.ToList()[0]; 29 30 // IOptimizer current = Job.HiveTasks.ToArray() ; 30 for (var i = 0; i < arr.Length; i++)31 if (arr.Length == 0) 31 32 { 32 33 current.ItemTask.ComputeInParallel = !current.ItemTask.ComputeInParallel; 33 34 34 if(i == arr.Length - 1) 35 } 36 else { 37 for (var i = 0; i < arr.Length; i++) 35 38 { 36 current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel = !current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel;37 39 38 40 41 if (i == arr.Length - 1) 42 { 43 if (current.ItemTask.Item is BatchRun) 44 { 45 current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel = !current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel; 46 } 47 else if (current.ItemTask.Item is Experiment) 48 { 49 current.ChildHiveTasks[arr[i][0]].ItemTask.ComputeInParallel = !current.ChildHiveTasks[arr[i][0]].ItemTask.ComputeInParallel; 50 } 51 52 } 53 else { 54 if (current.ItemTask.Item is BatchRun) 55 current = current.ChildHiveTasks[arr[i][1]]; // select right batch 56 else if (current.ItemTask.Item is Experiment) 57 current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment 58 } 39 59 } 40 else 41 current = current.ChildHiveTasks[arr[i][0]]; 60 } 61 } 62 public void ChangePriority(int[][] arr, int prior) 63 { 64 Job = FileOpeningService.Instance.Job; 65 HiveTask current = Job.HiveTasks.ToList()[0]; 66 // IOptimizer current = Job.HiveTasks.ToArray() ; 67 if (arr.Length == 0) 68 { 69 current.Task.Priority = prior; 70 71 } 72 else { 73 for (var i = 0; i < arr.Length; i++) 74 { 75 76 77 if (i == arr.Length - 1) 78 { 79 if (current.ItemTask.Item is BatchRun) 80 { 81 current.ChildHiveTasks[arr[i][1]].Task.Priority = prior; 82 } 83 else if (current.ItemTask.Item is Experiment) 84 { 85 current.ChildHiveTasks[arr[i][0]].Task.Priority = prior; 86 } 87 88 } 89 else { 90 if (current.ItemTask.Item is BatchRun) 91 current = current.ChildHiveTasks[arr[i][1]]; // select right batch 92 else if (current.ItemTask.Item is Experiment) 93 current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment 94 } 95 } 42 96 } 43 97 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/HiveClientWeb.cs
r13689 r13712 36 36 using HeuristicLab.Clients.Common.Properties; 37 37 using Microsoft.AspNet.Hosting; 38 using HeuristicLab.Clients.Hive.WebJobManager.Services.Imports; 38 39 39 40 namespace HeuristicLab.Clients.Hive.WebJobManager … … 320 321 } 321 322 322 323 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) 324 { 325 hiveJob.SetIndexInParentOptimizerList(null); 326 } 323 327 324 328 // upload Job … … 486 490 var hiveExperiment = refreshableJob.Job; 487 491 refreshableJob.IsProgressing = true; 488 TaskDownloader downloader = null;492 TaskDownloaderWeb downloader = null; 489 493 490 494 try … … 499 503 500 504 refreshableJob.Progress.Status = "Downloading tasks..."; 501 downloader = new TaskDownloader (allTasks.Select(x => x.Id));505 downloader = new TaskDownloaderWeb(allTasks.Select(x => x.Id)); 502 506 downloader.StartAsync(); 503 507 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/HiveServiceLocatorWebManagerService.cs
r13656 r13712 149 149 binding.AllowCookies = false; 150 150 151 binding.ReaderQuotas.MaxDepth = 32; 152 binding.ReaderQuotas.MaxStringContentLength = 200000000; 153 binding.ReaderQuotas.MaxArrayLength = 200000000; 154 binding.ReaderQuotas.MaxBytesPerRead = 4096; 155 binding.ReaderQuotas.MaxNameTableCharCount = 16384; 156 157 binding.ReliableSession.Ordered = true; 158 binding.ReliableSession.InactivityTimeout = TimeSpan.Parse("00:10:00"); 159 binding.ReliableSession.Enabled = false; 160 161 151 162 binding.Security.Mode = SecurityMode.Message; 152 163 binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/JobViewModel.cs
r13689 r13712 8 8 public class JobViewModel 9 9 { 10 public List< Job> userJobs { get; set; }10 public List<RefreshableJob> userJobs { get; set; } 11 11 12 public List<LightweightTask> lightJobTasks{ get; set; }13 public List<Task> filledJobTasks { get; set; } 14 public Job selectedJob{ get; set; }12 public RefreshableJob selectedJob { get; set; } 13 14 public List<HiveTask> selectedHiveTasks { get; set; } 15 15 public string message { get; set; } 16 16 public JobViewModel() … … 18 18 userJobs = null; 19 19 selectedJob = null; 20 filledJobTasks = new List<Task>();20 selectedHiveTasks = new List<HiveTask>(); 21 21 message = ""; 22 22 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml
r13689 r13712 18 18 </a> 19 19 </div> 20 <div class="row" style="padding:10px ">20 <div class="row" style="padding:10px; margin-right:0px!important"> 21 21 @if (Model.userJobs.Count == 0) 22 22 { … … 34 34 asp-controller="Job" 35 35 asp-action="Selected" 36 asp-route-id="@job.Id"> 37 @job.Name - @job.DateCreated 38 <span class="badge">@job.JobCount</span> 36 asp-route-id="@job.Id" 37 onclick="showLoader()"> 38 @job.Job.Name - @job.Job.DateCreated 39 <span class="badge">@job.Job.JobCount</span> 39 40 </a> 40 41 } … … 42 43 </div> 43 44 </div> 45 <p style="display:none" id="loader" class="text-center"> 46 <br /><br /><br /><br /><br /><br /><br /> 47 <i class="fa fa-cog fa-spin fa-5x" id="spinner"> 48 </i> 49 </p> 44 50 @if (Model.selectedJob != null) 45 51 { 46 <div class="col-sm-8" style="padding:5px; padding-left:10px;">52 <div class="col-sm-8" id="content" style="padding:5px; padding-left:10px;"> 47 53 <div class="row"> 48 54 <h2 style="padding-left:20px"> 49 @Model.selectedJob. Name55 @Model.selectedJob.Job.Name 50 56 <a onclick="popUpDelete()" 51 style="margin-bottom:10px;" 52 57 style="margin-bottom:10px;" 53 58 class='btn btn-danger'> 54 59 <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 55 60 </a> 56 <a style="display:none" 57 asp-action="Delete" 58 asp-route-id="@Model.selectedJob.Id" 59 asp-controller="Job" id="del" ></a> 61 <a style="display:none" 62 asp-action="Delete" 63 asp-route-id="@Model.selectedJob.Id" 64 asp-controller="Job" id="del" 65 onclick="showDeleter()"></a> 60 66 61 67 <script type="text/javascript"> … … 67 73 } 68 74 </script> 69 75 70 76 </h2> 71 77 <div class="col-sm-6" style="padding-left:30px"> 72 <p>Description: @Model.selectedJob. Description</p>73 <p>Resources: @Model.selectedJob. ResourceNames</p>74 <p>Created: @Model.selectedJob. DateCreated</p>75 <p>Owned by: @Model.selectedJob. OwnerUsername</p>78 <p>Description: @Model.selectedJob.Job.Description</p> 79 <p>Resources: @Model.selectedJob.Job.ResourceNames</p> 80 <p>Created: @Model.selectedJob.Job.DateCreated</p> 81 <p>Owned by: @Model.selectedJob.Job.OwnerUsername</p> 76 82 77 83 </div> 78 84 <div class="col-sm-6" style="padding-left:30px"> 79 <p>Calculating: @Model.selectedJob. CalculatingCount</p>80 <p>Finished: @Model.selectedJob. FinishedCount</p>85 <p>Calculating: @Model.selectedJob.Job.CalculatingCount</p> 86 <p>Finished: @Model.selectedJob.Job.FinishedCount</p> 81 87 </div> 82 88 83 89 </div> 84 90 <div class="row"> 85 <h3 style="padding-left:20px">@Model.lightJobTasks.Count Task@(Model.lightJobTasks != null && Model.lightJobTasks.Count != 1 ? "s" : "" )</h3> 86 @foreach (var task in Model.lightJobTasks) 91 <h3 style="padding-left:20px">Tasks</h3> 92 <script type="text/javascript"> 93 //TODO Globale variabele waar data per categorie in gestoken kan worden 94 </script> 95 @foreach (var task in Model.selectedJob.HiveTasks) 87 96 { 88 <table class="table " 89 style="margin-left:20px;"> 90 <thead> 91 <tr> 92 <th>@task</th> 93 </tr> 94 </thead> 95 <tbody> 96 <tr> 97 <td>Last update @task.LastTaskDataUpdate</td> 98 <td>State: @task.State</td> 99 100 </tr> 101 <tr> 102 <td>@task.ExecutionTime executed</td> 103 <td>Created: @task.DateCreated</td> 104 </tr> 105 </tbody> 106 </table> 97 @Html.Partial("SelectedJobPartials/_TaskPartial", 98 new HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer(task)) 107 99 108 100 } … … 111 103 } 112 104 } 105 <script type="text/javascript"> 106 function showLoader() { 107 document.getElementById("loader").style.display = ""; 108 document.getElementById("content").style.display = "none"; 109 } 110 function showDeleter() { 111 document.getElementById("loader").style.display = ""; 112 document.getElementById("content").style.display = "none"; 113 document.getElementById("spinner").className = "fa fa-trash-o fa-spin fa-5x"; 114 } 115 </script> 113 116 </div> 114 117 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Algorithm.cshtml
r13689 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 2 @{System.Random randomizer = new Random(); 3 int randy = randomizer.Next(5000); } 3 4 4 5 … … 8 9 </div> 9 10 <div class="row" style="text-align:left"> 10 <h1 data-toggle="tooltip" title=" 11 @Model.SelectedTask.ItemTask.Description 11 <h1 data-toggle="tooltip" title="@Model.SelectedTask.ItemTask.ItemName 12 @Model.SelectedTask.ItemTask.Description"> 12 13 <span class="label label-primary">Algorithm: @Model.SelectedTask.ItemTask.Name</span> 13 14 </h1> 14 15 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> 16 17 <div class="btn-group"> 18 <button 19 type="button" 20 id="prior@(randy)" 21 class="btn btn-info dropdown-toggle" 22 data-toggle="dropdown" 23 aria-haspopup="true" aria-expanded="false"> 24 Normal <span class="caret"></span> 25 </button> 26 <ul class="dropdown-menu"> 27 <li><a onclick="changePriority([],0,@randy)">Low</a></li> 28 <li><a onclick="changePriority([],1,@randy)">Normal</a></li> 29 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li> 30 <li><a onclick="changePriority([],3,@randy)">Critical</a></li> 31 </ul> 32 </div> 33 34 15 35 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a> 16 36 <h4 id="result" style="display:none">Start uploading algorithm...</h4> … … 24 44 </div> 25 45 </div> 46 26 47 <div class="row"> 27 48 <div class="btn-group-justified"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_AlgorithmSmall.cshtml
r13696 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer 2 @{int randomal = Model.randy.Next(2000); } 2 @{int randomal = Model.randy.Next(5000); 3 var builder = "["; 4 foreach (var arr in Model.depth) 5 { 6 builder += "[" + String.Join(",", arr) + "],"; 7 } 8 builder += "]"; 9 } 3 10 <p class="text-center"> 4 <a class="btn btn-primary" 5 data-toggle="collapse" 6 href="#collapseExample@(randomal)" 7 aria-expanded="false" 11 <a class="btn btn-primary" 12 data-toggle="collapse" 13 href="#collapseExample@(randomal)" 14 aria-expanded="false" 8 15 aria-controls="collapseExample@(randomal)"> 9 16 @Model.algo.Name 10 17 </a> 18 19 </p> 20 <div class="collapse" id="collapseExample@(randomal)" style="margin-left:10px;margin-right:10px;margin-top:-10px"> 21 <img src="~/img/accoladealg.png" style="width:100%;" /> 22 <div class="panel panel-primary" style="border-width:2px!important"> 23 <div class="panel-heading panel-primary text-center"> 24 <p>@Model.algo.Description</p> 11 25 12 </p> 13 <div class="collapse" id="collapseExample@(randomal)" style="margin-left:10px;margin-right:10px"> 14 <div class="panel panel-primary"> 15 <div class="panel-heading panel-primary text-center" > 16 <p>@Model.algo.Description</p> 26 <div class="btn-group"> 27 <button type="button" 28 id="prior@(randomal)" 29 class="btn btn-info dropdown-toggle" 30 data-toggle="dropdown" 31 aria-haspopup="true" aria-expanded="false"> 32 Normal <span class="caret"></span> 33 </button> 34 <ul class="dropdown-menu"> 35 <li><a onclick="changePriority(@builder,0,@randomal)">Low</a></li> 36 <li><a onclick="changePriority(@builder,1,@randomal)">Normal</a></li> 37 <li><a onclick="changePriority(@builder,2,@randomal)">Urgent</a></li> 38 <li><a onclick="changePriority(@builder,3,@randomal)">Critical</a></li> 39 </ul> 40 </div> 17 41 </div> 18 42 <table class="table table-responsive card-block" style="table-layout:fixed;overflow-wrap:break-word"> … … 27 51 { 28 52 <tr> 29 <td 53 <td>@prob.Name</td> 30 54 31 <td 55 <td>@prob.ActualValue</td> 32 56 </tr> 33 57 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml
r13696 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 2 @{System.Random randomizer = new Random(); 3 int randy = randomizer.Next( 2000); }3 int randy = randomizer.Next(5000); } 4 4 <div style="margin-left:20px;margin-right:20px"> 5 5 <div class="row" style="text-align:center"> … … 12 12 </h1> 13 13 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> 14 15 <div class="btn-group"> 16 <button type="button" 17 id="prior@(randy)" 18 class="btn btn-info dropdown-toggle" 19 data-toggle="dropdown" 20 aria-haspopup="true" aria-expanded="false"> 21 Normal <span class="caret"></span> 22 </button> 23 <ul class="dropdown-menu"> 24 <li><a onclick="changePriority([],0,@randy)">Low</a></li> 25 <li><a onclick="changePriority([],1,@randy)">Normal</a></li> 26 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li> 27 <li><a onclick="changePriority([],3,@randy)">Critical</a></li> 28 </ul> 29 </div> 30 14 31 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a> 15 32 <h4 id="result" style="display:none">Start uploading batch run...</h4> … … 25 42 <h4> 26 43 Repeats: @Model.SelectedBatchRun.Repetitions x 27 <label> 28 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 29 onchange="toggleChild([], @randy)" /> 30 Distribute child tasks 31 </label> 44 32 45 </h4> 46 <p class="text-center"> 47 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 48 onchange="toggleChild([], @randy)" /> 49 Distribute child tasks 50 </p> 33 51 <div id="childs@(randy)"> 34 52 @for (var k = 0; k < Model.SelectedBatchRun.Repetitions; k++) … … 39 57 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 40 58 ((HeuristicLab.Optimization.IAlgorithm)Model.SelectedBatchRun.Optimizer), 59 new List<int[]>(), 60 new int[] { 0, k }, 41 61 randomizer)); 42 62 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml
r13696 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer 2 2 @{ 3 int randombr = Model.randy.Next(2000); } 3 int randombr = Model.randy.Next(5000); 4 var builder = "["; 5 foreach (var arr in Model.depth) 6 { 7 builder += "[" + String.Join(",", arr) + "],"; 8 } 9 builder += "]"; 10 } 11 12 4 13 <p class="text-center"> 5 14 <a class="btn btn-warning" … … 12 21 13 22 </p> 14 <div class="collapse" id="collapseExample@(randombr)" style="margin-left:10px;margin-right:10px"> 15 <div class="panel panel-warning"> 16 <div class="panel-heading panel-warning text-center"> 17 <p> 23 <div class="collapse" 24 id="collapseExample@(randombr)" style="margin-left:10px;margin-right:10px;margin-top:-10px "> 25 <img src="~/img/accoladebatch.png" style="width:100%" /> 26 <div class="panel panel-warning" style="border-color:#f6cd94!important; border-width:2px!important"> 27 <div class="panel-heading text-center"> 28 <p class="panel-title"> 18 29 Repeats @Model.batch.Repetitions X 19 30 </p> 20 31 <p> 21 <label> 22 @{ var builder = "["; 23 foreach (var arr in Model.depth) 24 { 25 builder += "[" + String.Join(",", arr) + "],"; 26 } 27 builder += "]"; 28 } 29 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 30 onchange="toggleChild(@builder, @randombr)" /> 31 Distribute child tasks 32 </label> 32 33 34 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 35 onchange="toggleChild(@builder, @randombr)" /> 36 Distribute child tasks 37 33 38 </p> 39 <div class="btn-group"> 40 <button type="button" 41 id="prior@(randombr)" 42 class="btn btn-info dropdown-toggle" 43 data-toggle="dropdown" 44 aria-haspopup="true" aria-expanded="false"> 45 Normal <span class="caret"></span> 46 </button> 47 <ul class="dropdown-menu"> 48 <li><a onclick="changePriority(@builder,0,@randombr)">Low</a></li> 49 <li><a onclick="changePriority(@builder,1,@randombr)">Normal</a></li> 50 <li><a onclick="changePriority(@builder,2,@randombr)">Urgent</a></li> 51 <li><a onclick="changePriority(@builder,3,@randombr)">Critical</a></li> 52 </ul> 53 </div> 34 54 </div> 35 55 <div id="childs@(randombr)"> … … 41 61 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 42 62 ((HeuristicLab.Optimization.IAlgorithm)Model.batch.Optimizer), 63 Model.depth.ToList(), 64 new int[] { 0, k }, 43 65 Model.randy)) 44 66 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml
r13696 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 @{System.Random randomizer = new Random(); } 2 @{System.Random randomizer = new Random(); 3 int randy = randomizer.Next(5000); } 3 4 <div style="margin-left:20px;margin-right:20px"> 4 5 <div class="row" style="text-align:center"> … … 11 12 </h1> 12 13 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> 14 15 16 <div class="btn-group"> 17 <button type="button" 18 id="prior@(randy)" 19 class="btn btn-info dropdown-toggle" 20 data-toggle="dropdown" 21 aria-haspopup="true" aria-expanded="false"> 22 Normal <span class="caret"></span> 23 </button> 24 <ul class="dropdown-menu"> 25 <li><a onclick="changePriority([],0,@randy)">Low</a></li> 26 <li><a onclick="changePriority([],1,@randy)">Normal</a></li> 27 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li> 28 <li><a onclick="changePriority([],3,@randy)">Critical</a></li> 29 </ul> 30 </div> 13 31 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a> 14 32 <h4 id="result" style="display:none">Start uploading experiment...</h4> … … 25 43 Children: @Model.SelectedExperiment.Optimizers.Count 26 44 </h4> 27 @for (var i = 0; i < Model.SelectedExperiment.Optimizers.Count; i++) 28 { 29 @if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.IAlgorithm) 45 <p class="text-center"> 46 <input type="checkbox" checked data-toggle="toggle" data-onstyle="danger" 47 onchange="toggleChild([], @randy)" /> 48 Distribute child tasks 49 </p> 50 <div id="childs@(randy)"> 51 @for (var i = 0; i < Model.SelectedExperiment.Optimizers.Count; i++) 30 52 { 31 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 32 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 33 ((HeuristicLab.Optimization.IAlgorithm)Model.SelectedExperiment.Optimizers[i]), 34 randomizer)); 53 @if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.IAlgorithm) 54 { 55 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 56 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 57 ((HeuristicLab.Optimization.IAlgorithm)Model.SelectedExperiment.Optimizers[i]), 58 new List<int[]>(), 59 new int[] { i, 0 }, 60 randomizer)); 61 62 } 63 else if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.BatchRun) 64 { 65 @Html.Partial("OpenFilePartials/_BatchRunSmall", 66 new HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer( 67 ((HeuristicLab.Optimization.BatchRun)Model.SelectedExperiment.Optimizers[i]), 68 new List<int[]>(), 69 new int[] { i, 0 }, 70 randomizer)) ; 71 72 } 73 else if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.Experiment) 74 { 75 @Html.Partial("OpenFilePartials/_ExperimentSmall", 76 new HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer( 77 ((HeuristicLab.Optimization.Experiment)Model.SelectedExperiment.Optimizers[i]), 78 new List<int[]>(), 79 new int[] { i, 0 }, 80 randomizer)) ; 81 82 } 35 83 36 84 } 37 else if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.BatchRun) 38 { 39 @Html.Partial("OpenFilePartials/_BatchRunSmall", 40 new HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer( 41 ((HeuristicLab.Optimization.BatchRun)Model.SelectedExperiment.Optimizers[i]), 42 new List<int[]>(), 43 new int[] { i, 0 }, 44 randomizer)) ; 45 46 } 47 else if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.Experiment) 48 { 49 @Html.Partial("OpenFilePartials/_ExperimentSmall", 50 new HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer( 51 ((HeuristicLab.Optimization.Experiment)Model.SelectedExperiment.Optimizers[i]), 52 new List<int[]>(), 53 new int[] { i, 0 }, 54 randomizer)) ; 55 56 } 57 58 } 59 85 </div> 60 86 <script type="text/javascript"> 61 87 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml
r13696 r13712 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer 2 @{int randombr = Model.randy.Next(2000); } 2 @{int randomex = Model.randy.Next(5000); 3 var builder = "["; 4 foreach (var arr in Model.depth) 5 { 6 builder += "[" + String.Join(",", arr) + "],"; 7 } 8 builder += "]"; 9 } 3 10 <p class="text-center"> 4 11 <a class="btn btn-danger" 5 12 data-toggle="collapse" 6 href="#collapseExample@(random br)"13 href="#collapseExample@(randomex)" 7 14 aria-expanded="false" 8 aria-controls="collapseExample@(random br)">15 aria-controls="collapseExample@(randomex)"> 9 16 @Model.exp.Name 10 17 </a> 11 18 12 19 </p> 13 <div class="collapse" id="collapseExample@(randombr)" style="margin-left:10px;margin-right:10px"> 14 <div class="panel panel-danger"> 20 <div class="collapse" id="collapseExample@(randomex)" style="margin-left:10px;margin-right:10px;margin-top:-10px"> 21 <img src="~/img/accoladeexp.png" style="width:100%" /> 22 <div class="panel panel-danger" style="border-color:#c12e2a!important; border-width:2px!important"> 15 23 <div class="panel-heading panel-danger text-center"> 16 <p>Children: @Model.exp.Optimizers.Count</p> 24 <p class="panel-title">Children: @Model.exp.Optimizers.Count</p> 25 <p> 26 <label> 27 28 <input type="checkbox" checked data-toggle="toggle" data-onstyle="danger" 29 onchange="toggleChild(@builder, @randomex)" /> 30 Distribute child tasks 31 </label> 32 </p> 33 <div class="btn-group"> 34 <button type="button" 35 id="prior@(randomex)" 36 class="btn btn-info dropdown-toggle" 37 data-toggle="dropdown" 38 aria-haspopup="true" aria-expanded="false"> 39 Normal <span class="caret"></span> 40 </button> 41 <ul class="dropdown-menu"> 42 <li><a onclick="changePriority(@builder,0,@randomex)">Low</a></li> 43 <li><a onclick="changePriority(@builder,1,@randomex)">Normal</a></li> 44 <li><a onclick="changePriority(@builder,2,@randomex)">Urgent</a></li> 45 <li><a onclick="changePriority(@builder,3,@randomex)">Critical</a></li> 46 </ul> 47 </div> 17 48 </div> 18 @for (var j = 0; j < Model.exp.Optimizers.Count; j++) 19 { 20 @if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.IAlgorithm) 49 <div id="childs@(randomex)"> 50 @for (var j = 0; j < Model.exp.Optimizers.Count; j++) 21 51 { 22 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 52 @if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.IAlgorithm) 53 { 54 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 23 55 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 24 ((HeuristicLab.Optimization.IAlgorithm)Model.exp.Optimizers[j]), 25 Model.randy)) 56 ((HeuristicLab.Optimization.IAlgorithm)Model.exp.Optimizers[j]), 57 Model.depth.ToList(), 58 new int[] { j, 0 }, 59 Model.randy)) 26 60 27 }28 else if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.BatchRun)29 {30 @Html.Partial("OpenFilePartials/_BatchRunSmall",61 } 62 else if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.BatchRun) 63 { 64 @Html.Partial("OpenFilePartials/_BatchRunSmall", 31 65 new HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer( 32 66 ((HeuristicLab.Optimization.BatchRun)Model.exp.Optimizers[j]), … … 35 69 Model.randy)) ; 36 70 37 }38 else if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.Experiment)39 {40 @Html.Partial("OpenFilePartials/_ExperimentSmall",71 } 72 else if (Model.exp.Optimizers[j] is HeuristicLab.Optimization.Experiment) 73 { 74 @Html.Partial("OpenFilePartials/_ExperimentSmall", 41 75 new HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer( 42 76 ((HeuristicLab.Optimization.Experiment)Model.exp.Optimizers[j]), … … 45 79 Model.randy)) ; 46 80 81 } 47 82 } 48 }83 </div> 49 84 </div> 50 85 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/_Layout.cshtml
r13696 r13712 31 31 <script src="~/js/npm.js"></script> 32 32 <script src="~/js/raphael.js"></script> 33 <script src="~/js/plotly.js"></script> 33 34 @RenderBody() 34 35 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/css/StyleSheet.css
r13656 r13712 38 38 text-align: center; 39 39 } 40 .panel-warning > .panel-heading{ 41 background-image: linear-gradient(to bottom,#eb9114 0,#f1b25b 100%)!important; 42 color:white!important; 43 } 44 .panel-danger > .panel-heading{ 45 background-image: linear-gradient(to bottom,#c12e2a 0,#d9534f 100%)!important; 46 color:white!important; 47 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/hubber.js
r13696 r13712 31 31 32 32 var jobname = prompt("Please enter a job name", "Job"); 33 if (jobname != "") {33 if (jobname && jobname != "" && jobname != null) { 34 34 hubber.server.changeName(jobname); 35 35 document.getElementById("fakehiveadd").style.display = "none"; … … 40 40 } 41 41 function toggleChild(arr, idchilds) { 42 console.log(arr );42 console.log(arr + " toggled"); 43 43 hubber.server.toggleChild(arr); 44 44 if ($("#childs" + idchilds).css("display") == "none") … … 47 47 $("#childs" + idchilds).css("display", "none"); 48 48 } 49 function changePriority(arr, prior, idprior) { 50 console.log(arr + " to priority " + prior); 51 hubber.server.changePriority(arr, prior); 52 resetPrior(idprior); 53 switch (prior) { 54 case 0: 55 document.getElementById("prior" + idprior).className += "btn-default"; 56 document.getElementById("prior" + idprior).innerHTML = "Low" 57 break; 58 case 1: 59 document.getElementById("prior" + idprior).className += "btn-info"; 60 document.getElementById("prior" + idprior).innerHTML = "Normal" 61 break; 62 case 2: 63 document.getElementById("prior" + idprior).className += "btn-warning"; 64 document.getElementById("prior" + idprior).innerHTML = "Urgent" 65 break; 66 case 3: 67 document.getElementById("prior" + idprior).className += "btn-danger"; 68 document.getElementById("prior" + idprior).innerHTML = "Critical"; 69 break; 70 } 71 document.getElementById("prior" + idprior).innerHTML += "<span class='caret'></span>"; 72 } 73 function resetPrior(id) { 74 document.getElementById("prior" + id).className = "btn dropdown-toggle "; 75 }
Note: See TracChangeset
for help on using the changeset viewer.