Changeset 13841
- Timestamp:
- 05/10/16 16:55:18 (9 years ago)
- Location:
- branches/WebJobManager
- Files:
-
- 9 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs
r13827 r13841 104 104 //vm.selectedJob.RefreshAutomatically = true; 105 105 clientWeb.LoadJob(vm.selectedJob); 106 weblog.get FileOpener(userId).NewModel();107 weblog.get FileOpener(userId).Job = vm.selectedJob;106 weblog.getJobOpener(userId).NewModel(); 107 weblog.getJobOpener(userId).Job = vm.selectedJob; 108 108 ViewBag.Title = vm.selectedJob.Job.Name + " - Jobs"; 109 109 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); … … 153 153 ViewBag.Name = serviceClient.ClientCredentials.UserName.UserName; 154 154 ViewBag.Title = "Uploads"; 155 //Recently opened 156 if (weblog.getFileOpener(userId).Job != null) 157 ViewBag.active = true; 155 158 return View("Uploads", upper); 156 159 } … … 175 178 else 176 179 ViewBag.Title = "Add files - Uploads"; 180 //Recently opened 181 if (weblog.getFileOpener(userId).Job != null) 182 ViewBag.active = true; 177 183 return View("Uploads", upper); 178 184 } … … 236 242 fillUploadsPaths(upper, index); 237 243 upper.message = message; 244 //recently opened 245 if (weblog.getFileOpener(userId).Job != null) 246 ViewBag.active = true; 238 247 ViewBag.Title = "File deleted - Uploads"; 239 248 … … 289 298 } 290 299 /// <summary> 300 /// Opens the last opened file in the fileopening service 301 /// </summary> 302 /// <returns></returns> 303 public IActionResult OpenRecent() 304 { 305 if (init()) 306 { 307 var serve = weblog.getFileOpener(userId); 308 ViewBag.JobsCount = serve.Job.Job.JobCount; 309 ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Uploads"; 310 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); 311 return View("OpenFile", serve.vm); 312 } 313 else 314 { 315 return RedirectToAction("Index", "Home"); 316 } 317 } 318 /// <summary> 291 319 /// Adds current opened file to hive, uses FileOpeningService singleton 292 320 /// </summary> … … 318 346 return RedirectToAction("Uploads", "Job"); 319 347 } 320 348 else 321 349 { 322 350 return RedirectToAction("Index", "Home"); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs
r13827 r13841 192 192 */ 193 193 } 194 195 public IActionResult ApproveUser(string id) 196 { 197 if (init()) 198 { 199 Guid curr = Guid.Parse(id); 200 201 UserViewModel vm = new UserViewModel(accessClient).refreshAll(); 202 203 var us = vm.getUserById(curr); 204 us.IsApproved = true; 205 accessClient.updateUser(us); 206 return RedirectToAction("SelectUser", new { id = id }); 207 208 } 209 else 210 { 211 return RedirectToAction("Index", "Home"); 212 } 213 } 194 214 /// <summary> 195 215 /// Delete a user -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/JobUpdaterHub.cs
r13739 r13841 32 32 else { 33 33 userId = Guid.Parse(uid); 34 fileopener = weblog.get FileOpener(userId);34 fileopener = weblog.getJobOpener(userId); 35 35 } 36 36 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/ProgressHub.cs
r13834 r13841 103 103 } 104 104 } 105 Clients.Caller.processMessage("Connection Established"); 106 } 107 public void changeName(int[][] arr, string name, int idname) 108 { 109 110 if (name != "" && name != null) 111 { 112 loader(); 113 114 HiveTask current = fileopener.Job.HiveTasks.ToList()[0]; 115 if (arr.Length == 0) 116 {//check if upper job 117 current.ItemTask.Name = name; 118 119 } 120 else 121 { 122 for (var i = 0; i < arr.Length; i++) 123 {//loop for depth 124 if (i == arr.Length - 1) 125 {//Right depth reached, change name for current 126 if (current.ItemTask.Item is BatchRun) 127 { 128 current.ChildHiveTasks[arr[i][1]].ItemTask.Name = name; 129 } 130 else if (current.ItemTask.Item is Experiment) 131 { 132 current.ChildHiveTasks[arr[i][0]].ItemTask.Name = name; 133 } 134 135 } 136 else 137 {//not deep enough, choose right path 138 if (current.ItemTask.Item is BatchRun) 139 current = current.ChildHiveTasks[arr[i][1]]; // select right batch 140 else if (current.ItemTask.Item is Experiment) 141 current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment 142 } 143 } 144 } 145 Clients.Caller.processName(name, idname); 146 } 147 } 148 public void changeRepit(int[][] arr, int repit) 149 { 150 loader(); 151 HiveTask current = fileopener.Job.HiveTasks.ToList()[0]; 152 string Name = "failed"; 153 if (arr.Length == 0) 154 {//check if upper job 155 if (current.ItemTask.Item is BatchRun) 156 { 157 var b = (BatchRun)current.ItemTask.Item; 158 b.Repetitions = repit; 159 Name = current.ItemTask.Name; 160 } 161 162 } 163 else 164 { 165 for (var i = 0; i < arr.Length; i++) 166 {//loop for depth 167 if (i == arr.Length - 1) 168 {//Right depth reached, change name for current 169 if (current.ChildHiveTasks[arr[i][0]].ItemTask.Item is BatchRun) 170 { 171 var b = (BatchRun)current.ChildHiveTasks[arr[i][0]].ItemTask.Item; 172 b.Repetitions = repit; 173 Name = current.ChildHiveTasks[arr[i][0]].ItemTask.Name; 174 } 175 } 176 else 177 {//not deep enough, choose right path 178 if (current.ItemTask.Item is BatchRun) 179 current = current.ChildHiveTasks[arr[i][1]]; // select right batch 180 else if (current.ItemTask.Item is Experiment) 181 current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment 182 } 183 } 184 } 185 Clients.Caller.processRepit(Name, repit); 186 105 187 } 106 188 /// <summary> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/ProgressHubber.js
r13834 r13841 22 22 } 23 23 }; 24 hubber.client.processName = function (name, random) { 25 26 $("#nameCarrier" + random).html(name); 27 28 }; 29 hubber.client.processRepit = function (name, repit) { 30 if (name === "failed") { 31 window.alert("Something went wrong while changing the repititions, please try again") 32 } 33 else 34 window.alert("Repititions for " + name + " has been changed to " + repit + ". These changes are not shown in the interface but happen directly after uploading or saving."); 35 } 24 36 hubber.client.dataNotSupported = function (name) { 25 37 window.alert("Parameter " + name + " could not be changed for it is a fixed parameter. All changes done in this view are not saved to Hive."); … … 56 68 //Changes a tasks priority 57 69 function changePriority(arr, prior, idprior) { 58 console.log(arr + " to priority " + prior);59 70 hubber.server.changePriority(arr, prior); 60 71 resetPrior(idprior); … … 83 94 document.getElementById("prior" + id).className = "btn dropdown-toggle "; 84 95 } 85 86 96 //changes name of a task 97 function changeName(arr, name, idname) { 98 hubber.server.changeName(arr, name, idname); 99 } 100 function changeRepit(arr, repit) { 101 hubber.server.changeRepit(arr, repit); 102 } 87 103 function paraEdit(arr, problem, name, type, value) { 88 104 hubber.server.paraEdit(arr, problem, name, type, value); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/UserInfoHubber.js
r13805 r13841 8 8 $.connection.hub.start(); 9 9 hubber.client.showNewPass = function (pass) { 10 $("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: " + pass + ". An email has been sent to the user containing the new password</label>");10 $("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: '" + pass + "'. An email has been sent to the user containing the new password</label>"); 11 11 12 12 }; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs
r13805 r13841 19 19 private List<HiveServiceLocatorWeb> locators; 20 20 private List<HiveClientWeb> webclients; 21 private List<FileOpeningService> jobopeners; 21 22 private List<FileOpeningService> fileopeners; 22 23 private List<AccessAdministrationClient> accessclients; … … 46 47 locators = new List<HiveServiceLocatorWeb>(); 47 48 webclients = new List<HiveClientWeb>(); 49 jobopeners = new List<FileOpeningService>(); 48 50 fileopeners = new List<FileOpeningService>(); 49 51 accessclients = new List<AccessAdministrationClient>(); … … 69 71 var temp2 = new FileOpeningService(log.userId); 70 72 fileopeners.Add(temp2); 73 temp2 = new FileOpeningService(log.userId); 74 jobopeners.Add(temp2); 71 75 var temp3 = new AccessAdministrationClient(log.userId); 72 76 accessclients.Add(temp3); … … 124 128 } 125 129 130 public FileOpeningService getJobOpener(Guid id) 131 { 132 return jobopeners.Find(x => x.UserId == id); 133 } 126 134 /// <summary> 127 135 /// Returns the AccessAdministrationClient used for User/Group/Role management … … 152 160 locators.RemoveAll(x => x.UserId == id); 153 161 fileopeners.RemoveAll(x => x.UserId == id); 162 jobopeners.RemoveAll(x => x.UserId == id); 154 163 accessclients.RemoveAll(x => x.userId == id); 155 164 adminclients.RemoveAll(x => x.userId == id); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml
r13834 r13841 42 42 </a> 43 43 </div> 44 @Html.Partial("OpenFilePartials/_Help", Model); 44 45 <!-- Check model to select right partial, partial handles all subloading --> 45 46 <div class="col-md-9"> … … 164 165 </div> 165 166 <div class="col-sm-4"> 166 <h4>Save to file</h4> 167 <h3 style="text-align:center">Save to file</h3> 168 <p style="text-align:center;font-style:italic">Changed parameters get saved but child distribution and task priority get lost in the process.</p> 167 169 <form asp-controller="Job" 168 170 asp-action="saveToFile" … … 200 202 </div> 201 203 <!-- Side scrolling menu--> 202 <nav style="margin-top:50px; "204 <nav 203 205 class="col-md-2" id="scrolly"> 204 206 <ul class="nav nav-pills nav-stacked" … … 238 240 $('html, body').animate({ 239 241 scrollTop: target.offset().top 240 }, 1000);242 }, 700); 241 243 return false; 242 244 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/DataPartials/DataMaster.cshtml
r13834 r13841 12 12 @Html.Partial("OpenFilePartials/DataPartials/Bool", Model); 13 13 } 14 else if (Model.Data.ActualValue is BoolArray) 15 { 16 @Html.Partial("OpenFilePartials/DataPartials/BoolArray", Model); 17 } 18 else if (Model.Data.ActualValue is BoolMatrix) 19 { 20 @Html.Partial("OpenFilePartials/DataPartials/BoolMatrix", Model); 21 } 14 22 else if (Model.Data.ActualValue is StringValue) 15 23 { 16 24 @Html.Partial("OpenFilePartials/DataPartials/String", Model); 25 } 26 else if (Model.Data.ActualValue is StringArray) 27 { 28 @Html.Partial("OpenFilePartials/DataPartials/StringArray", Model); 29 } 30 else if (Model.Data.ActualValue is StringMatrix) 31 { 32 @Html.Partial("OpenFilePartials/DataPartials/StringMatrix", Model); 17 33 } 18 34 else if (Model.Data.ActualValue is IntValue) … … 20 36 @Html.Partial("OpenFilePartials/DataPartials/Int", Model); 21 37 } 38 else if (Model.Data.ActualValue is IntArray && !(Model.Data.ActualValue is HeuristicLab.Encodings.PermutationEncoding.Permutation)) 39 { 40 @Html.Partial("OpenFilePartials/DataPartials/IntArray", Model); 41 } 42 else if (Model.Data.ActualValue is IntMatrix) 43 { 44 @Html.Partial("OpenFilePartials/DataPartials/IntMatrix", Model); 45 } 22 46 else if (Model.Data.ActualValue is PercentValue) 23 47 { 24 48 @Html.Partial("OpenFilePartials/DataPartials/Percent", Model); 25 49 } 50 else if (Model.Data.ActualValue is PercentArray) 51 { 52 @Html.Partial("OpenFilePartials/DataPartials/PercentArray", Model); 53 } 54 else if (Model.Data.ActualValue is PercentMatrix) 55 { 56 @Html.Partial("OpenFilePartials/DataPartials/PercentMatrix", Model); 57 } 26 58 else if (Model.Data.ActualValue is DoubleValue) 27 59 { 28 60 @Html.Partial("OpenFilePartials/DataPartials/Double", Model); 29 }30 else if (Model.Data.ActualValue is IntArray)31 {32 @Html.Partial("OpenFilePartials/DataPartials/IntArray", Model);33 61 } 34 62 else if (Model.Data.ActualValue is DoubleArray) … … 42 70 else if (Model.Data.ActualValue is IItem) 43 71 { 44 @Html.Partial("OpenFilePartials/DataPartials/Others ", Model);72 @Html.Partial("OpenFilePartials/DataPartials/OthersClean", Model);//just Others to print the datatype too 45 73 } 46 74 } 47 75 catch(NotSupportedException e) 48 76 { 49 @Html.Partial("OpenFilePartials/DataPartials/Others ", Model)77 @Html.Partial("OpenFilePartials/DataPartials/OthersClean", Model) 50 78 51 79 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/DataPartials/DoubleMatrix.cshtml
r13834 r13841 10 10 { 11 11 s += "[ "; 12 s += dat[d,0] + "; " + dat[d,1]; 12 for (var i = 0; i < dat.Columns; i++) 13 { 14 s += dat[d, i]; 15 if (i < dat.Columns - 1) 16 { 17 s += "; "; 18 } 19 20 } 13 21 s += " ] " + Environment.NewLine; 14 22 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Algorithm.cshtml
r13827 r13841 13 13 <div class="row" style="text-align:center"> 14 14 <h1> 15 <span class="label label-primary">Algorithm: @Model.SelectedTask.ItemTask.Name</span>15 <span class="label label-primary">Algorithm:<span id="nameCarrier@(randy)">@Model.SelectedTask.ItemTask.Name</span></span> 16 16 </h1> 17 17 <p> 18 <input type="text" 19 style="width:50%;display:initial; background-color:transparent;text-align:center" 20 onchange="changeName([],this.value,@randy)" 21 value="@Model.SelectedTask.ItemTask.Name" /> 22 </p> 18 23 </div> 19 24 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_AlgorithmSmall.cshtml
r13827 r13841 12 12 <p class="text-center"> 13 13 <a class="btn btn-primary" 14 id="nameCarrier@(randomal)" 14 15 data-toggle="collapse" 15 16 href="#collapseExample@(randomal)" … … 33 34 text-shadow:none"> 34 35 <div class="panel-heading panel-primary text-center"> 36 <p> 37 <input type="text" 38 class="form-control" 39 style="width:50%;display:initial; background-color:transparent; color:white;text-align:center" 40 onchange="changeName(@builder,this.value,@randomal)" 41 value="@Model.algo.Name" /> 42 </p> 35 43 <p>@Model.algo.Description</p> 36 44 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml
r13827 r13841 11 11 <div class="row" 12 12 style="text-align:center"> 13 <h1 14 > 13 <h1> 15 14 <span class="label label-warning " 16 15 style="text-shadow:2px 2px black;"> 17 Batch: @Model.SelectedBatchRun.Name16 Batch: <span id="nameCarrier@(randy)">@Model.SelectedBatchRun.Name</span> 18 17 </span> 18 19 19 </h1> 20 <input type="text" 21 class="form-control" 22 style="width:50%;display:initial; background-color:transparent;text-align:center" 23 onchange="changeName([],this.value,@randy)" 24 value="@Model.SelectedTask.ItemTask.Name" /> 20 25 </div> 21 26 <h4 id="tasks"> 22 Repeats: @Model.SelectedBatchRun.Repetitions x 27 Repeats: 28 <input type="number" 29 class="form-control" 30 style="width:80px;display:initial" 31 min="1" 32 value="@Model.SelectedBatchRun.Repetitions" 33 onchange="changeRepit([],this.value,@randy)" /> 34 x 23 35 24 36 </h4> … … 30 42 data-onstyle="warning" 31 43 onchange="toggleChild([], @randy)" /> 32 44 33 45 </p> 34 46 <div id="childs@(randy)"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml
r13827 r13841 13 13 <p class="text-center"> 14 14 <a class="btn btn-warning" 15 id="nameCarrier@(randombr)" 15 16 data-toggle="collapse" 16 17 href="#collapseExample@(randombr)" … … 36 37 text-shadow:2px 2px black"> 37 38 <div class="panel-heading text-center"> 39 <p> 40 <input type="text" 41 class="form-control" 42 style="width:50%;display:initial; background-color:transparent;text-align:center;color:white" 43 onchange="changeName(@builder,this.value,@randombr)" 44 value="@Model.batch.Name" /> 45 </p> 38 46 <p class="panel-title"> 39 Repeats @Model.batch.Repetitions X 47 Repeats: 48 <input type="number" 49 class="form-control" 50 style="width:80px;display:initial; margin-bottom:5px" 51 min="1" 52 value="@Model.batch.Repetitions" 53 onchange="changeRepit(@builder,this.value,@randombr)" /> 54 x 40 55 </p> 41 56 <p> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml
r13827 r13841 12 12 > 13 13 <span class="label label-danger" 14 style="text-shadow:2px 2px black;"> 15 Experiment: @Model.SelectedTask.ItemTask.Name 14 style="text-shadow:2px 2px black;">Experiment: 15 <span id="nameCarrier@(randy)"> 16 @Model.SelectedTask.ItemTask.Name 17 </span> 16 18 </span> 17 19 </h1> 18 20 <p> 21 <input type="text" 22 style="width:50%;display:initial; background-color:transparent;text-align:center" 23 onchange="changeName([],this.value,@randy)" 24 value="@Model.SelectedTask.ItemTask.Name" /> 25 </p> 19 26 </div> 20 27 <h4 id="tasks"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml
r13827 r13841 14 14 href="#collapseExample@(randomex)" 15 15 aria-expanded="false" 16 id="nameCarrier@(randomex)" 16 17 aria-controls="collapseExample@(randomex)" 17 18 style="margin:10px; margin-bottom:0; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); … … 34 35 35 36 <div class="panel-heading panel-danger text-center"> 37 <p> 38 <input type="text" 39 class="form-control" 40 style="width:50%;display:initial; background-color:transparent; color:white;text-align:center" 41 onchange="changeName(@builder,this.value,@randomex)" 42 value="@Model.exp.Name" /> 43 </p> 36 44 <p class="panel-title"> 37 45 Children: @Model.exp.Optimizers.Count -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml
r13827 r13841 80 80 } 81 81 </div> 82 @if (ViewBag.active != null && ViewBag.active == true) 83 { 84 <div> 85 <a class="btn btn-warning btn-block" 86 asp-controller="Job" 87 asp-action="OpenRecent" 88 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 89 text-shadow:2px 2px black;margin-top:10px"> 90 <i class="fa fa-undo"></i> Reopen last file 91 </a> 92 </div> 93 94 } 95 82 96 </div> 83 97 <p style="display:none" -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml
r13827 r13841 68 68 </div> 69 69 <div class="btn-group-vertical btn-block"> 70 71 70 71 72 72 @foreach (var user in Model.users) 73 73 { … … 111 111 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 112 112 <div class="row"> 113 <h2 style="padding-left:20px"> 113 @if (Model.SelectedUser.Id != Guid.Empty && Model.SelectedUser.IsApproved) 114 {<div class="row" style="margin-right:20px"> 115 <a class="btn btn-success pull-right disabled"><i class="fa fa-check-square-o "></i> Approved</a> 116 </div> 117 } 118 else if (Model.SelectedUser.Id != Guid.Empty && !Model.SelectedUser.IsApproved) 119 {<div class="row" style="margin-right:20px"> 120 <a class="btn btn-warning pull-right" 121 asp-action="approveUser" 122 asp-controller="User" 123 asp-route-id="@Model.SelectedUser.Id"> 124 <i class="fa fa-square-o" ></i> Not approved 125 </a> 126 127 </div> 128 } 129 <h2 style="padding-left:20px; margin-top:0"> 114 130 @if (Model.SelectedUser.Id != Guid.Empty) 115 131 { 116 <i class="fa fa-user "></i> @Model.SelectedUser.UserName; 132 <i class="fa fa-user "></i> @Model.SelectedUser.UserName 133 117 134 } 118 135 else … … 122 139 } 123 140 </h2> 141 124 142 <form class="form-horizontal" 125 143 method="post" … … 189 207 190 208 </div> 191 <div class="form-group"> 192 <label class="col-sm-3 control-label"> 193 User created 194 </label> 195 <label class="col-sm-8 control-label" style="text-align:left"> 196 @Model.SelectedUser.CreationDate.AddHours(2).ToString(); 197 </label> 198 </div> 199 <div class="form-group"> 200 <label class="col-sm-3 control-label"> 201 Last activity 202 </label> 203 <label class="col-sm-8 control-label" style="text-align:left"> 204 @Model.SelectedUser.LastActivityDate.AddHours(2).ToString() 205 </label> 206 </div> 207 <div class="form-group"> 208 <label class="col-sm-3 control-label"> 209 Password 210 </label> 211 <div id="inppassreset" class="col-sm-8"> 212 Last change: @Model.SelectedUser.LastPasswordChangedDate.ToShortDateString() 213 <button type="button" 214 onclick="resetPass('@(Model.SelectedUser.Id)')" 215 class="btn btn-default"> 216 <i class="fa fa-unlock"></i> Reset password 217 </button> 218 </div> 219 </div> 220 221 <div class="form-group"> 222 <label class="col-sm-3 control-label"> 223 Member of @Model.SelectedUserSubscriptions.Count groups 224 </label> 225 <div class="col-sm-8 control-label" style="text-align:left"> 226 @if (Model.SelectedUserSubscriptions.Count > 0) 227 { 228 @foreach (var g in Model.SelectedUserSubscriptions) 209 <div class="form-group"> 210 <label class="col-sm-3 control-label"> 211 User created 212 </label> 213 <label class="col-sm-8 control-label" style="text-align:left"> 214 @Model.SelectedUser.CreationDate.AddHours(2).ToString(); 215 </label> 216 </div> 217 <div class="form-group"> 218 <label class="col-sm-3 control-label"> 219 Last activity 220 </label> 221 <label class="col-sm-8 control-label" style="text-align:left"> 222 @Model.SelectedUser.LastActivityDate.AddHours(2).ToString() 223 </label> 224 </div> 225 <div class="form-group"> 226 <label class="col-sm-3 control-label"> 227 Password 228 </label> 229 <div id="inppassreset" class="col-sm-8"> 230 Last change: @Model.SelectedUser.LastPasswordChangedDate.ToShortDateString() 231 <button type="button" 232 onclick="resetPass('@(Model.SelectedUser.Id)')" 233 class="btn btn-default"> 234 <i class="fa fa-unlock"></i> Reset password 235 </button> 236 </div> 237 </div> 238 239 <div class="form-group"> 240 <label class="col-sm-3 control-label"> 241 Member of @Model.SelectedUserSubscriptions.Count groups 242 </label> 243 <div class="col-sm-8 control-label" style="text-align:left"> 244 @if (Model.SelectedUserSubscriptions.Count > 0) 229 245 { 230 <div class="row"> 231 <p class="col-sm-10"><i class="fa fa-group"></i> @g.Name</p> 232 <p class="col-sm-2"> 233 <a class="btn btn-danger pull-right" 234 asp-controller="User" 235 asp-action="deleteUserGroup" 236 asp-route-id="@Model.SelectedUser.Id" 237 asp-route-group="@g.Id" 238 onclick="showDeleter()"> 239 <i class="fa fa-trash-o"></i> 240 </a> 241 </p> 242 </div> 246 @foreach (var g in Model.SelectedUserSubscriptions) 247 { 248 <div class="row"> 249 <p class="col-sm-10"><i class="fa fa-group"></i> @g.Name</p> 250 <p class="col-sm-2"> 251 <a class="btn btn-danger pull-right" 252 asp-controller="User" 253 asp-action="deleteUserGroup" 254 asp-route-id="@Model.SelectedUser.Id" 255 asp-route-group="@g.Id" 256 onclick="showDeleter()"> 257 <i class="fa fa-trash-o"></i> 258 </a> 259 </p> 260 </div> 261 } 243 262 } 244 } 245 else 246 { 247 <p>Not a member of any groups</p> 248 } 249 </div> 250 </div> 263 else 264 { 265 <p>Not a member of any groups</p> 266 } 267 </div> 268 </div> 251 269 } 252 270 … … 293 311 <div class="form-group"> 294 312 <label class="col-sm-3 control-label"> 295 @Model.SelectedUserRoles.Count Roles313 @Model.SelectedUserRoles.Count Roles 296 314 </label> 297 315 <div class="col-sm-8 control-label" style="text-align:left"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/progresshubber.js
r13834 r13841 1 function addtoHive(){var a=document.getElementById("jname").value,b=document.getElementById("jresource").value;a&&""!=a&&null!=a?(hubber.server.changeNameResource(a,b),document.getElementById("fakehiveadd").style.display="none",document.getElementById("progdiv").style.display="",document.getElementById("result").style.display="",document.getElementById("realhiveadd").click()):alert("Job name not set!")}function toggleChild(a,b){console.log(a+" toggled"),hubber.server.toggleChild(a),"none"==$("#childs"+b).css("display")?$("#childs"+b).css("display",""):$("#childs"+b).css("display","none"),$("body").click()}function changePriority(a,b,c){switch( console.log(a+" to priority "+b),hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}function paraEdit(a,b,c,d,e){hubber.server.paraEdit(a,b,c,d,e)}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))},hubber.client.dataNotSupported=function(a){window.alert("Parameter "+a+" could not be changed for it is a fixed parameter. All changes done in this view are not saved to the server.")},hubber.client.formatWrong=function(a,b){window.alert("Parameter "+a+" could not be changed, the format for "+b+" was wrong. Make sure you follow the example exactly. No changes made on the server")}});1 function addtoHive(){var a=document.getElementById("jname").value,b=document.getElementById("jresource").value;a&&""!=a&&null!=a?(hubber.server.changeNameResource(a,b),document.getElementById("fakehiveadd").style.display="none",document.getElementById("progdiv").style.display="",document.getElementById("result").style.display="",document.getElementById("realhiveadd").click()):alert("Job name not set!")}function toggleChild(a,b){console.log(a+" toggled"),hubber.server.toggleChild(a),"none"==$("#childs"+b).css("display")?$("#childs"+b).css("display",""):$("#childs"+b).css("display","none"),$("body").click()}function changePriority(a,b,c){switch(hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}function changeName(a,b,c){hubber.server.changeName(a,b,c)}function changeRepit(a,b){hubber.server.changeRepit(a,b)}function paraEdit(a,b,c,d,e){hubber.server.paraEdit(a,b,c,d,e)}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))},hubber.client.processName=function(a,b){$("#nameCarrier"+b).html(a)},hubber.client.processRepit=function(a,b){"failed"===a?window.alert("Something went wrong while changing the repititions, please try again"):window.alert("Repititions for "+a+" has been changed to "+b+". These changes are not shown in the interface but happen directly after uploading or saving.")},hubber.client.dataNotSupported=function(a){window.alert("Parameter "+a+" could not be changed for it is a fixed parameter. All changes done in this view are not saved to Hive.")},hubber.client.formatWrong=function(a,b){window.alert("Parameter "+a+" could not be changed, the format for "+b+" was wrong. Make sure you follow the example exactly. No changes made on Hive")}}); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/userinfohubber.js
r13827 r13841 1 function resetPass(a){hubber.server.resetPassword(a)}var hubber=$.connection.userInfoHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start(),hubber.client.showNewPass=function(a){$("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: "+a+". An email has been sent to the user containing the new password</label>")}});1 function resetPass(a){hubber.server.resetPassword(a)}var hubber=$.connection.userInfoHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start(),hubber.client.showNewPass=function(a){$("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: '"+a+"'. An email has been sent to the user containing the new password</label>")}}); -
branches/WebJobManager/HeuristicLab.Data/3.3/BoolArray.cs
r12012 r13841 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using System.Linq; 26 27 27 28 namespace HeuristicLab.Data { … … 41 42 return new BoolArray(this, cloner); 42 43 } 43 44 protected virtual bool Validate(string value, out string errorMessage) { 44 public static BoolArray Parse(string val) 45 { 46 try 47 { 48 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 49 bool[] a = arr.Where(s => s != "").ToList().ConvertAll(s => bool.Parse(s)).ToArray(); 50 return new BoolArray(a); 51 } 52 catch (System.FormatException e) 53 { 54 return null; 55 } 56 } 57 protected virtual bool Validate(string value, out string errorMessage) { 45 58 bool val; 46 59 bool valid = bool.TryParse(value, out val); -
branches/WebJobManager/HeuristicLab.Data/3.3/BoolMatrix.cs
r12012 r13841 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Linq; 27 28 28 29 namespace HeuristicLab.Data { … … 46 47 return new BoolMatrix(this, cloner); 47 48 } 49 public static BoolMatrix Parse(string val) 50 { 51 try 52 { 53 val = val.Replace("]", string.Empty); 48 54 49 protected virtual bool Validate(string value, out string errorMessage) { 55 string[] parts = val.Split('['); 56 var r = parts.Length; 57 var c = parts[1].Split(';').Length; 58 val = val.Replace("\n", ";"); 59 val = val.Replace("[", string.Empty); 60 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 61 bool[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (bool.Parse(s))).ToArray(); 62 bool[,] b = new bool[r, c]; 63 var rowcount = 0; 64 for (int i = 0; i < a.Length;) 65 { 66 for (int j = 0; j < c; j++) 67 { 68 b[rowcount, j] = a[i]; 69 i++; 70 } 71 rowcount++; 72 } 73 return new BoolMatrix(b); 74 } 75 catch (System.FormatException e) 76 { 77 return null; 78 } 79 } 80 protected virtual bool Validate(string value, out string errorMessage) { 50 81 bool val; 51 82 bool valid = bool.TryParse(value, out val); -
branches/WebJobManager/HeuristicLab.Data/3.3/DoubleArray.cs
r12432 r13841 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using System; 27 using System.Linq; 26 28 27 29 namespace HeuristicLab.Data { … … 41 43 return new DoubleArray(this, cloner); 42 44 } 45 public static DoubleArray Parse(string val) 46 { 47 try 48 { 49 string[] arr = Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 50 double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => double.Parse(s)).ToArray(); 51 return new DoubleArray(a); 52 } 53 catch (FormatException e) 54 { 55 return null; 56 } 57 } 43 58 44 protected virtual bool Validate(string value, out string errorMessage) {59 protected virtual bool Validate(string value, out string errorMessage) { 45 60 double val; 46 61 bool valid = double.TryParse(value, out val); -
branches/WebJobManager/HeuristicLab.Data/3.3/DoubleMatrix.cs
r12432 r13841 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Linq; 27 28 28 29 namespace HeuristicLab.Data { … … 46 47 return new DoubleMatrix(this, cloner); 47 48 } 49 public static DoubleMatrix Parse(string val) 50 { 51 try 52 { 53 54 val = val.Replace("]", string.Empty); 55 56 string[] parts = val.Split('['); 57 var r = parts.Length; 58 var c = parts[1].Split(';').Length; 59 val = val.Replace("\n", ";"); 60 val = val.Replace("[", string.Empty); 61 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 62 double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => double.Parse(s)).ToArray(); 63 double[,] b = new double[r,c]; 64 var rowcount = 0; 65 for(int i = 0; i < a.Length;) 66 { 67 for(int j = 0; j < c; j++) 68 { 69 b[rowcount, j] = a[i]; 70 i++; 71 } 72 rowcount++; 73 } 74 return new DoubleMatrix(b); 75 } 76 catch (System.FormatException e) 77 { 78 return null; 79 } 80 } 48 81 49 protected virtual bool Validate(string value, out string errorMessage) {82 protected virtual bool Validate(string value, out string errorMessage) { 50 83 double val; 51 84 bool valid = double.TryParse(value, out val); -
branches/WebJobManager/HeuristicLab.Data/3.3/IntMatrix.cs
r12012 r13841 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Linq; 27 28 28 29 namespace HeuristicLab.Data { … … 46 47 return new IntMatrix(this, cloner); 47 48 } 49 public static IntMatrix Parse(string val) 50 { 51 try 52 { 53 val = val.Replace("]", string.Empty); 48 54 49 protected virtual bool Validate(string value, out string errorMessage) { 55 string[] parts = val.Split('['); 56 var r = parts.Length; 57 var c = parts[1].Split(';').Length; 58 val = val.Replace("\n", ";"); 59 val = val.Replace("[", string.Empty); 60 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 61 int[] a = arr.Where(s => s != "").ToList().ConvertAll(s => int.Parse(s)).ToArray(); 62 int[,] b = new int[r, c]; 63 var rowcount = 0; 64 for (int i = 0; i < a.Length;) 65 { 66 for (int j = 0; j < c; j++) 67 { 68 b[rowcount, j] = a[i]; 69 i++; 70 } 71 rowcount++; 72 } 73 return new IntMatrix(b); 74 } 75 catch (System.FormatException e) 76 { 77 return null; 78 } 79 } 80 protected virtual bool Validate(string value, out string errorMessage) { 50 81 int val; 51 82 bool valid = int.TryParse(value, out val); -
branches/WebJobManager/HeuristicLab.Data/3.3/PercentArray.cs
r12012 r13841 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using System.Linq; 26 27 27 28 namespace HeuristicLab.Data { … … 41 42 return new PercentArray(this, cloner); 42 43 } 43 44 public override string ToString() { 44 45 public static PercentArray Parse(string val) 46 { 47 try 48 { 49 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 50 double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (double.Parse(s)/100)).ToArray(); 51 return new PercentArray(a); 52 } 53 catch (System.FormatException e) 54 { 55 return null; 56 } 57 } 58 public override string ToString() { 45 59 StringBuilder sb = new StringBuilder(); 46 60 sb.Append("["); -
branches/WebJobManager/HeuristicLab.Data/3.3/PercentMatrix.cs
r12012 r13841 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Linq; 27 28 28 29 namespace HeuristicLab.Data { … … 46 47 return new PercentMatrix(this, cloner); 47 48 } 49 public static PercentMatrix Parse(string val) 50 { 51 try 52 { 53 val = val.Replace("]", string.Empty); 48 54 49 public override string ToString() { 55 string[] parts = val.Split('['); 56 var r = parts.Length; 57 var c = parts[1].Split(';').Length; 58 val = val.Replace("\n", ";"); 59 val = val.Replace("[", string.Empty); 60 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 61 double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (double.Parse(s)/100)).ToArray(); 62 double[,] b = new double[r, c]; 63 var rowcount = 0; 64 for (int i = 0; i < a.Length;) 65 { 66 for (int j = 0; j < c; j++) 67 { 68 b[rowcount, j] = a[i]; 69 i++; 70 } 71 rowcount++; 72 } 73 return new PercentMatrix(b); 74 } 75 catch (System.FormatException e) 76 { 77 return null; 78 } 79 } 80 public override string ToString() { 50 81 StringBuilder sb = new StringBuilder(); 51 82 sb.Append("["); -
branches/WebJobManager/HeuristicLab.Data/3.3/StringArray.cs
r13656 r13841 77 77 } 78 78 } 79 public virtual string this[int index] 79 public static StringArray Parse(string val) 80 { 81 try 82 { 83 string[] arr = Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 84 return new StringArray(arr); 85 } 86 catch (FormatException e) 87 { 88 return null; 89 } 90 } 91 public virtual string this[int index] 80 92 { 81 93 get { return array[index]; } -
branches/WebJobManager/HeuristicLab.Data/3.3/StringMatrix.cs
r13656 r13841 92 92 } 93 93 } 94 95 public virtual int Rows 94 public static StringMatrix Parse(string val) 95 { 96 try 97 { 98 val = val.Replace("]", string.Empty); 99 100 string[] parts = val.Split('['); 101 var r = parts.Length; 102 var c = parts[1].Split(';').Length; 103 val = val.Replace("\n", ";"); 104 val = val.Replace("[", string.Empty); 105 string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim()); 106 string[] a = arr.Where(s => s != "").ToArray(); 107 string[,] b = new string[r, c]; 108 var rowcount = 0; 109 for (int i = 0; i < a.Length;) 110 { 111 for (int j = 0; j < c; j++) 112 { 113 b[rowcount, j] = a[i]; 114 i++; 115 } 116 rowcount++; 117 } 118 return new StringMatrix(b); 119 } 120 catch (System.FormatException e) 121 { 122 return null; 123 } 124 } 125 public virtual int Rows 96 126 { 97 127 get { return matrix.GetLength(0); }
Note: See TracChangeset
for help on using the changeset viewer.