- Timestamp:
- 03/14/16 17:08:33 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 9 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs
r13689 r13696 205 205 serve.vm.SelectedExperiment = (Experiment)serve.vm.SelectedTask.ItemTask.Item; 206 206 } 207 207 serve.setTasks(); 208 208 ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Open file"; 209 209 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ProgressHub.cs
r13689 r13696 1 1 using HeuristicLab.Clients.Hive.WebJobManager.Services; 2 using HeuristicLab.Optimization; 2 3 using Microsoft.AspNet.SignalR; 3 4 using System; … … 21 22 { 22 23 FileOpeningService.Instance.Job.Job.Name = name; 24 } 25 public void ToggleChild(int[][] arr) 26 { 27 Job = FileOpeningService.Instance.Job; 28 HiveTask current = Job.HiveTasks.ToList()[0]; 29 // IOptimizer current = Job.HiveTasks.ToArray() ; 30 for (var i = 0; i < arr.Length; i++) 31 { 32 33 34 if(i == arr.Length - 1) 35 { 36 current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel = !current.ChildHiveTasks[arr[i][1]].ItemTask.ComputeInParallel; 37 38 39 } 40 else 41 current = current.ChildHiveTasks[arr[i][0]]; 42 } 23 43 } 24 44 public void runHub(object sender, EventArgs e) -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/FileOpeningService.cs
r13689 r13696 12 12 { 13 13 public RefreshableJob Job { get; set; } 14 public FileOpeningViewModel vm { get; set;}14 public FileOpeningViewModel vm { get; set; } 15 15 public IHostingEnvironment env { get; set; } 16 16 private static FileOpeningService instance; … … 26 26 } 27 27 } 28 public 28 public void NewModel() 29 29 { 30 30 vm = new FileOpeningViewModel(); 31 31 Job = new RefreshableJob(); 32 32 Job.Job.Name = "init"; 33 34 } 35 public void setTasks() 36 { 37 38 Job.HiveTasks.Add(vm.SelectedTask); 33 39 } 34 40 35 41 public RefreshableJob AddCurrentModelToHive() 36 42 { 37 if (vm != null)43 if (vm != null) 38 44 { 39 45 40 Job.HiveTasks.Add(vm.SelectedTask); 41 46 47 42 48 HiveServiceLocatorWebManagerService serv = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance; 43 49 //job.Job.Id = serv.getHiveServiceClient().AddJob(job.Job); … … 45 51 46 52 HiveClientWeb.CurrentEnv = env; 47 HiveClientWeb.Instance.Refresh();53 HiveClientWeb.Instance.Refresh(); 48 54 HiveClientWeb.StartJob((ex) => { throw ex; }, Job, CancellationToken.None); 49 55 return Job; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml
r13689 r13696 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 2 @{System.Random randomizer = new Random(); 3 int randy = randomizer.Next(2000); } 3 4 <div style="margin-left:20px;margin-right:20px"> 4 5 <div class="row" style="text-align:center"> … … 8 9 <h1 data-toggle="tooltip" title="@Model.SelectedTask.ItemTask.ItemName 9 10 @Model.SelectedTask.ItemTask.Description "> 10 <span class="label label- primary">Batch Run: @Model.SelectedTask.ItemTask.Name</span>11 <span class="label label-warning ">Batch: @Model.SelectedBatchRun.Name</span> 11 12 </h1> 12 13 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> … … 22 23 </div> 23 24 </div> 25 <h4> 26 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> 32 </h4> 33 <div id="childs@(randy)"> 34 @for (var k = 0; k < Model.SelectedBatchRun.Repetitions; k++) 35 { 36 @if (Model.SelectedBatchRun.Optimizer is HeuristicLab.Optimization.IAlgorithm) 37 { 38 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 39 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 40 ((HeuristicLab.Optimization.IAlgorithm)Model.SelectedBatchRun.Optimizer), 41 randomizer)); 42 43 } 44 else if (Model.SelectedBatchRun.Optimizer is HeuristicLab.Optimization.BatchRun) 45 { 46 @Html.Partial("OpenFilePartials/_BatchRunSmall", 47 new HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer( 48 ((HeuristicLab.Optimization.BatchRun)Model.SelectedBatchRun.Optimizer), 49 new List<int[]>(), 50 new int[] { 0, k }, 51 randomizer)); 52 53 } 54 else if (Model.SelectedBatchRun.Optimizer is HeuristicLab.Optimization.Experiment) 55 { 56 @Html.Partial("OpenFilePartials/_ExperimentSmall", 57 new HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer( 58 ((HeuristicLab.Optimization.Experiment)Model.SelectedBatchRun.Optimizer), 59 new List<int[]>(), 60 new int[] { 0, k }, 61 randomizer)); 62 63 } 64 } 65 </div> 24 66 25 67 <script type="text/javascript"> 26 function addtoHive() {27 document.getElementById("fakehiveadd").style.display = "none";28 document.getElementById("progdiv").style.display = "";29 document.getElementById("result").style.display = "";30 document.getElementById("realhiveadd").click();31 68 32 }33 function setProb() {34 resetAll();35 document.getElementById("problem").style.display = "";36 document.getElementById("btnprob").className += " active";37 38 }39 function setAlgo() {40 resetAll();41 document.getElementById("algorithm").style.display = "";42 document.getElementById("btnalg").className += " active";43 }44 function setResults() {45 resetAll();46 document.getElementById("results").style.display = "";47 document.getElementById("btnresults").className += " active";48 }49 function setRuns() {50 resetAll();51 document.getElementById("runs").style.display = "";52 document.getElementById("btnruns").className += " active";53 }54 function setEngine() {55 resetAll();56 document.getElementById("engine").style.display = "";57 document.getElementById("btnengine").className += " active";58 }59 function resetAll() {60 document.getElementById("problem").style.display = "none";61 document.getElementById("algorithm").style.display = "none";62 document.getElementById("results").style.display = "none";63 document.getElementById("runs").style.display = "none";64 document.getElementById("engine").style.display = "none";65 document.getElementById("btnprob").className = document.getElementById("btnprob").className.replace(/(?:^|\s)active(?!\S)/g, '');66 document.getElementById("btnalg").className = document.getElementById("btnalg").className.replace(/(?:^|\s)active(?!\S)/g, '');67 document.getElementById("btnresults").className = document.getElementById("btnresults").className.replace(/(?:^|\s)active(?!\S)/g, '');68 document.getElementById("btnruns").className = document.getElementById("btnruns").className.replace(/(?:^|\s)active(?!\S)/g, '');69 document.getElementById("btnengine").className = document.getElementById("btnengine").className.replace(/(?:^|\s)active(?!\S)/g, '');70 }71 69 $(document).ready(function () { 72 70 $('[data-toggle="tooltip"]').tooltip(); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml
r13689 r13696 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 2 @{System.Random randomizer = new Random(); } 3 3 <div style="margin-left:20px;margin-right:20px"> 4 4 <div class="row" style="text-align:center"> … … 8 8 <h1 data-toggle="tooltip" title=" @Model.SelectedTask.ItemTask.ItemName 9 9 @Model.SelectedTask.ItemTask.Description "> 10 <span class="label label- primary">Experiment: @Model.SelectedTask.ItemTask.Name</span>10 <span class="label label-danger">Experiment: @Model.SelectedTask.ItemTask.Name</span> 11 11 </h1> 12 12 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> … … 18 18 id="progress" 19 19 aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:10%"> 20 20 21 21 </div> 22 22 </div> 23 23 </div> 24 <h4> 25 Children: @Model.SelectedExperiment.Optimizers.Count 26 </h4> 27 @for (var i = 0; i < Model.SelectedExperiment.Optimizers.Count; i++) 28 { 29 @if (Model.SelectedExperiment.Optimizers[i] is HeuristicLab.Optimization.IAlgorithm) 30 { 31 @Html.Partial("OpenFilePartials/_AlgorithmSmall", 32 new HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer( 33 ((HeuristicLab.Optimization.IAlgorithm)Model.SelectedExperiment.Optimizers[i]), 34 randomizer)); 35 36 } 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 } 24 59 25 60 <script type="text/javascript"> 26 27 function setProb() {28 resetAll();29 document.getElementById("problem").style.display = "";30 document.getElementById("btnprob").className += " active";31 61 32 }33 function setAlgo() {34 resetAll();35 document.getElementById("algorithm").style.display = "";36 document.getElementById("btnalg").className += " active";37 }38 function setResults() {39 resetAll();40 document.getElementById("results").style.display = "";41 document.getElementById("btnresults").className += " active";42 }43 function setRuns() {44 resetAll();45 document.getElementById("runs").style.display = "";46 document.getElementById("btnruns").className += " active";47 }48 function setEngine() {49 resetAll();50 document.getElementById("engine").style.display = "";51 document.getElementById("btnengine").className += " active";52 }53 function resetAll() {54 document.getElementById("problem").style.display = "none";55 document.getElementById("algorithm").style.display = "none";56 document.getElementById("results").style.display = "none";57 document.getElementById("runs").style.display = "none";58 document.getElementById("engine").style.display = "none";59 document.getElementById("btnprob").className = document.getElementById("btnprob").className.replace(/(?:^|\s)active(?!\S)/g, '');60 document.getElementById("btnalg").className = document.getElementById("btnalg").className.replace(/(?:^|\s)active(?!\S)/g, '');61 document.getElementById("btnresults").className = document.getElementById("btnresults").className.replace(/(?:^|\s)active(?!\S)/g, '');62 document.getElementById("btnruns").className = document.getElementById("btnruns").className.replace(/(?:^|\s)active(?!\S)/g, '');63 document.getElementById("btnengine").className = document.getElementById("btnengine").className.replace(/(?:^|\s)active(?!\S)/g, '');64 }65 62 $(document).ready(function () { 66 63 $('[data-toggle="tooltip"]').tooltip(); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/_Layout.cshtml
r13689 r13696 11 11 <link href="~/css/min/site.min.css" rel="stylesheet" /> 12 12 </environment> 13 <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.0/css/bootstrap-toggle.min.css" rel="stylesheet"> 14 13 15 </head> 14 16 <body> … … 23 25 <script src="~/js/jquery-2.1.1.js"></script> 24 26 <script src="~/js/bootstrap.js"></script> 25 27 <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.0/js/bootstrap-toggle.min.js"></script> 26 28 <script src="~/js/jquery.signalr-2.1.2.js"></script> 27 29 <script src='~/signalr/js'></script> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/hubber.js
r13689 r13696 31 31 32 32 var jobname = prompt("Please enter a job name", "Job"); 33 if ( 33 if (jobname != "") { 34 34 hubber.server.changeName(jobname); 35 35 document.getElementById("fakehiveadd").style.display = "none"; … … 38 38 document.getElementById("realhiveadd").click(); 39 39 } 40 41 42 40 } 41 function toggleChild(arr, idchilds) { 42 console.log(arr); 43 hubber.server.toggleChild(arr); 44 if ($("#childs" + idchilds).css("display") == "none") 45 $("#childs" + idchilds).css("display", ""); 46 else 47 $("#childs" + idchilds).css("display", "none"); 48 }
Note: See TracChangeset
for help on using the changeset viewer.