Changeset 13847
- Timestamp:
- 05/12/16 17:09:12 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 3 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs
r13841 r13847 30 30 private Guid userId; 31 31 32 32 33 private JobViewModel vm; 34 private UploadedJobViewModel upper; 33 35 private IHostingEnvironment _environment; 34 36 … … 38 40 { 39 41 weblog = WebLoginService.Instance; 40 vm = new JobViewModel();42 41 43 _environment = env; 42 44 } … … 48 50 { 49 51 var u = HttpContext.Session.GetString("UserId"); 52 50 53 if (u == null || u == "" || Guid.Parse(u) == Guid.Empty) 51 54 { … … 55 58 { 56 59 userId = Guid.Parse(u); 60 vm = new JobViewModel(weblog.getCurrentUser(userId)); 61 upper = new UploadedJobViewModel(weblog.getCurrentUser(userId)); 62 57 63 serviceLocator = weblog.getServiceLocator(userId); 58 64 serviceClient = serviceLocator.getHiveServiceClient(); 59 65 clientWeb = weblog.getClientWeb(userId); 66 60 67 return serviceLocator.CheckLogin(); 61 68 } … … 149 156 if (init()) 150 157 { 151 UploadedJobViewModel upper = new UploadedJobViewModel();152 158 fillUploadsPaths(upper, -1); 153 159 ViewBag.Name = serviceClient.ClientCredentials.UserName.UserName; … … 172 178 if (init()) 173 179 { 174 UploadedJobViewModel upper = new UploadedJobViewModel();175 180 fillUploadsPaths(upper, index); 176 181 if (index != -1) … … 188 193 } 189 194 } 195 [HttpPost] 196 public IActionResult changeDirName(string olddir, string dirname) 197 { 198 if (init()) 199 { 200 fillUploadsPaths(upper, -1); 201 var ind = upper.DisplayDatePaths.IndexOf(olddir); 202 try { 203 204 205 var start = Path.Combine(_environment.WebRootPath, "uploads", serviceClient.ClientCredentials.UserName.UserName, dirname); 206 if (Directory.Exists(start)) 207 { 208 var files = Directory.GetFiles(upper.FullDatePaths[ind]); 209 foreach(var f in files) { 210 var target = start + "\\" + f.Split('\\').Last(); 211 if (System.IO.File.Exists(target)) 212 System.IO.File.Delete(target); 213 System.IO.File.Move(f, target); 214 } 215 } 216 else 217 { 218 Directory.Move(upper.FullDatePaths[ind], start); 219 } 220 221 upper.clear(); 222 fillUploadsPaths(upper, -1); 223 ind = upper.DisplayDatePaths.IndexOf(dirname); 224 upper.clear(); 225 return RedirectToAction("UploadDir",new { index=ind}); 226 }catch(IOException e) 227 { 228 upper.clear(); 229 fillUploadsPaths(upper, ind); 230 upper.message = "Error in new directory name. Try again and don't use any special signs"; 231 ViewBag.Title = "Error renaming - "+ upper.DisplayDatePaths[ind] + " - Uploads"; 232 if (weblog.getFileOpener(userId).Job != null) 233 ViewBag.active = true; 234 return View("Uploads", upper); 235 } 236 } 237 else 238 { 239 return RedirectToAction("Index", "Home"); 240 } 241 } 190 242 /// <summary> 191 243 /// Loads all the paths from the selected uploads folder … … 195 247 private void fillUploadsPaths(UploadedJobViewModel vm, int index) 196 248 { 249 197 250 var tempdex = index; //Fix when maps gets deleted 198 251 var start = Path.Combine(_environment.WebRootPath, "uploads", serviceClient.ClientCredentials.UserName.UserName); 252 try 253 { 254 Directory.GetDirectories(start); 255 } 256 catch(DirectoryNotFoundException e) 257 { 258 Directory.CreateDirectory(start); 259 } 199 260 var dirs = Directory.GetDirectories(start); 200 261 foreach (string dir in dirs) … … 234 295 if (init()) 235 296 { 236 UploadedJobViewModel upper = new UploadedJobViewModel();237 297 fillUploadsPaths(upper, index); 238 298 System.IO.File.Delete(upper.FullFilesPaths[filedex]); 239 299 var message = upper.DisplayFilesPaths[filedex] + " has been deleted"; 240 300 241 upper = new UploadedJobViewModel( );301 upper = new UploadedJobViewModel(weblog.getCurrentUser(userId)); 242 302 fillUploadsPaths(upper, index); 243 303 upper.message = message; … … 264 324 if (init()) 265 325 { 266 UploadedJobViewModel upper = new UploadedJobViewModel();267 326 fillUploadsPaths(upper, index); 268 327 … … 270 329 serve.NewModel(); 271 330 serve.env = _environment; 272 331 serve.vm.directories = upper.DisplayDatePaths; 273 332 var ioptimizer = ContentManager.Load(upper.FullFilesPaths[filedex]); 274 333 … … 306 365 { 307 366 var serve = weblog.getFileOpener(userId); 367 fillUploadsPaths(upper, -1); 368 serve.vm.directories = upper.DisplayDatePaths; 308 369 ViewBag.JobsCount = serve.Job.Job.JobCount; 309 370 ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Uploads"; … … 339 400 } 340 401 [HttpPost] 341 public IActionResult saveToFile(string fname) 342 { 343 if (init()) 344 { 345 weblog.getFileOpener(userId).SaveToFile(fname); 346 return RedirectToAction("Uploads", "Job"); 402 public IActionResult saveToFile(string fname, string dname) 403 { 404 if (init()) 405 { 406 weblog.getFileOpener(userId).SaveToFile(fname, dname); 407 fillUploadsPaths(upper, -1); 408 var ind = upper.DisplayDatePaths.IndexOf(dname); 409 return RedirectToAction("UploadDir", new { index = ind}); 347 410 } 348 411 else … … 356 419 if (init()) 357 420 { 358 UploadedJobViewModel upper = new UploadedJobViewModel();359 421 fillUploadsPaths(upper, index); 360 422 … … 385 447 if (init()) 386 448 { 387 UploadedJobViewModel upper = new UploadedJobViewModel();388 449 var uploads = Path.Combine(_environment.WebRootPath, "uploads", serviceClient.ClientCredentials.UserName.UserName, 389 450 directory); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/ResourceController.cs
r13805 r13847 1 1 using HeuristicLab.Clients.Access; 2 2 using HeuristicLab.Clients.Access.Administration; 3 using HeuristicLab.Clients.Hive.WebJobManager.Models; 3 4 using HeuristicLab.Clients.Hive.WebJobManager.Services; 4 5 using Microsoft.AspNet.Hosting; … … 24 25 private HiveAdminClientWeb adminClient; 25 26 private Guid userId; 27 private HiveWebUser currentUser; 26 28 27 29 private IHostingEnvironment _environment; … … 49 51 adminClient = weblog.getAdminClient(userId); 50 52 accessClient = weblog.getAccessAdminClient(userId); 51 return serviceLocator.CheckLogin(); 52 53 currentUser = weblog.getCurrentUser(userId); 54 if (currentUser.hasResourceAdminAccess()) 55 return serviceLocator.CheckLogin(); 56 else 57 return false; 53 58 } 54 59 } … … 64 69 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); 65 70 ViewBag.Title = "Resources"; 66 return View("Index" );67 } 68 else 69 { 70 return RedirectToAction("Index", " Home");71 return View("Index", currentUser); 72 } 73 else 74 { 75 return RedirectToAction("Index", "Job"); 71 76 } 72 77 } … … 116 121 else 117 122 { 118 return RedirectToAction("Index", " Home");123 return RedirectToAction("Index", "Job"); 119 124 } 120 125 } … … 164 169 else 165 170 { 166 return RedirectToAction("Index", " Home");171 return RedirectToAction("Index", "Job"); 167 172 } 168 173 } … … 195 200 else 196 201 { 197 return RedirectToAction("Index", " Home");202 return RedirectToAction("Index", "Job"); 198 203 } 199 204 } … … 237 242 else 238 243 { 239 return RedirectToAction("Index", " Home");244 return RedirectToAction("Index", "Job"); 240 245 } 241 246 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs
r13841 r13847 24 24 private Guid userId; 25 25 26 private UserViewModel vm; 26 27 private IHostingEnvironment _environment; 27 28 … … 47 48 serviceLocator = weblog.getServiceLocator(userId); 48 49 accessClient = weblog.getAccessAdminClient(userId); 49 return serviceLocator.CheckLogin(); 50 vm = new UserViewModel(accessClient, weblog.getCurrentUser(userId)); 51 if (weblog.getCurrentUser(userId).HasUserAdminAccess()) 52 return serviceLocator.CheckLogin(); 53 else 54 return false; 50 55 51 56 } … … 61 66 { 62 67 ViewBag.Title = "Users"; 63 UserViewModel vm = new UserViewModel(accessClient).refreshAll() ;68 vm.refreshAll() ; 64 69 //Refreshall for users, groups and roles 65 70 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); … … 68 73 else 69 74 { 70 return RedirectToAction("Index", " Home");75 return RedirectToAction("Index", "Job"); 71 76 } 72 77 } … … 78 83 Guid curr = Guid.Parse(id); 79 84 80 UserViewModel vm = new UserViewModel(accessClient).refreshAll();85 vm.refreshAll(); 81 86 if (curr == Guid.Empty) 82 87 {//new user … … 97 102 else 98 103 { 99 return RedirectToAction("Index", " Home");104 return RedirectToAction("Index", "Job"); 100 105 } 101 106 } … … 162 167 else 163 168 { 164 return RedirectToAction("Index", " Home");169 return RedirectToAction("Index", "Job"); 165 170 } 166 171 … … 199 204 Guid curr = Guid.Parse(id); 200 205 201 UserViewModel vm = new UserViewModel(accessClient).refreshAll();206 vm.refreshAll(); 202 207 203 208 var us = vm.getUserById(curr); … … 209 214 else 210 215 { 211 return RedirectToAction("Index", " Home");216 return RedirectToAction("Index", "Job"); 212 217 } 213 218 } … … 222 227 { 223 228 var uid = Guid.Parse(id); 224 UserViewModel vm = new UserViewModel(accessClient).refreshUsers();229 vm.refreshUsers(); 225 230 226 231 if (uid == Guid.Empty) … … 241 246 else 242 247 { 243 return RedirectToAction("Index", " Home");248 return RedirectToAction("Index", "Job"); 244 249 } 245 250 … … 256 261 { 257 262 var uid = Guid.Parse(id); 258 UserViewModel vm = new UserViewModel(accessClient).refreshAll();263 vm.refreshAll(); 259 264 260 265 var user = vm.getUserById(uid); … … 266 271 else 267 272 { 268 return RedirectToAction("Index", " Home");273 return RedirectToAction("Index", "Job"); 269 274 } 270 275 } … … 281 286 var gid = Guid.Parse(group); 282 287 var mid = Guid.Parse(id); 283 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();288 vm.refreshGroups().refreshUsers(); 284 289 285 290 var user = vm.getUserById(mid); … … 291 296 else 292 297 { 293 return RedirectToAction("Index", " Home");298 return RedirectToAction("Index", "Job"); 294 299 } 295 300 … … 308 313 309 314 ViewBag.Title = "Groups"; 310 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();315 vm.refreshGroups().refreshUsers(); 311 316 return View("Groups", vm); 312 317 } 313 318 else 314 319 { 315 return RedirectToAction("Index", " Home");320 return RedirectToAction("Index", "Job"); 316 321 } 317 322 } … … 327 332 Guid curr = Guid.Parse(id); 328 333 329 UserViewModel vm = new UserViewModel(accessClient)334 vm 330 335 .refreshGroups() 331 336 .refreshUsers(); … … 345 350 else 346 351 { 347 return RedirectToAction("Index", " Home");352 return RedirectToAction("Index", "Job"); 348 353 } 349 354 } … … 362 367 { 363 368 var uid = Guid.Parse(u); 364 v ar vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();369 vm.refreshGroups().refreshUsers(); 365 370 366 371 Access.UserGroup group; … … 403 408 else 404 409 { 405 return RedirectToAction("Index", " Home");410 return RedirectToAction("Index", "Job"); 406 411 } 407 412 } … … 416 421 { 417 422 var uid = Guid.Parse(id); 418 UserViewModel vm = new UserViewModel(accessClient).refreshGroups();423 vm.refreshGroups(); 419 424 420 425 if (uid == Guid.Empty) … … 434 439 else 435 440 { 436 return RedirectToAction("Index", " Home");441 return RedirectToAction("Index", "Job"); 437 442 } 438 443 … … 450 455 var gid = Guid.Parse(g); 451 456 var mid = Guid.Parse(m); 452 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();457 vm.refreshGroups().refreshUsers(); 453 458 454 459 if (gid == Guid.Empty || mid == Guid.Empty) … … 473 478 else 474 479 { 475 return RedirectToAction("Index", " Home");480 return RedirectToAction("Index", "Job"); 476 481 } 477 482 … … 490 495 491 496 ViewBag.Title = "Roles"; 492 UserViewModel vm = new UserViewModel(accessClient).refreshRoles();497 vm.refreshRoles(); 493 498 494 499 return View("Roles", vm); … … 496 501 else 497 502 { 498 return RedirectToAction("Index", " Home");503 return RedirectToAction("Index", "Job"); 499 504 } 500 505 } … … 509 514 { 510 515 511 UserViewModel vm = new UserViewModel(accessClient).refreshRoles();516 vm.refreshRoles(); 512 517 if (name == "" || name == null) 513 518 {//Add role … … 526 531 else 527 532 { 528 return RedirectToAction("Index", " Home");533 return RedirectToAction("Index", "Job"); 529 534 } 530 535 } … … 552 557 else 553 558 { 554 return RedirectToAction("Index", " Home");559 return RedirectToAction("Index", "Job"); 555 560 } 556 561 } … … 569 574 else 570 575 { 571 return RedirectToAction("Index", " Home");576 return RedirectToAction("Index", "Job"); 572 577 } 573 578 } … … 583 588 { 584 589 var uid = Guid.Parse(id); 585 UserViewModel vm = new UserViewModel(accessClient).refreshAll();590 vm.refreshAll(); 586 591 587 592 var user = vm.getUserById(uid); … … 593 598 else 594 599 { 595 return RedirectToAction("Index", " Home");600 return RedirectToAction("Index", "Job"); 596 601 } 597 602 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/CalendarHub.cs
r13805 r13847 48 48 loader(); 49 49 adminClient.Refresh(); 50 UserViewModel vm = new UserViewModel(accessClient ).refreshAll();50 UserViewModel vm = new UserViewModel(accessClient, weblog.getCurrentUser(userId)).refreshAll(); 51 51 52 52 var users = JsonConvert.SerializeObject(vm.users); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/UserInfoHub.cs
r13805 r13847 44 44 loader(); 45 45 Guid userid = Guid.Parse(user); 46 Access.User u = new UserViewModel(aac ).refreshUsers().getUserById(userid);46 Access.User u = new UserViewModel(aac, weblog.getCurrentUser(userId)).refreshUsers().getUserById(userid); 47 47 var pass = aac.resetPassword(userid); 48 48 UserController.sendPassmail(u, pass);//Send mail + show pass -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/ProgressHubber.js
r13844 r13847 6 6 7 7 var v = document.getElementById("userId").innerHTML; 8 var busy = false; 8 9 console.log(v); 9 10 $.connection.hub.qs = { 'userid': v }; … … 31 32 32 33 hubber.client.saveComplete = function (text) { 33 $("#succText").html(text); 34 if(busy) 35 window.setTimeout(1500); 36 busy = true; 37 $("#succText").html(text); 34 38 $("#success-alert").alert(); 35 39 $("#success-alert").fadeTo(2000, 500).slideUp(500, function () { 36 40 $("#success-alert").hide(); 41 busy = false; 37 42 }); 38 43 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Styling/StyleSheet.css
r13827 r13847 4 4 background-color: #fff; 5 5 -webkit-font-smoothing: antialiased; 6 font: normal 14px Roboto,arial,sans-serif ;6 font: normal 14px Roboto,arial,sans-serif !important; 7 7 } 8 8 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Jobs/FileOpeningService.cs
r13827 r13847 43 43 public void NewModel() 44 44 { 45 vm = new FileOpeningViewModel( );45 vm = new FileOpeningViewModel(weblog.getCurrentUser(UserId)); 46 46 Job = new RefreshableJob(); 47 47 … … 80 80 return null; 81 81 } 82 public void SaveToFile(string file )82 public void SaveToFile(string file, string dname) 83 83 { 84 84 if(vm != null) 85 85 { 86 86 var uploads = Path.Combine(env.WebRootPath, "uploads", weblog.getServiceLocator(UserId).getHiveServiceClient().ClientCredentials.UserName.UserName, 87 "HiveChanged");87 dname); 88 88 Directory.CreateDirectory(uploads); 89 89 var cont = Job.HiveTasks.First().ItemTask.Item; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs
r13841 r13847 1 1 using HeuristicLab.Clients.Access.Administration; 2 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 3 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels; 3 4 using System; … … 23 24 private List<AccessAdministrationClient> accessclients; 24 25 private List<HiveAdminClientWeb> adminclients; 26 private List<HiveWebUser> loggedinUsers; 25 27 /// <summary> 26 28 /// Service instance that keeps all the information per user seperated. Data is in different lists so … … 51 53 accessclients = new List<AccessAdministrationClient>(); 52 54 adminclients = new List<HiveAdminClientWeb>(); 55 loggedinUsers = new List<HiveWebUser>(); 53 56 } 54 57 /// <summary> … … 67 70 loggedIn.Add(log); 68 71 locators.Add(loc); 69 var temp = new HiveClientWeb(loc, log.userId); 70 webclients.Add(temp); 71 var temp2 = new FileOpeningService(log.userId); 72 fileopeners.Add(temp2); 73 temp2 = new FileOpeningService(log.userId); 74 jobopeners.Add(temp2); 75 var temp3 = new AccessAdministrationClient(log.userId); 76 accessclients.Add(temp3); 77 var temp4 = new HiveAdminClientWeb(log.userId); 78 adminclients.Add(temp4); 72 webclients.Add(new HiveClientWeb(loc, log.userId)); 73 fileopeners.Add(new FileOpeningService(log.userId)); 74 jobopeners.Add(new FileOpeningService(log.userId)); 75 accessclients.Add(new AccessAdministrationClient(log.userId)); 76 adminclients.Add(new HiveAdminClientWeb(log.userId)); 77 loggedinUsers.Add(new HiveWebUser(log.userId, log.loginName).updateUserInfo()); 79 78 } 80 79 /// <summary> … … 150 149 return adminclients.Find(x => x.userId == id); 151 150 } 151 public HiveWebUser getCurrentUser(Guid id) 152 { 153 return loggedinUsers.Find(x => x.webIdToken == id); 154 } 152 155 /// <summary> 153 156 /// Removes all traces from the logged in user. … … 164 167 adminclients.RemoveAll(x => x.userId == id); 165 168 loggedIn.RemoveAll(x => x.userId == id); 166 169 loggedinUsers.RemoveAll(x => x.webIdToken == id); 167 170 } 168 171 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/FileOpeningViewModel.cs
r13733 r13847 1 using HeuristicLab.Optimization; 2 1 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 using HeuristicLab.Optimization; 3 using System.Collections.Generic; 3 4 4 5 namespace HeuristicLab.Clients.Hive.WebJobManager.ViewModels … … 10 11 { 11 12 public OptimizerHiveTask SelectedTask { get; set; } 13 public List<string> directories { get; set; } 12 14 public IAlgorithm SelectedAlgorithm { get; set; } 13 15 public Experiment SelectedExperiment { get; set; } 14 16 public BatchRun SelectedBatchRun { get; set; } 15 17 public string message { get; set; } 18 public HiveWebUser currentUser { get; set; } 19 20 public FileOpeningViewModel(HiveWebUser hwu) 21 { 22 currentUser = hwu; 23 } 16 24 } 17 25 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/JobViewModel.cs
r13733 r13847 1 using System; 1 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 using System; 2 3 using System.Collections.Generic; 3 4 using System.Linq; … … 11 12 public class JobViewModel 12 13 { 14 public HiveWebUser currentUser { get; set; } 13 15 public List<RefreshableJob> userJobs { get; set; } 14 16 … … 17 19 public List<HiveTask> selectedHiveTasks { get; set; } 18 20 public string message { get; set; } 19 public JobViewModel( )21 public JobViewModel(HiveWebUser hwu) 20 22 { 21 23 userJobs = null; … … 23 25 selectedHiveTasks = new List<HiveTask>(); 24 26 message = ""; 27 currentUser = hwu; 25 28 } 26 29 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/UploadedJobViewModel.cs
r13733 r13847 1 using HeuristicLab.Optimization; 1 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 using HeuristicLab.Optimization; 2 3 using System; 3 4 using System.Collections.Generic; … … 12 13 public class UploadedJobViewModel 13 14 { 14 public UploadedJobViewModel() 15 public UploadedJobViewModel(HiveWebUser hwu) 16 { 17 FullDatePaths = new List<string>(); 18 DisplayDatePaths = new List<string>(); 19 FullFilesPaths = new List<string>(); 20 DisplayFilesPaths = new List<string>(); 21 SelectedIndex = -1; 22 currentUser = hwu; 23 } 24 public void clear() 15 25 { 16 26 FullDatePaths = new List<string>(); … … 20 30 SelectedIndex = -1; 21 31 } 22 23 32 public List<string> FullDatePaths { get; set; } 24 33 public List<string> DisplayDatePaths { get; set; } … … 27 36 public int SelectedIndex { get; set; } 28 37 public string message { get; set; } 29 38 public HiveWebUser currentUser { get; set; } 30 39 31 40 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/NavbarViewModel.cs
r13733 r13847 1 using System; 1 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 using System; 2 3 using System.Collections.Generic; 3 4 using System.Linq; … … 10 11 11 12 public string Active { get; set; } 13 public HiveWebUser User { get; set; } 12 14 13 public NavbarViewModel(string ac )15 public NavbarViewModel(string ac, HiveWebUser hwu ) 14 16 { 15 17 Active = ac; 18 User = hwu; 16 19 } 17 20 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/User/UserViewModel.cs
r13805 r13847 1 1 using HeuristicLab.Clients.Access.Administration; 2 using HeuristicLab.Clients.Hive.WebJobManager.Models; 2 3 using System; 3 4 using System.Collections.Generic; … … 12 13 public class UserViewModel 13 14 { 14 15 public HiveWebUser currentUser { get; set; } 15 16 public string message { get; set; } 16 17 public AccessAdministrationClient accessClient { get; set; } … … 31 32 /// </summary> 32 33 /// <param name="ac">AccessAdminClient for connection</param> 33 public UserViewModel(AccessAdministrationClient ac )34 public UserViewModel(AccessAdministrationClient ac, HiveWebUser hwu) 34 35 { 36 currentUser = hwu; 35 37 users = new List<Access.User>(); 36 38 accessClient = ac; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml
r13827 r13847 7 7 <div> 8 8 <!-- Main nav menu--> 9 @Html.Partial("Navbar", new NavbarViewModel("Job" ))9 @Html.Partial("Navbar", new NavbarViewModel("Job", Model.currentUser)) 10 10 11 11 <!-- Job menu--> … … 27 27 </ul> 28 28 29 <div class="row" 30 style="text-align:center"> 31 @Model.message 32 </div> 29 @Html.Partial("_ErrorMessage", Model.message) 33 30 34 31 <div class="row" … … 52 49 <i class="fa fa-cog"></i> Hive jobs 53 50 </a> 54 @foreach (var job in Model.userJobs )51 @foreach (var job in Model.userJobs.OrderBy(x => x.Job.DateCreated)) 55 52 { 56 53 <a class="btn btn-default … … 64 61 onclick="showLoader()"> 65 62 @job.Job.Name - @job.Job.DateCreated 66 <span class="label 63 <span style="text-shadow:2px 2px black; font-size:13px" 64 class="label 67 65 @(job.Job.FinishedCount == @job.Job.JobCount ? "label-success" : "label-default") 68 66 label-as-badge pull-right"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml
r13844 r13847 14 14 <div id="userId" style="display:none">@ViewBag.SessionId</div> 15 15 <!-- Main nav menu --> 16 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job" ))16 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job", Model.currentUser)) 17 17 18 18 <!-- Job menu--> … … 42 42 </a> 43 43 </div> 44 @Html.Partial("OpenFilePartials/_Help", Model) ;44 @Html.Partial("OpenFilePartials/_Help", Model) 45 45 <!-- Check model to select right partial, partial handles all subloading --> 46 <div class="col- md-9">46 <div class="col-sm-9"> 47 47 @if (Model.SelectedAlgorithm != null) 48 48 { … … 170 170 asp-action="saveToFile" 171 171 method="post"> 172 <div class="col-sm-6" 173 style="text-align:right"> 174 <h5>File name</h5> 175 </div> 176 <div class="col-sm-6" 177 style="text-align:left"> 178 <div class="form-group"> 179 <div class="input-group"> 180 <input type="text" 181 class="form-control" 182 name="fname" 183 id="fname" 184 required 185 placeholder="File name"> 172 <div class="row"> 173 <div class="col-sm-3" 174 style="text-align:right"> 175 <h5>File name</h5> 176 </div> 177 <div class="col-sm-9" 178 style="text-align:left"> 179 <div class="form-group"> 180 <div class="input-group"> 181 <input type="text" 182 class="form-control" 183 name="fname" 184 id="fname" 185 required 186 placeholder="File name"> 187 </div> 186 188 </div> 187 189 </div> 188 190 </div> 189 <div class="row" 190 style="text-align:center"> 191 <h5>Directory: /HiveChanged</h5> 191 <div class="row"> 192 <div class="col-sm-3" 193 style="text-align:right"> 194 <h5>Directory name</h5> 195 </div> 196 <div class="col-sm-9" 197 style="text-align:left"> 198 <div class="form-group"> 199 <div class="input-group"> 200 <input type="text" 201 class="form-control" 202 name="dname" 203 id="dname" 204 required 205 placeholder="Directory name" 206 list="dirnames"> 207 </div> 208 <datalist id="dirnames"> 209 @if (!Model.directories.Contains(DateTime.Now.ToString("yyyy.MM.dd"))) 210 { 211 <option value="@(DateTime.Now.ToString("yyyy.MM.dd"))">Creates new directory for today</option> 212 } 213 @foreach (var d in Model.directories) 214 { 215 <option value="@d"></option> 216 } 217 </datalist> 218 </div> 219 </div> 192 220 </div> 193 221 <button class="btn btn-success btn-block" type="submit" … … 203 231 </div> 204 232 <!-- Side scrolling menu--> 205 <nav class="col- md-2" id="scrolly">233 <nav class="col-sm-2" id="scrolly"> 206 234 <ul class="nav nav-pills nav-stacked" 235 style="position:fixed" 207 236 data-spy="affix" 208 237 data-offset-top="0"> … … 222 251 } 223 252 <li><a href="#finish"><i class="fa fa-flag-checkered"></i> Add to Hive or save to file</a></li> 224 <li >253 <li style="position:fixed"> 225 254 <div class="alert alert-success" id="success-alert"> 226 255 <span id="succText"></span> … … 262 291 }); 263 292 collapser = function () { 264 $('.collapse'). collapse('hide');293 $('.collapse').not('#helperCol').collapse('hide'); 265 294 //closes every collapse 266 295 } 267 296 shower = function () { 268 $('.collapse').collapse('show'); 297 $('.collapse').not('#helperCol').collapse('show'); 298 269 299 //opens every collapse 270 300 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Help.cshtml
r13841 r13847 17 17 <div class="collapse row" 18 18 id="helperCol" 19 style="background-color:#5bc0de;color:black; font-size:larger;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);19 style="background-color:#5bc0de;color:black; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 20 20 "> 21 21 <h3>Types</h3> … … 23 23 <span class="label label-primary">Algorithm</span>. Clicking the buttons will expand them and show more information.</p> 24 24 <h3>Parameters</h3> 25 <p>All parameter changes happen in real time as soon as you change them. Pop ups will appear if your attention is needed for a specific part.</p> 26 <p style="font-style:italic; font-weight:bold">When you change a parameter from a task that falls under any repitition, the changes are pushed to all the other tasks too. 27 The interface only shows the change for one task.</p> 25 <p>All parameter changes happen in real time as soon as you change them. A log on the right menu will keep you updated.</p> 28 26 <h3>Hive</h3> 29 27 <p>This screen acts as a staging area. When you have changed all the data to your wishes you can go to the bottom of the screen to -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/UploaderPartial/_UploaderPartial.cshtml
r13827 r13847 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.UploadedJobViewModel 2 3 2 4 <div class="panel panel-default" 3 5 style="border-width:2px!important;padding:17px; … … 5 7 6 8 7 8 9 10 11 12 13 14 15 9 <form method="post" 10 asp-action="Uploader" 11 asp-controller="Job" enctype="multipart/form-data"> 12 <input onchange="printFiles()" 13 type="file" 14 id="files" 15 name="files" 16 multiple accept=".hl" 17 style="display:none" /> 16 18 17 18 19 19 <div onclick="firefilebutton()" 20 class="btn btn-info btn-lg btn-block" 21 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 20 22 text-shadow:1px 1px black;"> 21 22 23 <i class="fa fa-folder-open-o"></i> Choose file(s) to upload to the server 24 </div> 23 25 24 26 <div class="row" style="margin:10px"> 25 27 26 27 28 29 28 <div id="selectedfiles"> 29 <h3>Files</h3> 30 <p>No files selected: press the above button to choose files</p> 31 </div> 30 32 31 33 <button style="margin-bottom:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 32 34 text-shadow:2px 2px black;" 33 34 35 36 37 38 39 40 35 type="button" 36 disabled 37 id="del" 38 class='btn btn-danger' 39 onclick='deletefiles()'> 40 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> 41 Remove files 42 </button> 41 43 42 <div 43 style="margin-top:20px;margin-bottom:20px"> 44 <div style="margin-top:20px;margin-bottom:20px"> 44 45 45 <label for="basic-url">Directory name</label> 46 <div class="input-group"> 47 <span class="input-group-addon" 48 id="basic-addon3"> 49 .../uploads/@ViewBag.Name 50 </span> 51 <input 52 type="text" 53 disabled 54 class="form-control" 55 id="directory" 56 name="directory" 57 aria-describedby="basic-addon3" 58 value="@(DateTime.Now.ToString("yyyy.MM.dd"))" /> 59 </div> 60 </div> 61 <button style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 46 <label for="basic-url">Directory name</label> 47 <div class="input-group"> 48 <span class="input-group-addon" 49 id="basic-addon3"> 50 .../uploads/@(Model.currentUser.currentUser.UserName != null ? Model.currentUser.currentUser.UserName : Model.currentUser.currentUser.FullName)/ 51 </span> 52 <input type="text" 53 disabled 54 class="form-control" 55 id="directory" 56 name="directory" 57 aria-describedby="basic-addon3" 58 59 list="dirnames"/> 60 <datalist id="dirnames"> 61 @if (!Model.DisplayDatePaths.Contains(DateTime.Now.ToString("yyyy.MM.dd"))) 62 { 63 <option value="@(DateTime.Now.ToString("yyyy.MM.dd"))">Creates new map for today</option> 64 } 65 @foreach(var d in Model.DisplayDatePaths) 66 { 67 <option value="@d"></option> 68 } 69 </datalist> 70 </div> 71 </div> 72 <button style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 62 73 text-shadow:2px 2px black;" 63 disabled 64 id="upl" 65 class="btn btn-lg btn-block btn-success" 66 type="submit" 67 > 68 <i class="fa fa-plus-square"></i> Add to uploads 69 </button> 70 </div> 74 disabled 75 id="upl" 76 class="btn btn-lg btn-block btn-success" 77 type="submit"> 78 <i class="fa fa-plus-square"></i> Add to uploads 79 </button> 80 </div> 71 81 72 82 </form> … … 83 93 document.getElementById("directory").disabled = false; 84 94 85 95 86 96 for (var i = 0; i < files.length; i++) { 87 97 div.innerHTML += "<p>File " + (i + 1) + ":" + files[i].name + -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml
r13841 r13847 5 5 <div> 6 6 7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job" ))7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job", Model.currentUser)) 8 8 9 9 <ul class="nav nav-pills nav-justified"> … … 23 23 </li> 24 24 </ul> 25 <div class="row" style="margin:10px"> 26 <div style="text-align:center">@Model.message</div> 27 28 </div> 25 26 @Html.Partial("_ErrorMessage", Model.message) 27 29 28 <div class="row" style="padding:10px"> 30 @if (Model.DisplayDatePaths.Count == 0) 31 { 32 <div> 33 <p style="text-align:center"> 34 No files uploaded 35 </p> 36 <a class="btn btn-success btn-lg btn-block" 29 <div class="col-sm-4"> 30 <div class="btn-group btn-group-justified btn-block" 31 role="group" style="margin-bottom:-4px"> 32 33 <a class="btn btn-info btn-lg btn-block disabled" 34 style="width:6%; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 35 text-shadow:2px 2px black;"> 36 <i class="fa fa-cloud"></i> Uploads 37 </a> 38 <a class="btn btn-success btn-block 39 @(Model.SelectedIndex == -1 ? "active" : "") 40 " 37 41 asp-controller="Job" 38 asp-action="Uploader" 39 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 42 asp-action="UploadDir" 43 asp-route-index="-1" 44 onclick="showUploader()" 45 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 40 46 text-shadow:2px 2px black;"> 41 <i class="fa fa-cloud-upload"></i> Upload new file(s)47 <i class="fa fa-cloud-upload"></i> 42 48 </a> 43 49 </div> 44 45 } 46 else { 47 <div class="col-sm-4"> 48 <div class="btn-group btn-group-justified btn-block" 49 role="group" style="margin-bottom:-4px"> 50 51 <a class="btn btn-info btn-lg btn-block disabled" 52 style="width:6%; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 53 text-shadow:2px 2px black;"> 54 <i class="fa fa-cloud"></i> Uploads 55 </a> 56 <a class="btn btn-success btn-block 57 @(Model.SelectedIndex == -1 ? "active" : "") 58 " 50 <div class="btn-group-vertical btn-block"> 51 52 @for (int i = 0; i < Model.DisplayDatePaths.Count; i++) 53 { 54 <a class="btn btn-default @(i == Model.SelectedIndex ? "active" : "" )" 55 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" 59 56 asp-controller="Job" 60 57 asp-action="UploadDir" 61 asp-route-index="-1" 62 onclick="showUploader()" 58 asp-route-index="@(i)" 59 onclick="showDownloader()"> 60 @Model.DisplayDatePaths[i] 61 </a> 62 } 63 </div> 64 @if (ViewBag.active != null && ViewBag.active == true) 65 { 66 <div> 67 <a class="btn btn-warning btn-block" 68 asp-controller="Job" 69 asp-action="OpenRecent" 63 70 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 64 text-shadow:2px 2px black; ">65 <i class="fa fa- cloud-upload"></i>71 text-shadow:2px 2px black;margin-top:10px"> 72 <i class="fa fa-undo"></i> Reopen last file 66 73 </a> 67 74 </div> 68 <div class="btn-group-vertical btn-block"> 69 70 @for (int i = 0; i < Model.DisplayDatePaths.Count; i++) 75 76 } 77 78 </div> 79 <p style="display:none" 80 id="downloader" 81 class="text-center"> 82 <br /><br /><br /><br /><br /><br /><br /> 83 <i class="fa fa-cloud-download fa-spin fa-5x" id="spinner"> 84 </i> 85 </p> 86 <p style="display:none" 87 id="uploader" 88 class="text-center"> 89 <br /><br /><br /><br /><br /><br /><br /> 90 <i class="fa fa-cloud-upload fa-spin fa-5x" id="spinner"> 91 </i> 92 </p> 93 <p style="display:none" 94 id="deleter" 95 class="text-center"> 96 <br /><br /><br /><br /><br /><br /><br /> 97 <i class="fa fa-trash-o fa-spin fa-5x" id="spinner"> 98 </i> 99 </p> 100 <div id="content"> 101 @if (Model.SelectedIndex != -1) 102 { 103 <div class="col-sm-8"> 104 <h3>@Model.DisplayDatePaths[Model.SelectedIndex]</h3> 105 <h4 style="text-align:left">Click on a file to prepare it for upload to Hive</h4> 106 @for (int i = 0; i < Model.DisplayFilesPaths.Count; i++) 71 107 { 72 <a class="btn btn-default @(i == Model.SelectedIndex ? "active" : "" )" 73 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" 74 asp-controller="Job" 75 asp-action="UploadDir" 76 asp-route-index="@(i)" 77 onclick="showDownloader()"> 78 @Model.DisplayDatePaths[i] 79 </a> 108 109 <div class="btn-group-justified btn-block"> 110 111 <a class="btn btn-default @(Model.DisplayFilesPaths[i].EndsWith(".hl") ? "" : "disabled" )" 112 asp-controller="Job" 113 asp-action="OpenFile" 114 asp-route-index="@(Model.SelectedIndex)" 115 asp-route-filedex="@i" 116 style="width:6%;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 117 <i class="fa fa-list-alt"></i> @Model.DisplayFilesPaths[i] 118 </a> 119 <a id="down" 120 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 121 text-shadow:2px 2px black;" 122 class='btn btn-group btn-success' 123 asp-controller="Job" 124 asp-action="DownloadFile" 125 asp-route-index="@(Model.SelectedIndex)" 126 asp-route-filedex="@i"> 127 <span class='glyphicon glyphicon-download-alt' aria-hidden='true'></span> 128 </a> 129 <a id="del" 130 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 131 text-shadow:2px 2px black;" 132 class='btn btn-group btn-danger' 133 asp-controller="Job" 134 asp-action="DeleteFile" 135 asp-route-index="@(Model.SelectedIndex)" 136 asp-route-filedex="@i" 137 onclick="showDeleter()"> 138 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> 139 </a> 140 141 </div> 80 142 } 143 <hr style="border-color:gray;margin-top:50px" /> 144 <form asp-controller="Job" 145 asp-action="changeDirName" 146 method="post" 147 class="col-sm-6"> 148 <h5>Change directory name</h5> 149 <div class="input-group" 150 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 151 <input type="text" 152 value="@Model.DisplayDatePaths[Model.SelectedIndex]" 153 style="display:none" 154 name="olddir"/> 155 <input 156 name="dirname" 157 type="text" 158 class="form-control" 159 value="@Model.DisplayDatePaths[Model.SelectedIndex]" /> 160 <span class="input-group-btn"> 161 <button style="text-shadow:2px 2px black" 162 type="submit" 163 class="btn btn-success pull-right" 164 ><i class="fa fa-save"></i> Save</button> 165 </span> 166 </div> 167 </form> 168 169 81 170 </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 96 </div> 97 <p style="display:none" 98 id="downloader" 99 class="text-center"> 100 <br /><br /><br /><br /><br /><br /><br /> 101 <i class="fa fa-cloud-download fa-spin fa-5x" id="spinner"> 102 </i> 103 </p> 104 <p style="display:none" 105 id="uploader" 106 class="text-center"> 107 <br /><br /><br /><br /><br /><br /><br /> 108 <i class="fa fa-cloud-upload fa-spin fa-5x" id="spinner"> 109 </i> 110 </p> 111 <p style="display:none" 112 id="deleter" 113 class="text-center"> 114 <br /><br /><br /><br /><br /><br /><br /> 115 <i class="fa fa-trash-o fa-spin fa-5x" id="spinner"> 116 </i> 117 </p> 118 <div id="content"> 119 @if (Model.SelectedIndex != -1) 120 { 121 <div class="col-sm-8"> 122 <h4>Click on a file to prepare it for upload to Hive</h4> 123 @for (int i = 0; i < Model.DisplayFilesPaths.Count; i++) 124 { 125 126 <div class="btn-group-justified btn-block"> 127 128 <a class="btn btn-default @(Model.DisplayFilesPaths[i].EndsWith(".hl") ? "" : "disabled" )" 129 asp-controller="Job" 130 asp-action="OpenFile" 131 asp-route-index="@(Model.SelectedIndex)" 132 asp-route-filedex="@i" 133 style="width:6%;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 134 <i class="fa fa-list-alt"></i> @Model.DisplayFilesPaths[i] 135 </a> 136 <a id="down" 137 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 138 text-shadow:2px 2px black;" 139 class='btn btn-group btn-success' 140 asp-controller="Job" 141 asp-action="DownloadFile" 142 asp-route-index="@(Model.SelectedIndex)" 143 asp-route-filedex="@i"> 144 <span class='glyphicon glyphicon-download-alt' aria-hidden='true'></span> 145 </a> 146 <a id="del" 147 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 148 text-shadow:2px 2px black;" 149 class='btn btn-group btn-danger' 150 asp-controller="Job" 151 asp-action="DeleteFile" 152 asp-route-index="@(Model.SelectedIndex)" 153 asp-route-filedex="@i" 154 onclick="showDeleter()"> 155 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> 156 </a> 157 158 </div> 159 } 160 161 162 </div> 163 164 } 165 else 166 { 167 <div class="col-sm-8"> 168 169 @Html.Partial("UploaderPartial/_UploaderPartial") 170 </div> 171 } 172 </div> 173 174 } 171 172 } 173 else 174 { 175 <div class="col-sm-8"> 176 177 @Html.Partial("UploaderPartial/_UploaderPartial", Model) 178 </div> 179 } 180 </div> 181 182 175 183 </div> 176 184 <script type="text/javascript"> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Resource/Index.cshtml
r13827 r13847 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.Models.HiveWebUser 2 2 <div ng-app="wjm" ng-controller="resourceCtrl" data-ng-init="init()"> 3 3 <div id="userId" style="display:none">@ViewBag.SessionId</div> 4 4 5 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Resource" ))5 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Resource", Model)) 6 6 7 7 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/Navbar.cshtml
r13733 r13847 2 2 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel 3 3 4 <ul class="nav nav-tabs"> 4 <ul class="nav nav-tabs"> 5 <li role="presentation" 6 class="@(Model.Active == "Job" ? "active" : "")"> 7 <a asp-controller="Job" 8 asp-action="Index"> 9 Job management 10 </a> 11 </li> 5 12 <li role="presentation" 6 class="@(Model.Active == "Job" ? "active" : "")"> 7 <a asp-controller="Job" 8 asp-action="Index"> 9 Job management 10 </a> 13 class="@(Model.Active == "User" ? "active" : "") 14 @(Model.User.HasUserAdminAccess() == false ? "disabled" : "") 15 "> 16 @if (Model.User.HasUserAdminAccess()) 17 { 18 <a asp-controller="User" 19 asp-action="Index"> 20 User management 21 </a> 22 } 23 else 24 { 25 <a> User management</a> 26 } 27 11 28 </li> 12 <li role="presentation" 13 class="@(Model.Active == "User" ? "active" : "")"> 14 <a asp-controller="User" 15 asp-action="Index"> 16 User management 17 </a> 18 </li> 19 <li role="presentation" 20 class="@(Model.Active == "Resource" ? "active" : "")"> 29 <li role="presentation" 30 class="@(Model.Active == "Resource" ? "active" : "") 31 @(Model.User.hasResourceAdminAccess() == false ? "disabled" : "") 32 "> 33 @if (Model.User.hasResourceAdminAccess()) 34 { 21 35 <a asp-controller="Resource" 22 36 asp-action="Index"> 23 37 Resources 24 38 </a> 25 </li> 26 <li role="presentation" 27 class="pull-right "> 28 <a asp-controller="Home" 29 asp-action="Logout" 30 class="text-danger"> 31 Logout 32 <i class="fa fa-sign-out "></i> 33 </a> 34 </li> 35 </ul> 39 } 40 else 41 { 42 <a> Resources</a> 43 } 44 45 </li> 46 47 <li role="presentation" 48 class="pull-right "> 49 50 <a asp-controller="Home" 51 asp-action="Logout" 52 class="text-danger"> 53 Logout 54 <i class="fa fa-sign-out "></i> 55 </a> 56 </li> 57 <li class="pull-right"> 58 <h4 style="margin-bottom:0;"> 59 <span class="label label-success " 60 style="text-shadow:2px 2px black;"> 61 @Model.User.currentUser.FullName 62 </span> 63 </h4> 64 </li> 65 </ul> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Groups.cshtml
r13827 r13847 5 5 <div> 6 6 7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User" ))7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User", Model.currentUser)) 8 8 9 9 <ul class="nav nav-pills nav-justified"> … … 30 30 </li> 31 31 </ul> 32 <div class="row" 33 style="text-align:center"> 34 @Model.message 35 </div> 32 @Html.Partial("_ErrorMessage", Model.message) 33 36 34 <div class="row" 37 35 style="padding:10px; margin-right:0px!important"> … … 59 57 <div class="btn-group-vertical btn-block"> 60 58 61 @foreach (var group in Model.ugroups )59 @foreach (var group in Model.ugroups.OrderBy(x => x.Name)) 62 60 { 63 61 <a class="btn btn-default @( group.Id == Model.SelectedGroup.Id ? "active" : "" )" -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml
r13841 r13847 4 4 <div> 5 5 6 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User" ))6 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User", Model.currentUser)) 7 7 8 8 <ul class="nav nav-pills nav-justified"> … … 29 29 </li> 30 30 </ul> 31 <div class="row" 32 style="text-align:center"> 33 @Model.message 34 </div> 31 @Html.Partial("_ErrorMessage", Model.message) 32 35 33 <div class="row" 36 34 style="padding:10px; margin-right:0px!important"> … … 70 68 71 69 72 @foreach (var user in Model.users )70 @foreach (var user in Model.users.OrderBy(x => x.UserName)) 73 71 { 74 72 <a class="btn btn-default @( user.Id == Model.SelectedUser.Id ? "active" : "" )" -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Roles.cshtml
r13827 r13847 5 5 <div> 6 6 7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User" ))7 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User", Model.currentUser)) 8 8 9 9 <ul class="nav nav-pills nav-justified"> … … 30 30 </li> 31 31 </ul> 32 <div class="row" 33 style="text-align:center"> 34 @Model.message 35 </div> 32 @Html.Partial("_ErrorMessage", Model.message) 36 33 <div class="row" 37 34 style="padding:10px; margin-right:0px!important"> … … 60 57 <div class="btn-group-vertical btn-block"> 61 58 62 @foreach (var role in Model.roles )59 @foreach (var role in Model.roles.OrderBy(x => x.Name)) 63 60 { 64 61 <a class="btn btn-default @( role.Name == Model.SelectedRole.Name ? "active" : "" )" -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/css/site.min.css
r13827 r13847 1 @import url(http://fonts.googleapis.com/css?family=Roboto:400);.wrapper,h4{text-align:center}.label,sub,sup{vertical-align:baseline}[role=button],div[data-tree-model] li,div[data-tree-model] li i{cursor:pointer}.fc table,table{border-spacing:0}body,figure{margin:0}.btn-group>.btn-group,.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.dropdown-menu{float:left}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.pre-scrollable{max-height:340px}.fa,.glyphicon{-moz-osx-font-smoothing:grayscale}body{-webkit-font-smoothing:antialiased;font:400 14px Roboto,arial,sans-serif }.container{padding:25px;position:fixed}.form-login{background-color:#EDEDED;border-radius:15px;border-color:#d2d2d2;border-width:5px;box-shadow:0 1px 0 #cfcfcf;padding:10px 20px 20px;padding:10px 20px 20px}h4{border:0 solid #fff;border-bottom-width:1px;padding-bottom:10px}.panel-warning>.panel-heading{background-image:linear-gradient(to bottom,#eb9114 0,#f1b25b 100%)!important;color:#fff!important}.panel-danger>.panel-heading{background-image:linear-gradient(to bottom,#c12e2a 0,#d9534f 100%)!important;color:#fff!important}.label-as-badge{border-radius:1em}.bar-off{fill:#c2c2d6}.bar-off:hover{fill:#e0e0eb}.bar-wait{fill:#f0a742}.bar-wait:hover{fill:#f4bd71}.bar-trans{fill:#80d4ff}.bar-trans:hover{fill:#9df}.bar-calc{fill:#2f6fa6}.bar-calc:hover{fill:#3884c7}.bar-paus{fill:#47476b}.bar-paus:hover{fill:#5c5c8a}.bar-fin{fill:#5cb85c}.bar-fin:hover{fill:#71c171}.bar-abo{fill:#c2302c}.bar-abo:hover{fill:#d54944}.bar-fail{fill:#c2302c}.bar-fail:hover{fill:#d54944}rect.selection{stroke:gray;stroke-dasharray:4px;stroke-opacity:.5;fill:transparent}svg ::selection{background:0 0}svg ::-moz-selection{background:0 0}svg ::-webkit-selection{background:0 0}.btn-danger:focus,.btn-danger:hover,.btn-default:focus,.btn-default:hover,.btn-info:focus,.btn-info:hover,.btn-primary:focus,.btn-primary:hover,.btn-success:focus,.btn-success:hover,.btn-warning:focus,.btn-warning:hover{background-position:0 -15px}[animate-on-change]{transition:all 1s;-webkit-transition:all 1s}[animate-on-change].changed{background-color:#add8e6;transition:none;-webkit-transition:none}[animate-on-change].changedshut{background-color:#ffa07a;transition:none;-webkit-transition:none}.panel-heading .nav-justified.nav-pills li.active>a{background-color:#74a9d8!important}rect{-webkit-box-shadow:10px 10px 5px 0 rgba(0,0,0,.75);-moz-box-shadow:10px 10px 5px 0 rgba(0,0,0,.75);box-shadow:10px 10px 5px 0 rgba(0,0,0,.75)}div[data-angular-treeview]{-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:600;color:#fff;text-decoration:none;text-shadow:1px 1px #000}div[data-tree-model] ul{padding:5px;list-style:none;border:#778899;overflow:hidden}div[data-tree-model] li{position:relative;padding:0 0 0 20px;line-height:20px;margin-top:3px;border:#add8e6;border-radius:10px;box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px rgba(33,151,184,1)}div[data-tree-model] li .expanded{padding:1px 10px;background-image:url(../img/folder.png);background-repeat:no-repeat}div[data-tree-model] li .collapsed{padding:1px 10px;background-image:url(../img/folder-closed.png);background-repeat:no-repeat}div[data-tree-model] li .normal{padding:1px 10px;color:#000;background-image:url(../img/file.png);background-repeat:no-repeat}div[data-tree-model] li.selected{box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px #5cb85c!important}div[data-tree-model] span.selected{color:#fff!important;text-shadow:1px 1px #000!important;font-weight:700;padding:1px 5px}div[data-tree-model] li.changed{box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px rgba(250,250,210,1)}div[data-tree-model] span.changed{color:#000;text-shadow:1px 1px #fff;font-weight:700;padding:1px 5px}div[data-tree-model] span.loaded{text-decoration:underline;font-style:oblique}/*!1 @import url(http://fonts.googleapis.com/css?family=Roboto:400);.wrapper,h4{text-align:center}.label,sub,sup{vertical-align:baseline}[role=button],div[data-tree-model] li,div[data-tree-model] li i{cursor:pointer}.fc table,table{border-spacing:0}body,figure{margin:0}.btn-group>.btn-group,.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.dropdown-menu{float:left}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.pre-scrollable{max-height:340px}.fa,.glyphicon{-moz-osx-font-smoothing:grayscale}body{-webkit-font-smoothing:antialiased;font:400 14px Roboto,arial,sans-serif!important}.container{padding:25px;position:fixed}.form-login{background-color:#EDEDED;border-radius:15px;border-color:#d2d2d2;border-width:5px;box-shadow:0 1px 0 #cfcfcf;padding:10px 20px 20px;padding:10px 20px 20px}h4{border:0 solid #fff;border-bottom-width:1px;padding-bottom:10px}.panel-warning>.panel-heading{background-image:linear-gradient(to bottom,#eb9114 0,#f1b25b 100%)!important;color:#fff!important}.panel-danger>.panel-heading{background-image:linear-gradient(to bottom,#c12e2a 0,#d9534f 100%)!important;color:#fff!important}.label-as-badge{border-radius:1em}.bar-off{fill:#c2c2d6}.bar-off:hover{fill:#e0e0eb}.bar-wait{fill:#f0a742}.bar-wait:hover{fill:#f4bd71}.bar-trans{fill:#80d4ff}.bar-trans:hover{fill:#9df}.bar-calc{fill:#2f6fa6}.bar-calc:hover{fill:#3884c7}.bar-paus{fill:#47476b}.bar-paus:hover{fill:#5c5c8a}.bar-fin{fill:#5cb85c}.bar-fin:hover{fill:#71c171}.bar-abo{fill:#c2302c}.bar-abo:hover{fill:#d54944}.bar-fail{fill:#c2302c}.bar-fail:hover{fill:#d54944}rect.selection{stroke:gray;stroke-dasharray:4px;stroke-opacity:.5;fill:transparent}svg ::selection{background:0 0}svg ::-moz-selection{background:0 0}svg ::-webkit-selection{background:0 0}.btn-danger:focus,.btn-danger:hover,.btn-default:focus,.btn-default:hover,.btn-info:focus,.btn-info:hover,.btn-primary:focus,.btn-primary:hover,.btn-success:focus,.btn-success:hover,.btn-warning:focus,.btn-warning:hover{background-position:0 -15px}[animate-on-change]{transition:all 1s;-webkit-transition:all 1s}[animate-on-change].changed{background-color:#add8e6;transition:none;-webkit-transition:none}[animate-on-change].changedshut{background-color:#ffa07a;transition:none;-webkit-transition:none}.panel-heading .nav-justified.nav-pills li.active>a{background-color:#74a9d8!important}rect{-webkit-box-shadow:10px 10px 5px 0 rgba(0,0,0,.75);-moz-box-shadow:10px 10px 5px 0 rgba(0,0,0,.75);box-shadow:10px 10px 5px 0 rgba(0,0,0,.75)}div[data-angular-treeview]{-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:600;color:#fff;text-decoration:none;text-shadow:1px 1px #000}div[data-tree-model] ul{padding:5px;list-style:none;border:#778899;overflow:hidden}div[data-tree-model] li{position:relative;padding:0 0 0 20px;line-height:20px;margin-top:3px;border:#add8e6;border-radius:10px;box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px rgba(33,151,184,1)}div[data-tree-model] li .expanded{padding:1px 10px;background-image:url(../img/folder.png);background-repeat:no-repeat}div[data-tree-model] li .collapsed{padding:1px 10px;background-image:url(../img/folder-closed.png);background-repeat:no-repeat}div[data-tree-model] li .normal{padding:1px 10px;color:#000;background-image:url(../img/file.png);background-repeat:no-repeat}div[data-tree-model] li.selected{box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px #5cb85c!important}div[data-tree-model] span.selected{color:#fff!important;text-shadow:1px 1px #000!important;font-weight:700;padding:1px 5px}div[data-tree-model] li.changed{box-shadow:2px 3px 5px rgba(0,0,0,.6),inset 1px 10px 300px 51px rgba(250,250,210,1)}div[data-tree-model] span.changed{color:#000;text-shadow:1px 1px #fff;font-weight:700;padding:1px 5px}div[data-tree-model] span.loaded{text-decoration:underline;font-style:oblique}/*! 2 2 * Bootstrap v3.3.6 (http://getbootstrap.com) 3 3 * Copyright 2011-2015 Twitter, Inc. -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/progresshubber.js
r13844 r13847 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(){$("#success-alert").hide();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.saveComplete=function(a){$("#succText").html(a),$("#success-alert").alert(),$("#success-alert").fadeTo(2e3,500).slideUp(500,function(){$("#success-alert").hide()})},hubber.client.createAlert=function(a,b){$("#logs").html("<div class='alert alert-"+b+" alert-dismissible fade in' role='alert'> <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span> </button> "+a+"</div>"+$("#logs").html())},hubber.client.formatWrong=function(a,b){addAlert("Format wrong for "+a+" of type "+b+". Make sure you follow the right format pattern.","warning")}});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(){$("#success-alert").hide();var a=document.getElementById("userId").innerHTML,b=!1;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.saveComplete=function(a){b&&window.setTimeout(1500),b=!0,$("#succText").html(a),$("#success-alert").alert(),$("#success-alert").fadeTo(2e3,500).slideUp(500,function(){$("#success-alert").hide(),b=!1})},hubber.client.createAlert=function(a,b){$("#logs").html("<div class='alert alert-"+b+" alert-dismissible fade in' role='alert'> <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span> </button> "+a+"</div>"+$("#logs").html())},hubber.client.formatWrong=function(a,b){addAlert("Format wrong for "+a+" of type "+b+". Make sure you follow the right format pattern.","warning")}});
Note: See TracChangeset
for help on using the changeset viewer.