Changeset 13805
- Timestamp:
- 04/27/16 16:48:35 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/HomeController.cs ¶
r13741 r13805 93 93 } 94 94 } 95 /// <summary> 96 /// Redirect user to home sceen for a full logout 97 /// </summary> 98 /// <returns></returns> 95 99 public IActionResult Logout() 96 100 { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/ResourceController.cs ¶
r13782 r13805 14 14 namespace HeuristicLab.Clients.Hive.WebJobManager.Controllers 15 15 { 16 /// <summary> 17 /// Controller for the resources. Only handles requests that refresh the page. 18 /// </summary> 16 19 public class ResourceController : Controller 17 20 { … … 29 32 _environment = env; 30 33 } 34 /// <summary> 35 /// Initialize and check the login. Gets all the required services for the user. 36 /// </summary> 37 /// <returns></returns> 31 38 private bool init() 32 39 { … … 46 53 } 47 54 } 55 /// <summary> 56 /// Loads the main page for the resources 57 /// </summary> 58 /// <returns></returns> 48 59 public IActionResult Index() 49 60 { … … 60 71 } 61 72 } 73 /// <summary> 74 /// Changes the parent for a specfic resource 75 /// </summary> 76 /// <param name="inpid">Resource to edit</param> 77 /// <param name="inpidpar">New parent resource</param> 78 /// <returns></returns> 62 79 [HttpPost] 63 80 public IActionResult changeParent(string inpid, string inpidpar) … … 70 87 adminClient.Refresh(); 71 88 var tochange = adminClient.Resources.ToList().Find(x => x.Id == gid); 72 89 //gets current resource 73 90 if (inpidpar != null && inpidpar != "") { 74 91 Guid tempid = Guid.Parse(inpidpar); 75 while (tempid != null )76 { 92 while (tempid != null && tempid != Guid.Empty) 93 {//Check if a loop could occur (some parent of the parent being the parent) 77 94 if (tempid != gid) 78 { 79 tempid = (Guid)adminClient.Resources.ToList().Find(x => x.Id == tempid).ParentResourceId; 95 {//Not equal so move up a level 96 var t = adminClient.Resources.ToList().Find(x => x.Id == tempid); 97 if (t.ParentResourceId == null) 98 tempid = Guid.Empty; 99 else 100 tempid = (Guid)t.ParentResourceId; 101 80 102 } 81 103 else 82 break; 83 } 84 if(tempid == null )104 break; //breaks loop if equal 105 } 106 if(tempid == null || tempid == Guid.Empty)//Broken loop => the tempid is not empty so no change 85 107 tochange.ParentResourceId = Guid.Parse(inpidpar); 86 108 } … … 88 110 tochange.ParentResourceId = null; 89 111 adminClient.Store(tochange, CancellationToken.None); 90 91 return RedirectToAction("Index", "Resource"); 92 } 93 else 94 { 95 return RedirectToAction("Index", "Home"); 96 } 97 } 112 //Save to server 113 114 return RedirectToAction("Index", "Resource"); 115 } 116 else 117 { 118 return RedirectToAction("Index", "Home"); 119 } 120 } 121 /// <summary> 122 /// Adds recources to a resource group 123 /// </summary> 124 /// <param name="addres">Array containing all the resources ID's from the group</param> 125 /// <param name="groupid">Group id</param> 126 /// <returns></returns> 127 [HttpPost] 128 public IActionResult addResourcesToGroup(string[] addres, string groupid) 129 { 130 if (init()) 131 { 132 Guid gid = Guid.Parse(groupid); 133 adminClient.Refresh(); 134 var exist = adminClient.Resources.ToList().FindAll(x => x.ParentResourceId == gid); 135 //Current existing member of the group 136 137 foreach(var a in addres) 138 {//loop on each ID 139 Guid tempid = Guid.Parse(a); 140 var elemid = exist.FindIndex(x => x.Id == tempid); 141 if (elemid != -1) 142 {//If element already is a member of the group: scramble temporary ID (for future reference) 143 exist[elemid].Id = Guid.Empty; 144 } 145 else 146 {//If element is not yet in list => change parentresourceid from that element 147 var obj = adminClient.Resources.ToList().Find(x => x.Id == tempid); 148 obj.ParentResourceId = gid; 149 adminClient.Store(obj, CancellationToken.None); 150 } 151 } 152 foreach(var e in exist) 153 {//Loop on existing and check the ID's 154 if(e.Id != Guid.Empty) 155 {//ID != Empty means that element should not be a member of the list anymore 156 e.ParentResourceId = null; //remove ParentResourceID from element 157 adminClient.Store(e, CancellationToken.None); 158 } 159 } 160 161 return RedirectToAction("Index", "Resource"); 162 163 } 164 else 165 { 166 return RedirectToAction("Index", "Home"); 167 } 168 } 169 /// <summary> 170 /// Delete a client group (relinks the parent from every member to possible grandparent) 171 /// </summary> 172 /// <param name="inpid">Group ID to delete</param> 173 /// <returns></returns> 98 174 [HttpPost] 99 175 public IActionResult deleteClientGroup(string inpid) … … 105 181 adminClient.Refresh(); 106 182 var group = adminClient.Resources.ToList().Find(x => x.Id == gid); 183 //Group to delete 107 184 var list = adminClient.Resources.ToList().FindAll(x => x.ParentResourceId == gid); 185 //All members from the group 108 186 foreach(var cl in list) 109 { 187 {//Links parent from every child to parent from the group to delete. 110 188 cl.ParentResourceId = group.ParentResourceId; 111 189 adminClient.Store(cl, CancellationToken.None); … … 120 198 } 121 199 } 122 200 /// <summary> 201 /// Create a new Client Group 202 /// </summary> 203 /// <param name="inpname">Name for the group</param> 204 /// <param name="inpheart">Heartbeat</param> 205 /// <param name="inpparent">Possible parent for the group</param> 206 /// <param name="clientstoadd">Clients to be added to the group</param> 207 /// <returns></returns> 123 208 [HttpPost] 124 209 public IActionResult newClientGroup(string inpname, int inpheart, string inpparent, string[] clientstoadd) … … 128 213 129 214 SlaveGroup sg = new SlaveGroup(); 215 //init 130 216 sg.Id = Guid.Empty; 131 217 sg.Name = inpname; 132 218 sg.HbInterval = inpheart; 133 if (inpparent != "")219 if (inpparent != null) 134 220 sg.ParentResourceId = Guid.Parse(inpparent); 221 135 222 sg.OwnerUserId = serviceLocator.getHiveServiceClient().GetUserIdByUsername(serviceLocator.getHiveServiceClient().ClientCredentials.UserName.UserName); 136 223 adminClient.Store(sg, CancellationToken.None); 137 224 adminClient.Refresh(); 225 //Reloads the resources 138 226 var id = adminClient.Resources.ToList().Find(x => x.Name == inpname).Id; 139 227 foreach(var s in clientstoadd) 140 { 228 {//Loop so each client can be added to the group 141 229 var cid = Guid.Parse(s); 142 230 var client = adminClient.Resources.ToList().Find(x => x.Id == cid); -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs ¶
r13754 r13805 8 8 using System.Collections.Generic; 9 9 using System.Linq; 10 using System.Net.Mail; 10 11 using System.ServiceModel.Security; 11 12 using System.Threading.Tasks; … … 13 14 namespace HeuristicLab.Clients.Hive.WebJobManager.Controllers 14 15 { 16 /// <summary> 17 /// Handles all the actions for user management 18 /// </summary> 15 19 public class UserController : Controller 16 20 { … … 27 31 _environment = env; 28 32 } 33 /// <summary> 34 /// Init required services and checks login 35 /// </summary> 36 /// <returns></returns> 29 37 private bool init() 30 38 { … … 44 52 } 45 53 #region Users 46 54 /// <summary> 55 /// Show users page 56 /// </summary> 57 /// <returns></returns> 47 58 public IActionResult Index() 48 59 { … … 51 62 ViewBag.Title = "Users"; 52 63 UserViewModel vm = new UserViewModel(accessClient).refreshAll() ; 64 //Refreshall for users, groups and roles 53 65 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); 54 66 return View("Index", vm); … … 62 74 public IActionResult SelectUser(string id) 63 75 { 64 ;65 76 if (init()) 66 77 { … … 69 80 UserViewModel vm = new UserViewModel(accessClient).refreshAll(); 70 81 if (curr == Guid.Empty) 71 { 82 {//new user 72 83 ViewBag.Title = "Add User"; 73 84 } 74 85 else 75 { 86 {//View an existing user 76 87 vm.SelectedUser = vm.getUserById(curr); 77 88 vm.SelectedUserSubscriptions = accessClient.getSubscribedGroups(curr); … … 82 93 ViewBag.SessionId = HttpContext.Session.GetString("UserId"); 83 94 return View("Index", vm); 84 } 85 else 86 { 87 return RedirectToAction("Index", "Home"); 88 } 89 } 95 //Uses Index page too, with the additional info in the Viewmodel 96 } 97 else 98 { 99 return RedirectToAction("Index", "Home"); 100 } 101 } 102 /// <summary> 103 /// Saves an existing user or adds a new user 104 /// </summary> 105 /// <param name="inpusername">Username</param> 106 /// <param name="inpfullname">Full name </param> 107 /// <param name="inpemail">Email</param> 108 /// <param name="u">User ID</param> 109 /// <param name="rolestoadd">Roles to add to the user</param> 110 /// <param name="groupstoadd">Groups to subscribe the user to</param> 111 /// <returns></returns> 90 112 [HttpPost] 91 113 public IActionResult saveUser(string inpusername, string inpfullname, string inpemail, string u, string[] rolestoadd, string[] groupstoadd) … … 96 118 var uid = Guid.Parse(u); 97 119 Access.User user; 98 if (uid == Guid.Empty) 120 if (uid == Guid.Empty)//checks if user is new or exists 99 121 user = new Access.User(); 100 122 else … … 107 129 108 130 if (uid == Guid.Empty) 109 { 131 {//New user 110 132 user.UserName = inpusername; 111 133 uid = accessClient.addUser(user); 134 var newpass = accessClient.resetPassword(uid); 135 sendPassmail(accessClient.Users.Find(x => x.Id == uid), newpass); 136 //password received through mail 112 137 ViewBag.Title = user.UserName + " added - User"; 113 138 } 114 139 else 115 { 140 {//Existing user 116 141 accessClient.updateUser(user); 117 142 ViewBag.Title = user.UserName + " updated - User"; 118 143 } 119 accessClient.RefreshUsers(); 144 accessClient.RefreshUsers();//Refresh data from user 120 145 user = accessClient.Users.Find(x => x.Id == uid); 121 146 foreach (var s in rolestoadd) 122 { 147 {//Loop to add roles 123 148 var role = accessClient.Roles.Find(x => x.Name == s); 124 149 … … 127 152 accessClient.RefreshUserGroups(); 128 153 foreach(var g in groupstoadd) 129 { 154 {//loop to subscribe to groups 130 155 var gid = Guid.Parse(g); 131 156 var group = accessClient.Groups.Find(x => x.Id == gid); … … 140 165 141 166 } 167 /// <summary> 168 /// Sends email for a specific user, containg a password 169 /// </summary> 170 /// <param name="u">User to mail</param> 171 /// <param name="pass">Password to send</param> 172 public static void sendPassmail(Access.User u, string pass) 173 {/* 174 SmtpClient smtpClient = new SmtpClient("mail.MyWebsiteDomainName.com", 25); 175 176 smtpClient.Credentials = new System.Net.NetworkCredential("info@MyWebsiteDomainName.com", "myIDPassword"); 177 smtpClient.UseDefaultCredentials = true; 178 smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; 179 smtpClient.EnableSsl = true; 180 MailMessage mail = new MailMessage(); 181 182 //Setting From , To and CC 183 mail.From = new MailAddress("info@MyWebsiteDomainName", "MyWeb Site"); 184 mail.Subject = "Password changed - HeuristicLab Hive"; 185 mail.Body = "Hello " + u.FullName + ", " + 186 "Your password was changed through the HeuristicLab Hive web application." + 187 "The new password for " + u.UserName + " is '" + pass + "'."; 188 mail.To.Add(new MailAddress(u.Email)); 189 190 smtpClient.Send(mail); 191 */ 192 } 193 /// <summary> 194 /// Delete a user 195 /// </summary> 196 /// <param name="id">User ID to delete</param> 197 /// <returns></returns> 142 198 public IActionResult deleteUser(string id) 143 199 { … … 148 204 149 205 if (uid == Guid.Empty) 150 { 206 {//check for empty Guid, should not happen but still 151 207 vm.message = "Something went wrong, user is not deleted"; 152 208 return View("Index", vm); … … 157 213 vm.message = user.UserName + " (" + user.FullName + ") has been deleted"; 158 214 accessClient.DeleteUser(user); 159 vm.refreshAll(); 215 vm.refreshAll();//refreshAll for index view 160 216 ViewBag.Title = "Users"; 161 return View("Index", vm); 162 } 163 } 164 else 165 { 166 return RedirectToAction("Index", "Home"); 167 } 168 169 } 170 217 return View("Index", vm);//No redirect to save the viewbag message 218 } 219 } 220 else 221 { 222 return RedirectToAction("Index", "Home"); 223 } 224 225 } 226 /// <summary> 227 /// Deletes a role from a user 228 /// </summary> 229 /// <param name="id">User Id</param> 230 /// <param name="role">Role name</param> 231 /// <returns></returns> 171 232 public IActionResult deleteUserRole(string id, string role) 172 233 { … … 178 239 var user = vm.getUserById(uid); 179 240 var r = vm.getRoleByName(role); 241 180 242 accessClient.deleteUserRole(user, r); 181 243 return RedirectToAction("SelectUser", new { id = id }); … … 186 248 } 187 249 } 250 /// <summary> 251 /// Delete user from a group 252 /// </summary> 253 /// <param name="id">User Id</param> 254 /// <param name="group">Group Id</param> 255 /// <returns></returns> 188 256 public IActionResult deleteUserGroup(string id, string group) 189 257 { … … 196 264 var user = vm.getUserById(mid); 197 265 var gr = vm.getGroupById(gid); 266 198 267 accessClient.deleteMember(user, gr); 199 268 return RedirectToAction("SelectUser", new { id = id}); … … 208 277 209 278 #region Groups 279 /// <summary> 280 /// Shows the groups overview, opening up with "Add group" 281 /// </summary> 282 /// <returns></returns> 210 283 public IActionResult Groups() 211 284 { … … 222 295 } 223 296 } 297 /// <summary> 298 /// Show information for a specific group (Guid.empty = new group) 299 /// </summary> 300 /// <param name="id">Group ID</param> 301 /// <returns></returns> 224 302 public IActionResult SelectGroup(string id) 225 303 { … … 232 310 .refreshUsers(); 233 311 if (curr == Guid.Empty) 234 { 312 {//Add group 235 313 ViewBag.Title = "Add group"; 236 314 } 237 315 else 238 { 316 {//Show existing group info and possibility to edit 239 317 vm.SelectedGroup = vm.getGroupById(curr); 240 318 vm.SelectedGroupMembers = accessClient.getGroupMembers(curr); … … 249 327 } 250 328 } 329 /// <summary> 330 /// Saves an exisiting group or adds a new one. 331 /// </summary> 332 /// <param name="inpgroupname">Group name</param> 333 /// <param name="u">Group id (empty for new)</param> 334 /// <param name="userstoadd">Users to add to group</param> 335 /// <param name="groupstoadd">Groups to add to group</param> 336 /// <returns></returns> 251 337 [HttpPost] 252 338 public IActionResult saveGroup(string inpgroupname, string u, string[] userstoadd, string[] groupstoadd) … … 259 345 Access.UserGroup group; 260 346 347 if (uid == Guid.Empty)//Create new group 348 group = new Access.UserGroup(); 349 else//Find existing group 350 group = accessClient.Groups.Find(x => x.Id == uid); 351 352 group.Name = inpgroupname; 353 261 354 if (uid == Guid.Empty) 262 group = new Access.UserGroup(); 263 else 264 group = accessClient.Groups.Find(x => x.Id == uid); 265 266 group.Name = inpgroupname; 267 268 if (uid == Guid.Empty) 269 { 355 {//New Group add 270 356 uid = accessClient.addGroup(group); 271 357 ViewBag.Title = group.Name + " added - Group"; 272 358 } 273 359 else 274 { 360 {//Existing group update 275 361 accessClient.updateGroup(group); 276 362 ViewBag.Title = group.Name + " updated - Group"; … … 278 364 vm.refreshGroups(); 279 365 group = vm.getGroupById(uid); 366 //refresh group info 280 367 foreach (var s in userstoadd) 281 { 368 {//Subscribes members to group 282 369 var tempid = Guid.Parse(s); 283 370 var member = vm.getUserById(tempid); … … 285 372 } 286 373 foreach (var g in groupstoadd) 287 { 374 {//Subscribes groups to group 288 375 var tempid = Guid.Parse(g); 289 376 var member = vm.getGroupById(tempid); … … 298 385 } 299 386 } 387 /// <summary> 388 /// Delete an existing group 389 /// </summary> 390 /// <param name="id">Group to delete</param> 391 /// <returns></returns> 300 392 public IActionResult deleteGroup(string id) 301 393 { … … 306 398 307 399 if (uid == Guid.Empty) 308 { 400 {//Check for empty ID, should not happen but still.. 309 401 vm.message = "Something went wrong, group is not deleted"; 310 402 return View("Groups", vm); 311 403 } 312 404 else 313 { 405 {//Deletes the user group 314 406 var group = vm.getGroupById(uid); 315 407 vm.message = group.Name + " has been deleted"; … … 325 417 326 418 } 419 /// <summary> 420 /// Delete a member from a group 421 /// </summary> 422 /// <param name="g">Group id</param> 423 /// <param name="m">User id</param> 424 /// <returns>Group selected</returns> 327 425 public IActionResult deleteMember(string g, string m) 328 426 { … … 334 432 335 433 if (gid == Guid.Empty || mid == Guid.Empty) 336 { 434 {//Should not be empty but still.. 337 435 vm.message = "Something went wrong, member is not deleted"; 338 436 return View("Groups", vm); 339 437 } 340 438 else 341 { 439 {//Deletes the member 342 440 var group = vm.getGroupById(gid); 343 441 Access.UserGroupBase member = vm.getUserById(mid); … … 361 459 362 460 #region Roles 461 /// <summary> 462 /// Shows roles overview, opening with "Add role" 463 /// </summary> 464 /// <returns></returns> 363 465 public IActionResult Roles() 364 466 { … … 376 478 } 377 479 } 480 /// <summary> 481 /// Shows information for a specific role 482 /// </summary> 483 /// <param name="name">Role name</param> 484 /// <returns></returns> 378 485 public IActionResult SelectRole(string name) 379 486 { … … 383 490 UserViewModel vm = new UserViewModel(accessClient).refreshRoles(); 384 491 if (name == "" || name == null) 385 { 492 {//Add role 386 493 ViewBag.Title = "Add Role"; 387 494 } 388 495 else 389 { 496 {//Edit/view role 390 497 vm.SelectedRole = vm.getRoleByName(name); 391 498 vm.SelectedRoleEnrolled = accessClient.getEnrolled(vm.SelectedRole); … … 401 508 } 402 509 } 510 /// <summary> 511 /// Saves a role or adds a new one 512 /// </summary> 513 /// <param name="inprolename">Role name</param> 514 /// <returns></returns> 403 515 [HttpPost] 404 516 public IActionResult saveRole(string inprolename) … … 422 534 } 423 535 } 536 /// <summary> 537 /// Delete a role 538 /// </summary> 539 /// <param name="name">Role name</param> 540 /// <returns></returns> 424 541 public IActionResult deleteRole(string name) 425 542 { … … 434 551 } 435 552 } 553 /// <summary> 554 /// Deletes a user from a role 555 /// </summary> 556 /// <param name="id">User id</param> 557 /// <param name="role">Role name</param> 558 /// <returns></returns> 436 559 public IActionResult deleteRoleUser(string id, string role) 437 560 { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/CalendarHub.cs ¶
r13795 r13805 12 12 namespace HeuristicLab.Clients.Hive.WebJobManager.Hubs 13 13 { 14 /// <summary> 15 /// SignalR Hub that manages all resource management. 16 /// </summary> 14 17 public class CalendarHub : Hub 15 18 { … … 19 22 private HiveServiceLocatorWeb servloc; 20 23 private AccessAdministrationClient accessClient; 24 /// <summary> 25 /// Loads up the services for the client (Instance is only created upon a call from a client) 26 /// </summary> 21 27 private void loader() 22 28 { … … 35 41 } 36 42 } 43 /// <summary> 44 /// Initial client request for all user, group and resource information 45 /// </summary> 37 46 public void requestInfo() 38 47 { … … 40 49 adminClient.Refresh(); 41 50 UserViewModel vm = new UserViewModel(accessClient).refreshAll(); 51 42 52 var users = JsonConvert.SerializeObject(vm.users); 43 53 var groups = JsonConvert.SerializeObject(vm.ugroups); … … 45 55 Clients.Caller.processData(res, users, groups); 46 56 } 57 /// <summary> 58 /// Request for the downtimes of a specific resource 59 /// </summary> 60 /// <param name="id">Resource ID</param> 47 61 public void requestDownTime(string id) 48 62 { … … 50 64 adminClient.Refresh(); 51 65 Guid t = Guid.Parse(id); 66 67 //Loads up the downtimes for the set resource ID 52 68 adminClient.DowntimeForResourceId = t; 53 69 adminClient.RefreshCalendar(); 70 54 71 var down = JsonConvert.SerializeObject(adminClient.Downtimes); 55 72 Clients.Caller.processDowntime(id, down); 56 73 } 74 /// <summary> 75 /// Request for permissions of a specific resource (refreshable by recall) 76 /// </summary> 77 /// <param name="id">Resource ID</param> 57 78 public void requestPermissions(string id) 58 79 { … … 63 84 } 64 85 86 /// <summary> 87 /// Edit permissions for a resource 88 /// </summary> 89 /// <param name="perms">Permissions ID's</param> 90 /// <param name="idresource">Resource ID</param> 65 91 public void changePermissions(string[] perms, string idresource) 66 92 { 67 93 loader(); 68 94 var res = Guid.Parse(idresource); 95 96 //Collect current permissions 69 97 var exist = servloc.CallHiveService(x => x.GetResourcePermissions(res)); 98 99 //Separate list for new and to remove permissions 70 100 List<Guid> newPerms = new List<Guid>(); 71 101 List<Guid> revokePerms = new List<Guid>(); 102 72 103 for (var i = 0; i < perms.Length; i++) 73 104 { … … 75 106 var elemid = exist.FindIndex(x => x.GrantedUserId == p); 76 107 if (elemid != -1) 77 { 108 {//If it already exists => Scramble up Guid (checked further) 78 109 exist[elemid].GrantedUserId = Guid.Empty; 79 110 } 80 111 else 81 { 112 {//If it's not in the list, add to new permissions 82 113 newPerms.Add(p); 83 114 } 84 115 } 116 //Adds the new permissions to the resource 85 117 servloc.CallHiveService(x => x.GrantResourcePermissions(res, newPerms)); 86 118 foreach (var ex in exist) 87 { 119 {//Checks for intact ID's and adds them to the revoke list 88 120 if(ex.GrantedUserId != Guid.Empty) 89 121 { … … 91 123 } 92 124 } 125 //Revokes all permissions that were deselected by the user 93 126 servloc.CallHiveService(x => x.RevokeResourcePermissions(res, revokePerms)); 127 //Live reload the view for the resource 94 128 requestPermissions(idresource); 95 129 } 130 /// <summary> 131 /// Toggles the disposable setting for a resource 132 /// </summary> 133 /// <param name="id">Resource ID</param> 96 134 public void toggleDisposable(string id) 97 135 { … … 100 138 Guid c = Guid.Parse(id); 101 139 var obj = adminClient.Resources.ToList().Find(x => x.Id == c); 140 141 //Toggle 102 142 ((Slave)(obj)).IsDisposable = !((Slave)(obj)).IsDisposable; 143 103 144 adminClient.Store(obj, CancellationToken.None); 145 146 //Notify client of successful saving 104 147 Clients.Caller.processDispose( ((Slave)(obj)).IsDisposable); 105 148 106 149 } 150 /// <summary> 151 /// Saves changes to a resource calendar 152 /// </summary> 153 /// <param name="id">Resource id</param> 154 /// <param name="del">To delete downtimes</param> 155 /// <param name="add">New downtimes</param> 156 /// <param name="upd">Downtimes to update</param> 157 /// <param name="fresh">Check if refresh should be sent (Save all current graph or Save current graph)</param> 158 /// <param name="last">Check for last request (Save all)</param> 107 159 public void saveCalendar(string id, string[] del, string[][] add, string[][] upd, bool fresh, bool last) 108 160 { 109 161 loader(); 110 162 var calid = Guid.Parse(id); 163 164 //Load up calendar 111 165 adminClient.Refresh(); 112 166 adminClient.DowntimeForResourceId = calid; 113 167 adminClient.RefreshCalendar(); 168 114 169 var downlist = adminClient.Downtimes.ToList(); 115 170 foreach(var s in del) 116 { 171 {//Deletes downtimes 117 172 var gu = Guid.Parse(s); 118 173 var el = downlist.Find(x => x.Id == gu); … … 120 175 } 121 176 foreach (var s in add) 122 { 177 {//Adds new downtimes 178 //init 123 179 var obj = new Downtime(); 124 180 obj.Id = Guid.Empty; … … 134 190 obj.AllDayEvent = false; 135 191 obj.ResourceId = Guid.Parse(s[4]); 192 193 //Recurrency check 136 194 if (s[5] == "true") 137 { 195 {//Recurrency set 138 196 obj.Recurring = true; 139 197 if (s[6] == "0") 140 { 198 {//new Recur 141 199 var dayarr = s[9].Split(','); 142 200 var start = (new DateTime(1970, 1, 1)).AddMilliseconds(double.Parse(s[7])); 143 201 var end = (new DateTime(1970, 1, 1)).AddMilliseconds(double.Parse(s[8])); 144 loopAddDowns(start, end, dayarr, obj); 202 loopAddDowns(start, end, dayarr, obj);//Loop creation of recurrency. Start to end date 145 203 } 146 204 else 147 { 205 {//Existing recurrency (only edits current element, client handles the creation of the other events) 148 206 obj.RecurringId = Guid.Parse(s[6]); 149 207 adminClient.Store(obj, CancellationToken.None); 150 208 } 151 209 } 152 else { 210 else { //No recurrency 153 211 obj.Recurring = false; 154 212 adminClient.Store(obj, CancellationToken.None); … … 158 216 } 159 217 foreach(var s in upd) 160 { 218 {//Update existing downtime 161 219 var obj = downlist.Find(x => x.Id == Guid.Parse(s[0])); 162 220 if (s[1] == "Unavailable") … … 171 229 obj.AllDayEvent = false; 172 230 if (s[5] == "true" && !obj.Recurring) 173 { 231 {//Recurrence set 174 232 obj.Recurring = true; 175 233 if (s[6] == "00000000-0000-0000-0000-000000000000") 176 { 234 {//Creates new recurrence 177 235 var dayarr = s[9].Split(','); 178 236 var start = (new DateTime(1970, 1, 1)).AddMilliseconds(double.Parse(s[7])); 179 237 var end = (new DateTime(1970, 1, 1)).AddMilliseconds(double.Parse(s[8])); 180 //loopAddDowns(start, end, dayarr, obj); 238 loopAddDowns(start, end, dayarr, obj); 239 adminClient.Delete(obj); 240 //Delete needed to prevent doubles in the creation of the recurrency 241 //Why: event could be on not included day of the week => loop cannot find that. 181 242 } 182 243 else … … 194 255 } 195 256 if( last) 196 { 257 {//Last element from save all => Notify client 197 258 Clients.Caller.savingAllDone(); 198 259 } 199 260 else if (fresh) 200 { 261 {//Refresh for graph needed 201 262 Clients.Caller.savingCurrentDone(); 202 263 } 203 264 } 265 /// <summary> 266 /// Creates downtimes for a new recurrency 267 /// </summary> 268 /// <param name="start">Start date</param> 269 /// <param name="end">End date</param> 270 /// <param name="dayarr">Boolean day array (sun = 0,...)</param> 271 /// <param name="obj">Downtime to recur</param> 204 272 private void loopAddDowns(DateTime start, DateTime end, string[] dayarr, Downtime obj) 205 273 { 206 274 var rid = Guid.NewGuid(); 207 for (; start < end;)275 while (start < end) 208 276 { 209 277 if (dayarr[(int)(start.DayOfWeek)] == "true") 210 { 278 {//Check for day of the week 279 //Set setting for the downtime to add 211 280 var temp = new Downtime(); 212 temp.StartDate = start.AddHours(obj.StartDate.Hour - start.Hour).AddMinutes(obj.StartDate.Minute - start.Minute); 213 temp.EndDate = start.AddHours(obj.EndDate.Hour - start.Hour).AddMinutes(obj.EndDate.Minute - start.Minute); 214 temp.Id = obj.Id; 281 temp.StartDate = start.AddHours(obj.StartDate.Hour - start.Hour) 282 .AddMinutes(obj.StartDate.Minute - start.Minute); 283 temp.EndDate = start.AddHours(obj.EndDate.Hour - start.Hour) 284 .AddMinutes(obj.EndDate.Minute - start.Minute); 285 temp.Id = Guid.Empty; 215 286 temp.DowntimeType = obj.DowntimeType; 216 287 temp.AllDayEvent = obj.AllDayEvent; -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/UserInfoHub.cs ¶
r13741 r13805 1 1 using HeuristicLab.Clients.Access.Administration; 2 using HeuristicLab.Clients.Hive.WebJobManager.Controllers; 2 3 using HeuristicLab.Clients.Hive.WebJobManager.Services; 3 4 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User; … … 10 11 namespace HeuristicLab.Clients.Hive.WebJobManager.Hubs 11 12 { 13 /// <summary> 14 /// Small SignalR hub to change the password from a user 15 /// </summary> 12 16 public class UserInfoHub: Hub 13 17 { … … 15 19 private Guid userId; 16 20 private AccessAdministrationClient aac; 21 /// <summary> 22 /// Loads required services 23 /// </summary> 17 24 private void loader() 18 25 { … … 29 36 } 30 37 } 31 38 /// <summary> 39 /// Request to change pass 40 /// </summary> 41 /// <param name="user">User id</param> 32 42 public void resetPassword(string user) 33 43 { … … 36 46 Access.User u = new UserViewModel(aac).refreshUsers().getUserById(userid); 37 47 var pass = aac.resetPassword(userid); 48 UserController.sendPassmail(u, pass);//Send mail + show pass 38 49 Clients.Caller.showNewPass(pass); 39 50 } -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/CalendarHubber.js ¶
r13795 r13805 12 12 var hubber = $.connection.calendarHub; 13 13 14 vm. alertMessage = "No alerts";15 vm.currentcal = [];16 $scope. permission = false;17 vm.selectedEventId = -1; 18 vm.groups = []; 19 vm.clients = []; 14 vm.currentcal = [];//Reference to current calendar (treeview.currentNode.calendar) 15 $scope.permissionview = false;//Show permissions or not 16 $scope.resaddview = false;//Show add resources or not 17 vm.selectedEventId = -1;//Selected downtime (-1 for none) 18 vm.groups = []; //All resource groups 19 vm.clients = []; //All resources 20 20 vm.init = function () { 21 22 // $.connection.hub.logging = true;23 24 21 25 22 var v = document.getElementById("userId").innerHTML; 26 23 $.connection.hub.qs = { 'userid': v }; 24 //Connection string set to identify the unique session ID for the user 27 25 $.connection.hub.start().done(function () { 28 hubber.server.requestInfo(); 29 }); 26 hubber.server.requestInfo();//initial data request 27 }); 28 29 //Process all initial data needed (heavy load) 30 30 hubber.client.processData = function (data, users, groups) { 31 31 vm.data = JSON.parse(data); … … 36 36 $scope.$apply(); 37 37 }; 38 39 //Saving from current graph is done -> refresh it 38 40 hubber.client.savingCurrentDone = function () { 39 41 vm.calendarSaver = false; … … 41 43 $scope.$apply(); 42 44 }; 45 46 //Saving all graphs done -> clear everything 43 47 hubber.client.savingAllDone = function () { 44 48 vm.calendarSaver = false; … … 46 50 $scope.$apply(); 47 51 }; 52 53 //Dispose toggle refresh for current 48 54 hubber.client.processDispose = function (disp) { 49 55 vm.treeview.currentNode.IsDisposable = disp; … … 51 57 $scope.$apply(); 52 58 } 59 60 //Permissions refresh for specific resource 53 61 hubber.client.processPermissions = function (id, perm) { 54 62 var json = JSON.parse(perm); … … 59 67 $scope.$apply(); 60 68 } 69 70 //Process downtimes for a resource. Data conversion 61 71 hubber.client.processDowntime = function (id, down) { 62 72 var json = JSON.parse(down); … … 98 108 } 99 109 110 //Initial function to build the resource tree 111 $scope.buildTree = function () { 112 vm.tree = []; 113 vm.temptree = []; 114 vm.top = false; 115 var ungrouped = { 116 children: [], 117 Name: 'Ungrouped' 118 } 119 for (; vm.data.length > 0;) { 120 121 if (vm.data[0].ParentResourceId == null && vm.data[0].IsDisposable !== undefined) { 122 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 123 vm.clients.push(curr); 124 ungrouped.children.push(curr); 125 } 126 else if (vm.data[0].ParentResourceId == null) { 127 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 128 vm.groups.push(curr); 129 vm.tree.push(curr); 130 } 131 else { 132 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 133 if (curr.IsDisposable !== undefined) 134 vm.clients.push(curr); 135 else 136 vm.groups.push(curr); 137 vm.temptree.push(curr); 138 } 139 } 140 vm.tree.push(ungrouped); 141 142 };//End for hubber init 143 144 //menu navigation 145 $scope.menuchange = function (i) { 146 switch (i) { 147 case 0: 148 $scope.permissionview = false; 149 $scope.resaddview = false; 150 break; 151 case 1: 152 $scope.permissionview = true; 153 $scope.resaddview = false; 154 break; 155 case 2: 156 $scope.permissionview = false; 157 $scope.resaddview = true; 158 break; 159 } 160 } 161 162 //Seeks for children, used recursively for building the treeview 163 $scope.seekChildren = function (current) { 164 current.calendar = []; 165 current.children = []; 166 current.todelete = []; 167 current.changes = false; 168 current.collapsed = true; 169 for (var t = 0; t < vm.temptree.length;) { 170 if (current.Id == vm.temptree[t].ParentResourceId) { 171 current.children.push(vm.temptree.splice(t, 1)[0]); 172 } 173 else { 174 t++; 175 } 176 } 177 var childc = current.children.length;//Remembers count of children received from temp tree; 178 for (var t = 0; t < vm.data.length;) { 179 if (current.Id == vm.data[t].ParentResourceId) { 180 if (vm.data[t].IsDisposable !== undefined) 181 vm.clients.push(vm.data[t]); 182 else 183 vm.groups.push(vm.data[t]); 184 current.children.push(vm.data.splice(t, 1)[0]); 185 } 186 else { 187 t++; 188 } 189 } 190 for (var t = childc; t < current.children.length; t++) { 191 current.children[t] = $scope.seekChildren(current.children[t]); 192 } 193 return current; 194 } 195 196 //Change to another resource 100 197 $scope.$watch("treeview.currentNode", function (newValue, oldValue) { 101 198 $scope.currentcal = []; 199 $scope.resaddview = false; 102 200 $(".selected.ng-binding").addClass('loaded'); 103 201 $scope.selectedEventId = -1; 104 202 203 //Check if resource already has downtime data loaded 105 204 if ($scope.treeview.currentNode != null && $scope.treeview.currentNode.Id != undefined) { 106 205 if ($scope.treeview.currentNode.calendar.length === 0) { 206 //Reach out to server to receive resource data 107 207 hubber.server.requestPermissions(vm.treeview.currentNode.Id); 108 208 hubber.server.requestDownTime(vm.treeview.currentNode.Id); … … 112 212 $timeout(function () { 113 213 refreshPermissions(); 214 //set previously loaded data 114 215 $scope.currentcal = $scope.treeview.currentNode.calendar; 115 216 }, 0); 116 217 117 218 } 118 } 119 120 }); 121 } 219 $scope.refreshAdds(); 220 } 221 222 }); 223 } 224 225 //Resets the add resources menu 226 $scope.refreshAdds = function() { 227 for (var i = 0; i < $scope.clients.length; i++) { 228 $scope.clients[i].add = false; 229 for (var j = 0; j < $scope.treeview.currentNode.children.length; j++) { 230 if ($scope.clients[i].Id === $scope.treeview.currentNode.children[j].Id) 231 $scope.clients[i].add = true; 232 } 233 } 234 } 235 236 //Resets the permissions menu 122 237 function refreshPermissions() { 123 238 for (var i = 0; i < $scope.permUsers.length; i++){ … … 136 251 } 137 252 } 253 254 //Add resource group show by clearing the tree 138 255 $scope.clearTreeSelect = function () { 139 256 if (vm.treeview.currentNode != undefined) { … … 143 260 } 144 261 } 145 $scope.buildTree = function () { 146 vm.tree = []; 147 vm.temptree = []; 148 vm.top = false; 149 var ungrouped = { 150 children: [], 151 Name: 'Ungrouped' 152 } 153 for (; vm.data.length > 0;) { 154 155 if (vm.data[0].ParentResourceId == null && vm.data[0].IsDisposable !== undefined) { 156 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 157 vm.clients.push(curr); 158 ungrouped.children.push(curr); 159 } 160 else if (vm.data[0].ParentResourceId == null) { 161 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 162 vm.groups.push(curr); 163 vm.tree.push(curr); 164 } 165 else { 166 var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]); 167 if (curr.IsDisposable !== undefined) 168 vm.clients.push(curr); 169 else 170 vm.groups.push(curr); 171 vm.temptree.push(curr); 172 } 173 } 174 vm.tree.push(ungrouped); 175 176 }; 177 178 $scope.seekChildren = function (current) { 179 current.calendar = []; 180 current.children = []; 181 current.todelete = []; 182 current.changes = false; 183 current.collapsed = true; 184 for (var t = 0; t < vm.temptree.length;) { 185 if (current.Id == vm.temptree[t].ParentResourceId) { 186 current.children.push(vm.temptree.splice(t, 1)[0]); 187 } 188 else { 189 t++; 190 } 191 } 192 var childc = current.children.length;//Remembers count of children received from temp tree; 193 for (var t = 0; t < vm.data.length;) { 194 if (current.Id == vm.data[t].ParentResourceId) { 195 if (vm.data[t].IsDisposable !== undefined) 196 vm.clients.push(vm.data[t]); 197 else 198 vm.groups.push(vm.data[t]); 199 current.children.push(vm.data.splice(t, 1)[0]); 200 } 201 else { 202 t++; 203 } 204 } 205 for (var t = childc; t < current.children.length; t++) { 206 current.children[t] = $scope.seekChildren(current.children[t]); 207 } 208 return current; 209 } 262 263 //Reach out to server to toggle disposable for current calendar 210 264 $scope.toggleDisposable = function () { 211 265 $scope.calendarDispose = true; 212 266 hubber.server.toggleDisposable(vm.treeview.currentNode.Id); 213 267 } 268 269 //Pushes permissions to server 214 270 $scope.pushPermissions = function () { 215 271 var perms = []; … … 226 282 hubber.server.changePermissions(perms, node.Id); 227 283 } 284 285 //Collects all data from a single resource to save to the server 228 286 function collectInfoToSave(node, refresh, last) { 229 287 var arr = node.calendar.down[0]; … … 233 291 for (var i = 0; i < arr.length; i++) { 234 292 if (arr[i].id === '00000000-0000-0000-0000-000000000000') { 293 //NEW DOWNTIME 235 294 var t = arr[i].allDay.toString(); 236 295 toadd.push([ … … 250 309 } 251 310 else if (arr[i].changed === true) { 311 //EDIT EXISTING DOWNTIME 252 312 var t = arr[i].allDay.toString(); 253 313 toupd.push([ … … 269 329 hubber.server.saveCalendar(node.Id, todel, toadd, toupd, refresh, last); 270 330 } 331 332 //Save current calendar 271 333 $scope.saveCurrentCalendar = function () { 272 334 vm.calendarSaver = true; 273 collectInfoToSave(vm.treeview.currentNode, true, false); 335 collectInfoToSave(vm.treeview.currentNode, true, false);//true for refresh, false for save all 274 336 //true for refresh, false for showing it's only one calendar saved. 275 337 } 338 339 //Save all changed calendars 276 340 $scope.saveAllCalendars = function () { 277 341 … … 289 353 }).then(function (success) { 290 354 vm.calendarSaver = true; 355 291 356 for (var i = 0; i < $scope.allSave.length; i++) { 292 357 if (i >= $scope.allSave.length - 1) … … 299 364 300 365 } 366 367 //Checks treeview for edits and builds new array containing these (recurse for children) 301 368 function createSaveRequests(node) { 302 369 if (node.changes === true) … … 306 373 } 307 374 } 375 376 //Clears and refreshes calendar for current resource (delete current changes) 308 377 $scope.clearCurrentCalendar = function () { 309 378 … … 319 388 320 389 } 390 391 //Clears all calendars and refreshes current (Deletes all changes) 321 392 $scope.clearAllCalendars = function () { 322 393 ngDialog.openConfirm({ … … 333 404 334 405 } 406 407 //Function that clears all calendar (separate so dialog is not called when saveAll is finished) 335 408 function clearAllCalendarsFunc() { 336 409 $(".ng-binding.changed").removeClass('changed'); … … 347 420 $(".selected.ng-scope").addClass('loaded'); 348 421 } 422 423 //Recurse trough tree view 349 424 function clearCalendarsRecurse(node) { 350 425 … … 356 431 } 357 432 } 433 434 //Delete all downtimes from current resource 358 435 $scope.deleteAllEvents = function () { 359 436 vm.calendarDeleter = true; … … 373 450 }); 374 451 } 452 453 //Delete all past events 375 454 $scope.deleteAllPreviousEvents = function () { 376 455 vm.calendarDeleter = true; … … 395 474 } 396 475 397 476 //Sets the status of a downtime AND the current resource to changed 398 477 $scope.setChanged = function (id) { 399 478 if (id != -1) { … … 408 487 $(".selected").addClass('changed'); 409 488 } 410 //*Add event by click 489 490 //Adds event by click on empty space 411 491 $scope.calendarClick = function (date, jsEvent, view) { 412 492 … … 418 498 end.setHours(dat.getHours() + 2); 419 499 vm.treeview.currentNode.calendar.down[0].push({ 420 id: '00000000-0000-0000-0000-000000000000', 500 id: '00000000-0000-0000-0000-000000000000',//Makes it recognizable as new for the server 421 501 title: 'Unavailable', 422 502 start: dat, … … 440 520 441 521 } 522 523 //Finds array index for specific _id 442 524 function checkId(id) { 443 525 for (var i = 0; i < vm.treeview.currentNode.calendar.down[0].length ; i++) { … … 447 529 return -1; 448 530 } 449 / * alert on eventClick */531 //Set selected downtime 450 532 $scope.eventClick = function (date, jsEvent, view) { 451 533 vm.selectedEventId = checkId(date._id); 452 534 }; 535 //Sets selected downtime by clicking on the button at bottom on the page, moves to date 453 536 $scope.eventClickBtn = function (id) { 454 537 vm.selectedEventId = checkId(id); 455 538 vm.goToDate(); 456 539 }; 457 /* alert on Drop */ 540 541 //Drag and drop downtime 458 542 $scope.dragandDrop = function (event, delta, revertFunc, jsEvent, ui, view) { 459 543 vm.selectedEventId = checkId(event._id); … … 474 558 vm.treeview.currentNode.calendar.down[0][vm.selectedEventId].end = new Date(event.end); 475 559 }; 476 / * alert on Resize */560 //Resize downtime 477 561 $scope.resizeEvent = function (event, delta, revertFunc, jsEvent, ui, view) { 478 562 vm.selectedEventId = checkId(event._id); … … 482 566 }; 483 567 484 / * remove event */568 //Removes a downtime from client (existing downtime gets referenced in todelete 485 569 $scope.remove = function (index) { 486 570 vm.selectedEventId = -1; … … 493 577 494 578 }; 579 //Remove trough list view at bottom 495 580 $scope.removeList = function (id) { 496 581 var index = checkId(id); … … 504 589 505 590 }; 506 591 //Check if start is before end AND start is after now (recursion) 507 592 $scope.checkDateStartEnd = function () { 508 593 if ($scope.currentcal.down[0][vm.selectedEventId].rec.start > $scope.currentcal.down[0][vm.selectedEventId].rec.end || … … 515 600 $scope.currentcal.down[0][vm.selectedEventId].rec.start = new Date(); 516 601 } 517 //pushes all changes to other recurs602 //pushes all changes to other existing recurs and creates new downtimes where needed 518 603 $scope.pushRecurChanges = function (recid) { 519 604 ngDialog.openConfirm({ … … 526 611 plain: true 527 612 }).then(function (success) { 613 528 614 var arr = vm.treeview.currentNode.calendar.down[0]; 615 //Deep copy of downtime for referencing 529 616 var ob = $.extend(true, {}, arr[vm.selectedEventId]); 530 for (var i = 0; i < arr.length;) { 617 618 for (var i = 0; i < arr.length;) {//Go trough downtimes and find all recurrences 531 619 if (arr[i].rec.recid === recid) { 532 620 if (new Date(arr[i].start) < new Date(ob.rec.start) || 533 621 new Date(arr[i].end) > new Date(ob.rec.end) || 534 622 !ob.rec.days[new Date(arr[i].start).getDay()]) { 535 vm.remove(i); 623 //Downtime is out of recurrence boundaries 624 //Before start date OR After end date OR Not on right day of the week 625 vm.remove(i);//NO I++ -> REMOVE SPLICES ARRAY 536 626 vm.selectedEventId = -1; 537 627 538 628 } 539 629 else { 540 630 //Edit downtime when it is within the bounds 541 631 arr[i].start.setHours(ob.start.getHours(), ob.start.getMinutes()); 542 632 arr[i].end.setHours(ob.end.getHours(), ob.end.getMinutes()); … … 551 641 i++; 552 642 } 643 //init for new downtimes. 553 644 var start = new Date(ob.rec.start); 554 start.setHours(2, 0, 0, 0); 645 start.setHours(2, 0, 0, 0);//Beginning of the day + time conversion +02 555 646 var end = new Date(ob.rec.end); 556 end = new Date(end.setHours(24, 0, 0, 0) + 1000 * 3600 * 2); 557 558 loop1: 647 end = new Date(end.setHours(24, 0, 0, 0) + 1000 * 3600 * 2);//End of the day + time conversion +02 648 649 loop1: //Loop start to end with single day increment 559 650 for (var d = (start.getTime()) ; d < (end.getTime()) ;) { 560 651 var tog = ob.rec.days[new Date(d).getDay()]; 652 //Check if day of the week is included in recursion 561 653 if (tog) { 562 loop2: 654 loop2://Loop checking existing downtime array to see if day is already filled or not 563 655 for (var i = 0; i < arr.length; i++) { 564 656 … … 567 659 if (arr[i].start.getTime() >= d && 568 660 arr[i].end.getTime() <= dend) { 569 d += (1000 * 3600 * 24); 570 continue loop1; 661 d += (1000 * 3600 * 24);//add day to loop 1 662 continue loop1;//breaks out of loop2 and skips to next day 571 663 } 572 664 } 573 665 } 574 666 //Made it here = new event needed: init 575 667 var ts = new Date(d); 576 668 ts.setHours(new Date(ob.start).getHours(), new Date(ob.start).getMinutes()); … … 589 681 } 590 682 591 d += (1000 * 3600 * 24);// 1 day 592 593 } 594 }); 595 } 683 d += (1000 * 3600 * 24);// adds one day 684 685 } 686 }); 687 } 688 689 //Delete all bound recurrences 596 690 $scope.deleteAllRecurrences = function (recid) { 597 691 ngDialog.openConfirm({ … … 614 708 } 615 709 710 //Moves calendar to selected date 616 711 $scope.goToDate = function () { 617 712 $("#resourcecalendar").fullCalendar('gotoDate', vm.currentcal.down[0][vm.selectedEventId].start); 618 713 } 619 /* Render Tooltip */714 /* Renders Tooltip */ 620 715 $scope.eventRender = function (event, element, view) { 621 716 element.attr({ … … 625 720 //$compile(element)($scope); 626 721 }; 627 / * config object */722 //Calendar configuration 628 723 $scope.uiConfig = { 629 724 calendar: { … … 650 745 }; 651 746 747 748 652 749 653 750 654 751 }).filter('disp', function () { 655 return function (input) { 752 return function (input) {//Filter boolean to string 656 753 return input ? 'Disposable' : 'Not disposable'; 657 754 } 658 755 }).directive('animateOnChange', function ($timeout) { 659 return function (scope, element, attr) { 756 return function (scope, element, attr) {//Animation on downtime info to show change 660 757 scope.$watch(attr.animateOnChange, function (nv, ov) { 661 758 … … 665 762 $timeout(function () { 666 763 element.removeClass('changed'); 667 }, 250); // Could be enhanced to take duration as a parameter764 }, 250); 668 765 } 669 766 else { … … 671 768 $timeout(function () { 672 769 element.removeClass('changedshut'); 673 }, 250); // Could be enhanced to take duration as a parameter770 }, 250); 674 771 } 675 772 } -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/UserInfoHubber.js ¶
r13754 r13805 2 2 3 3 $(function () { 4 $.connection.hub.logging = true;4 //$.connection.hub.logging = true; 5 5 var v = document.getElementById("userId").innerHTML; 6 6 console.log(v); … … 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 word: " + pass + "</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 }; -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Styling/angular.treeview.css ¶
r13795 r13805 61 61 62 62 div[data-tree-model] li.selected { 63 box-shadow: 2px 3px 5px rgba(0,0,0,0.6), inset 1px 10px 300px 51px rgba(143,201,58,1)!important;63 box-shadow: 2px 3px 5px rgba(0,0,0,0.6), inset 1px 10px 300px 51px #5cb85c!important; 64 64 } 65 65 div[data-tree-model] span.selected { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/AccessAdministrationClient.cs ¶
r13754 r13805 31 31 namespace HeuristicLab.Clients.Access.Administration 32 32 { 33 /// <summary> 34 /// Controls everything User/Group/Role related 35 /// </summary> 33 36 [Item("AccessAdministrationClient", "AccessAdministration client.")] 34 37 public class AccessAdministrationClient : IContent -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs ¶
r13754 r13805 124 124 } 125 125 126 /// <summary> 127 /// Returns the AccessAdministrationClient used for User/Group/Role management 128 /// </summary> 129 /// <param name="id"></param> 130 /// <returns></returns> 126 131 public AccessAdministrationClient getAccessAdminClient(Guid id) 127 132 { 128 133 return accessclients.Find(x => x.userId == id); 129 134 } 135 /// <summary> 136 /// Returns HiveAdminClient used for Resource management 137 /// </summary> 138 /// <param name="id"></param> 139 /// <returns></returns> 130 140 public HiveAdminClientWeb getAdminClient(Guid id) 131 141 { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/User/UserViewModel.cs ¶
r13754 r13805 7 7 namespace HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User 8 8 { 9 /// <summary> 10 /// ViewModel containing User/Group/Role data 11 /// </summary> 9 12 public class UserViewModel 10 13 { … … 24 27 public List<Access.UserGroupBase> SelectedRoleEnrolled { get; set; } 25 28 29 /// <summary> 30 /// Initialize viewmodel and set up connection 31 /// </summary> 32 /// <param name="ac">AccessAdminClient for connection</param> 26 33 public UserViewModel(AccessAdministrationClient ac) 27 34 { … … 40 47 41 48 } 49 /// <summary> 50 /// Refreshes Users, Groups and Roles 51 /// </summary> 52 /// <returns></returns> 42 53 public UserViewModel refreshAll() 43 54 { … … 47 58 return this; 48 59 } 60 /// <summary> 61 /// Refreshes only the Users 62 /// </summary> 63 /// <returns></returns> 49 64 public UserViewModel refreshUsers() 50 65 { … … 53 68 return this; 54 69 } 70 /// <summary> 71 /// Refreshes only the Roles 72 /// </summary> 73 /// <returns></returns> 55 74 public UserViewModel refreshRoles() 56 75 { … … 59 78 return this; 60 79 } 80 /// <summary> 81 /// Refreshes only the User Groups 82 /// </summary> 83 /// <returns></returns> 61 84 public UserViewModel refreshGroups() 62 85 { … … 65 88 return this; 66 89 } 90 /// <summary> 91 /// Returns a user by its Id 92 /// </summary> 93 /// <param name="id">User Id</param> 94 /// <returns></returns> 67 95 public Access.User getUserById(Guid id) 68 96 { 69 97 return users.Find(x => x.Id == id); 70 98 } 99 /// <summary> 100 /// Returns a group by its Id 101 /// </summary> 102 /// <param name="id">Group id</param> 103 /// <returns></returns> 71 104 public Access.UserGroup getGroupById(Guid id) 72 105 { 73 106 return ugroups.Find(x => x.Id == id); 74 107 } 108 /// <summary> 109 /// Returns a role by its name 110 /// </summary> 111 /// <param name="name">Role name</param> 112 /// <returns></returns> 75 113 public Access.Role getRoleByName(string name) 76 114 { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Resource/Index.cshtml ¶
r13795 r13805 8 8 9 9 <div class="col-sm-4"> 10 <div class="btn-group btn-group-justified" style="padding:3px;margin-bottom:-1 0px"10 <div class="btn-group btn-group-justified" style="padding:3px;margin-bottom:-12px" 11 11 role="group"> 12 12 <a class="btn btn-info btn-lg btn-block disabled" … … 48 48 </h3> 49 49 <ul class="nav nav-pills nav-justified"> 50 <li role="presentation" ng-class="{ 'active': !permission }" ng-style="{ 'text-decoration': !permission ? 'underline' : ''}"> 50 <li role="presentation" 51 ng-class="{ 'active': !permissionview && !resaddview }" 52 ng-style="{ 'text-decoration': !permissionview && !resaddview ? 'underline' : ''}"> 51 53 <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border: 1px solid white;" 52 54 href="" 53 ng-click=" permission = false">55 ng-click="menuchange(0)"> 54 56 Resource info 55 57 </a> 56 58 </li> 57 <li role="presentation" ng-class="{ 'active': permission }" ng-style="{ 'text-decoration': permission ? 'underline' : ''}"> 59 <li role="presentation" 60 ng-class="{ 'active': permissionview }" 61 ng-style="{ 'text-decoration': permissionview ? 'underline' : ''}"> 58 62 <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border: 1px solid white;" 59 63 href="" 60 ng-click=" permission = true">64 ng-click="menuchange(1)"> 61 65 Permissions 62 66 </a> 63 67 </li> 68 <li ng-if="treeview.currentNode.IsDisposable === undefined" 69 role="presentation" 70 ng-class="{ 'active': resaddview }" 71 ng-style="{ 'text-decoration': resaddview ? 'underline' : ''}"> 72 73 <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border: 1px solid white;" 74 href="" 75 ng-click="menuchange(2)"> 76 Add resources 77 </a> 78 </li> 64 79 </ul> 65 66 <form ng-show="permission" 80 <form ng-show="!permissionview && resaddview" 67 81 method="post" 68 asp-action=" editPermissions"82 asp-action="addResourcesToGroup" 69 83 asp-controller="Resource" 70 84 enctype="multipart/form-data" 71 class="row panel-heading" 72 > 73 <div 74 class="row" style="padding:10px;"> 85 class="row panel-heading"> 86 <div class="row" style="padding:5px;"> 87 <h4>Info</h4> 88 <p> 89 This shows only 90 <span style="text-decoration:underline">direct members</span> 91 of the group (not members of subgroups). 92 </p> 93 <p>Adding a member will overwrite the current group it's a member in (if any)</p> 94 <p>Removing an existing member will make it revert to Ungrouped.</p> 95 <a ng-click="refreshAdds()" href="" 96 class="btn btn-info pull-right" 97 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 98 text-shadow:2px 2px black;">Reset to current members</a> 99 <div class="row" style="margin:5px"> 100 <h4>All resources</h4> 101 <label class="col-sm-3" 102 ng-style="{ 103 'background-color':client.add === true ? 'green' : '' }" 104 ng-repeat="client in clients | orderBy:['!add', 'Name' ] | filter:searchText"> 105 <input type="checkbox" 106 name="addres" 107 value="{{client.Id}}" 108 ng-model="client.add"> {{client.Name}} 109 </label> 110 </div> 111 </div> 112 <input style="display:none" 113 type="text" 114 id="groupid" 115 name="groupid" 116 value="{{treeview.currentNode.Id}}" /> 117 118 <button type="submit" 119 id="inpsaver" 120 class="btn btn-success pull-right" 121 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 122 text-shadow:2px 2px black;"> 123 <i class="fa fa-save"></i> 124 Add resources to group 125 </button> 126 </form> 127 <form ng-show="permissionview && !resaddview" 128 method="post" 129 enctype="multipart/form-data" 130 class="row panel-heading"> 131 <div class="row" style="padding:10px;"> 75 132 <h4>Groups</h4> 76 133 <label class="col-sm-3" ng-repeat="group in permGroups"> 77 <input type="checkbox" 78 name="permgroups" 134 <input type="checkbox" 135 name="permgroups" 79 136 value="{{group.Id}}" 80 137 ng-model="group.state"> {{group.Name}} … … 84 141 <h4>Users</h4> 85 142 <label class="col-sm-3 col-lg-2" ng-repeat="user in permUsers"> 86 <input type="checkbox" 87 name="permusers" 143 <input type="checkbox" 144 name="permusers" 88 145 value="{{user.Id}}" 89 146 ng-model="user.state"> {{user.UserName}} 90 147 </label> 91 148 </div> 92 <div class="btn btn- info pull-right"149 <div class="btn btn-success pull-right" 93 150 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 94 151 text-shadow:2px 2px black;" 95 152 ng-click="pushPermissions()"> 96 <i ng-if="permissionLoader" class="fa fa-spin fa-save"></i> 97 Save permission changes</div> 153 <i ng-if="permissionLoader" class="fa fa-spin fa-save"></i> 154 Save permission changes 155 </div> 98 156 </form> 99 <form ng-show="!permission "157 <form ng-show="!permissionview && !resaddview" 100 158 method="post" 101 159 asp-action="deleteClientGroup" … … 155 213 <tr> 156 214 <td>Memory (free/total)</td> 157 <td>{{treeview.currentNode.FreeMemory/1024 | number:1}} GB/ {{treeview.currentNode.Memory/1024 | number:1}} GB</td>215 <td>{{treeview.currentNode.FreeMemory/1024 | number:1}} / {{treeview.currentNode.Memory/1024 | number:1}} GB</td> 158 216 </tr> 159 217 … … 161 219 </table> 162 220 </form> 163 <form method="post" 221 <form method="post" ng-show="!permissionview && !resaddview" 164 222 asp-action="changeParent" 165 223 asp-controller="Resource" … … 169 227 <input style="display:none" type="text" id="inpid" name="inpid" value="{{treeview.currentNode.Id}}" /> 170 228 171 <span style="padding:0px" class="col-sm-4">Change parent resource: </span>229 <span style="padding:0px" class="col-sm-4">Change group: </span> 172 230 173 231 <select class="form-control col-sm-5" … … 190 248 text-shadow:2px 2px black;"> 191 249 <i class="fa fa-save"></i> 192 Change parent250 Change group 193 251 </button> 194 252 </form> … … 485 543 <h3>Choose resources </h3> 486 544 <h5>(This will overwrite the group set for these resources)</h5> 487 <table> 488 <tr ng-repeat="client in clients | orderBy:['Name'] track by $index" class="checkbox col-md-6 col-lg-4"> 489 <td> 490 <label> 491 <input type="checkbox" 492 name="clientstoadd" 493 value="{{client.Id}}"> 494 <i class="fa fa-desktop" aria-hidden="true"></i> {{client.Name | limitTo : 7}} - {{client.Cores}}x {{client.CpuSpeed/1000 | number:1}} GHz - {{client.Memory / 1024 | number:1}} GB 495 </label> 496 </td> 497 </tr> 498 </table> 545 <label>Search: <input ng-init="searchText = ''" ng-model="searchText"></label> 546 <div class="row"> 547 <div style="margin:0px" 548 ng-repeat="client in clients | orderBy:['Name'] | filter:searchText" class="checkbox col-md-6 col-lg-4"> 549 550 <label ng-style="{ 551 'background-color':client.checked === true ? 'green' : '', 552 'color':client.checked === true ? 'white' : '' }" 553 style="border-radius:5px"> 554 <input type="checkbox" 555 name="clientstoadd" 556 ng-model="client.checked" 557 value="{{client.Id}}" /> 558 <i class="fa fa-desktop" aria-hidden="true"></i> {{client.Name | limitTo : 7}} - {{client.Cores}}x {{client.CpuSpeed/1000 | number:1}} GHz - {{client.Memory / 1024 | number:1}} GB 559 </label> 560 561 </div> 562 </div> 499 563 </div> 500 564 </form> -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Groups.cshtml ¶
r13754 r13805 37 37 style="padding:10px; margin-right:0px!important"> 38 38 <div class="col-sm-4"> 39 <div class="btn-group-vertical btn-block"> 39 <div class="btn-group btn-group-justified btn-block" 40 role="group" style="margin-bottom:-4px"> 41 40 42 <a class="btn btn-info btn-lg btn-block disabled" 41 style=" box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);43 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); 42 44 text-shadow:2px 2px black;"> 43 45 <i class="fa fa-group"></i> @Model.ugroups.Count Group@(Model.ugroups.Count != 1 ? "s" : "") … … 52 54 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 53 55 text-shadow:2px 2px black;"> 54 <i class="fa fa-plus-circle"></i> Add new group56 <i class="fa fa-plus-circle"></i> 55 57 </a> 58 </div> 59 <div class="btn-group-vertical btn-block"> 60 56 61 @foreach (var group in Model.ugroups) 57 62 { … … 128 133 </div> 129 134 </div> 130 135 <input type="text" 136 style="display:none" 137 id="u" 138 name="u" 139 value="@Model.SelectedGroup.Id" /> 131 140 132 141 @if (Model.SelectedGroup.Id != Guid.Empty) -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml ¶
r13754 r13805 47 47 { 48 48 <div class="col-sm-4"> 49 <div class="btn-group-vertical btn-block"> 50 <a class="btn btn-info btn-lg btn-block disabled" 51 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 49 <div class="btn-group btn-group-justified btn-block" 50 role="group" style="margin-bottom:-4px"> 51 52 <a class="btn btn-info btn-lg disabled" 53 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); 52 54 text-shadow:2px 2px black;"> 53 55 <i class="fa fa-user"></i> @Model.users.Count User@(Model.users.Count != 1 ? "s" : "") 54 56 </a> 55 <a class="btn btn-success btn-block57 <a class="btn btn-success 56 58 @(Model.SelectedUser.Id == Guid.Empty ? "active" : "") 57 59 " 60 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 61 text-shadow:2px 2px black;" 58 62 asp-controller="User" 59 63 asp-action="SelectUser" 60 64 asp-route-id="@Guid.Empty" 61 onclick="showUser()" 62 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 63 text-shadow:2px 2px black;"> 64 <i class="fa fa-user-plus"></i> Add new user 65 onclick="showUser()"> 66 <i class="fa fa-user-plus"></i> 65 67 </a> 68 </div> 69 <div class="btn-group-vertical btn-block"> 70 71 66 72 @foreach (var user in Model.users) 67 73 { … … 119 125 method="post" 120 126 asp-action="saveUser" 121 asp-controller="User" 127 asp-controller="User" 122 128 enctype="multipart/form-data" 123 129 onsubmit="showSaver()"> … … 181 187 @Model.SelectedUser.Id 182 188 </label> 183 189 184 190 </div> 185 191 <div class="form-group"> … … 295 301 { 296 302 <div class="row"> 297 303 298 304 <p class="col-sm-10"><i class="fa fa-gavel"></i> @r.Name</p> 299 305 <p class="col-sm-2"> … … 359 365 id="inpsaver" 360 366 disabled 361 class="btn btn-default" 362 > 367 class="btn btn-default"> 363 368 <i class="fa fa-save"></i> 364 369 @(Model.SelectedUser.Id != Guid.Empty ? "Save changes" : "Add user") -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Roles.cshtml ¶
r13754 r13805 38 38 39 39 <div class="col-sm-4"> 40 <div class="btn-group-vertical btn-block"> 40 <div class="btn-group btn-group-justified btn-block" 41 role="group" style="margin-bottom:-4px"> 42 41 43 <a class="btn btn-info btn-lg btn-block disabled" 42 style=" box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);44 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); 43 45 text-shadow:2px 2px black;"> 44 46 <i class="fa fa-gavel"></i> @Model.roles.Count Role@(Model.roles.Count != 1 ? "s" : "") … … 53 55 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 54 56 text-shadow:2px 2px black;"> 55 <i class="fa fa-plus-circle"></i> Add new role57 <i class="fa fa-plus-circle"></i> 56 58 </a> 59 </div> 60 <div class="btn-group-vertical btn-block"> 61 57 62 @foreach (var role in Model.roles) 58 63 { -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/css/site.min.css ¶
r13795 r13805 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}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 rgba(143,201,58,1)!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}.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}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. -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/calendarhubber.js ¶
r13795 r13805 14 14 vm.alertMessage = "No alerts"; 15 15 vm.currentcal = []; 16 $scope.permission = false; 16 $scope.permissionview = false; 17 $scope.resaddview = false; 17 18 vm.selectedEventId = -1; 18 19 vm.groups = []; … … 100 101 $scope.$watch("treeview.currentNode", function (newValue, oldValue) { 101 102 $scope.currentcal = []; 103 $scope.resaddview = false; 102 104 $(".selected.ng-binding").addClass('loaded'); 103 105 $scope.selectedEventId = -1; … … 112 114 $timeout(function () { 113 115 refreshPermissions(); 116 114 117 $scope.currentcal = $scope.treeview.currentNode.calendar; 115 118 }, 0); 116 119 117 120 } 118 } 119 120 }); 121 $scope.refreshAdds(); 122 } 123 124 }); 125 } 126 $scope.refreshAdds = function() { 127 for (var i = 0; i < $scope.clients.length; i++) { 128 $scope.clients[i].add = false; 129 for (var j = 0; j < $scope.treeview.currentNode.children.length; j++) { 130 if ($scope.clients[i].Id === $scope.treeview.currentNode.children[j].Id) 131 $scope.clients[i].add = true; 132 } 133 } 121 134 } 122 135 function refreshPermissions() { … … 650 663 }; 651 664 665 $scope.menuchange = function (i) { 666 switch(i) { 667 case 0: 668 $scope.permissionview = false; 669 $scope.resaddview = false; 670 break; 671 case 1: 672 $scope.permissionview = true; 673 $scope.resaddview = false; 674 break; 675 case 2: 676 $scope.permissionview = false; 677 $scope.resaddview = true; 678 break; 679 } 680 } 681 652 682 653 683 -
TabularUnified branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/userinfohubber.js ¶
r13754 r13805 1 function resetPass(a){hubber.server.resetPassword(a)}var hubber=$.connection.userInfoHub;$(function(){ $.connection.hub.logging=!0;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 password: "+a+"</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'>An email has been sent to the user containing the new password</label>")}});
Note: See TracChangeset
for help on using the changeset viewer.