Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13847


Ignore:
Timestamp:
05/12/16 17:09:12 (8 years ago)
Author:
jlodewyc
Message:

#2582 Security access implemented, directory renaming and choosing, adding more partials

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  
    3030        private Guid userId;
    3131
     32
    3233        private JobViewModel vm;
     34        private UploadedJobViewModel upper;
    3335        private IHostingEnvironment _environment;
    3436
     
    3840        {
    3941            weblog = WebLoginService.Instance;
    40             vm = new JobViewModel();
     42           
    4143            _environment = env;
    4244        }
     
    4850        {
    4951            var u = HttpContext.Session.GetString("UserId");
     52           
    5053            if (u == null || u == "" || Guid.Parse(u) == Guid.Empty)
    5154            {
     
    5558            {
    5659                userId = Guid.Parse(u);
     60                vm = new JobViewModel(weblog.getCurrentUser(userId));
     61                upper = new UploadedJobViewModel(weblog.getCurrentUser(userId));
     62
    5763                serviceLocator = weblog.getServiceLocator(userId);
    5864                serviceClient = serviceLocator.getHiveServiceClient();
    5965                clientWeb = weblog.getClientWeb(userId);
     66               
    6067                return serviceLocator.CheckLogin();
    6168            }
     
    149156            if (init())
    150157            {
    151                 UploadedJobViewModel upper = new UploadedJobViewModel();
    152158                fillUploadsPaths(upper, -1);
    153159                ViewBag.Name = serviceClient.ClientCredentials.UserName.UserName;
     
    172178            if (init())
    173179            {
    174                 UploadedJobViewModel upper = new UploadedJobViewModel();
    175180                fillUploadsPaths(upper, index);
    176181                if (index != -1)
     
    188193            }
    189194        }
     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        }
    190242        /// <summary>
    191243        /// Loads all the paths from the selected uploads folder
     
    195247        private void fillUploadsPaths(UploadedJobViewModel vm, int index)
    196248        {
     249           
    197250            var tempdex = index; //Fix when maps gets deleted
    198251            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            }
    199260            var dirs = Directory.GetDirectories(start);
    200261            foreach (string dir in dirs)
     
    234295            if (init())
    235296            {
    236                 UploadedJobViewModel upper = new UploadedJobViewModel();
    237297                fillUploadsPaths(upper, index);
    238298                System.IO.File.Delete(upper.FullFilesPaths[filedex]);
    239299                var message = upper.DisplayFilesPaths[filedex] + " has been deleted";
    240300
    241                 upper = new UploadedJobViewModel();
     301                upper = new UploadedJobViewModel(weblog.getCurrentUser(userId));
    242302                fillUploadsPaths(upper, index);
    243303                upper.message = message;
     
    264324            if (init())
    265325            {
    266                 UploadedJobViewModel upper = new UploadedJobViewModel();
    267326                fillUploadsPaths(upper, index);
    268327
     
    270329                serve.NewModel();
    271330                serve.env = _environment;
    272 
     331                serve.vm.directories = upper.DisplayDatePaths;
    273332                var ioptimizer = ContentManager.Load(upper.FullFilesPaths[filedex]);
    274333
     
    306365            {
    307366                var serve = weblog.getFileOpener(userId);
     367                fillUploadsPaths(upper, -1);
     368                serve.vm.directories = upper.DisplayDatePaths;
    308369                ViewBag.JobsCount = serve.Job.Job.JobCount;
    309370                ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Uploads";
     
    339400        }
    340401        [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});
    347410            }
    348411            else
     
    356419            if (init())
    357420            {
    358                 UploadedJobViewModel upper = new UploadedJobViewModel();
    359421                fillUploadsPaths(upper, index);
    360422
     
    385447            if (init())
    386448            {
    387                 UploadedJobViewModel upper = new UploadedJobViewModel();
    388449                var uploads = Path.Combine(_environment.WebRootPath, "uploads", serviceClient.ClientCredentials.UserName.UserName,
    389450                    directory);
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/ResourceController.cs

    r13805 r13847  
    11using HeuristicLab.Clients.Access;
    22using HeuristicLab.Clients.Access.Administration;
     3using HeuristicLab.Clients.Hive.WebJobManager.Models;
    34using HeuristicLab.Clients.Hive.WebJobManager.Services;
    45using Microsoft.AspNet.Hosting;
     
    2425        private HiveAdminClientWeb adminClient;
    2526        private Guid userId;
     27        private HiveWebUser currentUser;
    2628
    2729        private IHostingEnvironment _environment;
     
    4951                adminClient = weblog.getAdminClient(userId);
    5052                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;
    5358            }
    5459        }
     
    6469                ViewBag.SessionId = HttpContext.Session.GetString("UserId");
    6570                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");
    7176            }
    7277        }
     
    116121            else
    117122            {
    118                 return RedirectToAction("Index", "Home");
     123                return RedirectToAction("Index", "Job");
    119124            }
    120125        }
     
    164169            else
    165170            {
    166                 return RedirectToAction("Index", "Home");
     171                return RedirectToAction("Index", "Job");
    167172            }
    168173        }
     
    195200            else
    196201            {
    197                 return RedirectToAction("Index", "Home");
     202                return RedirectToAction("Index", "Job");
    198203            }
    199204        }
     
    237242            else
    238243            {
    239                 return RedirectToAction("Index", "Home");
     244                return RedirectToAction("Index", "Job");
    240245            }
    241246        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs

    r13841 r13847  
    2424        private Guid userId;
    2525
     26        private UserViewModel vm;
    2627        private IHostingEnvironment _environment;
    2728
     
    4748                serviceLocator = weblog.getServiceLocator(userId);
    4849                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;
    5055                 
    5156            }
     
    6166            {
    6267                ViewBag.Title = "Users";
    63                 UserViewModel vm = new UserViewModel(accessClient).refreshAll() ;
     68                vm.refreshAll() ;
    6469                //Refreshall for users, groups and roles
    6570                ViewBag.SessionId = HttpContext.Session.GetString("UserId");
     
    6873            else
    6974            {
    70                 return RedirectToAction("Index", "Home");
     75                return RedirectToAction("Index", "Job");
    7176            }
    7277        }
     
    7883                Guid curr = Guid.Parse(id);
    7984
    80                 UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     85                vm.refreshAll();
    8186                if (curr == Guid.Empty)
    8287                {//new user
     
    97102            else
    98103            {
    99                 return RedirectToAction("Index", "Home");
     104                return RedirectToAction("Index", "Job");
    100105            }
    101106        }
     
    162167            else
    163168            {
    164                 return RedirectToAction("Index", "Home");
     169                return RedirectToAction("Index", "Job");
    165170            }
    166171
     
    199204                Guid curr = Guid.Parse(id);
    200205
    201                 UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     206                vm.refreshAll();
    202207               
    203208                    var us = vm.getUserById(curr);
     
    209214            else
    210215            {
    211                 return RedirectToAction("Index", "Home");
     216                return RedirectToAction("Index", "Job");
    212217            }
    213218        }
     
    222227            {
    223228                var uid = Guid.Parse(id);
    224                 UserViewModel vm = new UserViewModel(accessClient).refreshUsers();
     229                vm.refreshUsers();
    225230
    226231                if (uid == Guid.Empty)
     
    241246            else
    242247            {
    243                 return RedirectToAction("Index", "Home");
     248                return RedirectToAction("Index", "Job");
    244249            }
    245250
     
    256261            {
    257262                var uid = Guid.Parse(id);
    258                 UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     263                vm.refreshAll();
    259264
    260265                var user = vm.getUserById(uid);
     
    266271            else
    267272            {
    268                 return RedirectToAction("Index", "Home");
     273                return RedirectToAction("Index", "Job");
    269274            }
    270275        }
     
    281286                var gid = Guid.Parse(group);
    282287                var mid = Guid.Parse(id);
    283                 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();
     288                vm.refreshGroups().refreshUsers();
    284289
    285290                var user = vm.getUserById(mid);
     
    291296            else
    292297            {
    293                 return RedirectToAction("Index", "Home");
     298                return RedirectToAction("Index", "Job");
    294299            }
    295300
     
    308313
    309314                ViewBag.Title = "Groups";
    310                 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();
     315                vm.refreshGroups().refreshUsers();
    311316                return View("Groups", vm);
    312317            }
    313318            else
    314319            {
    315                 return RedirectToAction("Index", "Home");
     320                return RedirectToAction("Index", "Job");
    316321            }
    317322        }
     
    327332                Guid curr = Guid.Parse(id);
    328333
    329                 UserViewModel vm = new UserViewModel(accessClient)
     334                vm
    330335                    .refreshGroups()
    331336                    .refreshUsers();
     
    345350            else
    346351            {
    347                 return RedirectToAction("Index", "Home");
     352                return RedirectToAction("Index", "Job");
    348353            }
    349354        }
     
    362367            {
    363368                var uid = Guid.Parse(u);
    364                 var vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();
     369                vm.refreshGroups().refreshUsers();
    365370
    366371                Access.UserGroup group;
     
    403408            else
    404409            {
    405                 return RedirectToAction("Index", "Home");
     410                return RedirectToAction("Index", "Job");
    406411            }
    407412        }
     
    416421            {
    417422                var uid = Guid.Parse(id);
    418                 UserViewModel vm = new UserViewModel(accessClient).refreshGroups();
     423                vm.refreshGroups();
    419424
    420425                if (uid == Guid.Empty)
     
    434439            else
    435440            {
    436                 return RedirectToAction("Index", "Home");
     441                return RedirectToAction("Index", "Job");
    437442            }
    438443
     
    450455                var gid = Guid.Parse(g);
    451456                var mid = Guid.Parse(m);
    452                 UserViewModel vm = new UserViewModel(accessClient).refreshGroups().refreshUsers();
     457                vm.refreshGroups().refreshUsers();
    453458
    454459                if (gid == Guid.Empty || mid == Guid.Empty)
     
    473478            else
    474479            {
    475                 return RedirectToAction("Index", "Home");
     480                return RedirectToAction("Index", "Job");
    476481            }
    477482
     
    490495
    491496                ViewBag.Title = "Roles";
    492                 UserViewModel vm = new UserViewModel(accessClient).refreshRoles();
     497                vm.refreshRoles();
    493498
    494499                return View("Roles", vm);
     
    496501            else
    497502            {
    498                 return RedirectToAction("Index", "Home");
     503                return RedirectToAction("Index", "Job");
    499504            }
    500505        }
     
    509514            {
    510515
    511                 UserViewModel vm = new UserViewModel(accessClient).refreshRoles();
     516                vm.refreshRoles();
    512517                if (name == "" || name == null)
    513518                {//Add role
     
    526531            else
    527532            {
    528                 return RedirectToAction("Index", "Home");
     533                return RedirectToAction("Index", "Job");
    529534            }
    530535        }
     
    552557            else
    553558            {
    554                 return RedirectToAction("Index", "Home");
     559                return RedirectToAction("Index", "Job");
    555560            }
    556561        }
     
    569574            else
    570575            {
    571                 return RedirectToAction("Index", "Home");
     576                return RedirectToAction("Index", "Job");
    572577            }
    573578        }
     
    583588            {
    584589                var uid = Guid.Parse(id);
    585                 UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     590                vm.refreshAll();
    586591
    587592                var user = vm.getUserById(uid);
     
    593598            else
    594599            {
    595                 return RedirectToAction("Index", "Home");
     600                return RedirectToAction("Index", "Job");
    596601            }
    597602        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/CalendarHub.cs

    r13805 r13847  
    4848            loader();
    4949            adminClient.Refresh();
    50             UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     50            UserViewModel vm = new UserViewModel(accessClient, weblog.getCurrentUser(userId)).refreshAll();
    5151
    5252            var users = JsonConvert.SerializeObject(vm.users);
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/UserInfoHub.cs

    r13805 r13847  
    4444            loader();
    4545            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);
    4747            var pass = aac.resetPassword(userid);
    4848            UserController.sendPassmail(u, pass);//Send mail + show pass           
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/ProgressHubber.js

    r13844 r13847  
    66
    77    var v = document.getElementById("userId").innerHTML;
     8    var busy = false;
    89    console.log(v);
    910    $.connection.hub.qs = { 'userid': v };
     
    3132   
    3233    hubber.client.saveComplete = function (text) {
    33         $("#succText").html(text);
     34        if(busy)
     35            window.setTimeout(1500);
     36        busy = true;
     37        $("#succText").html(text);
    3438        $("#success-alert").alert();
    3539        $("#success-alert").fadeTo(2000, 500).slideUp(500, function () {
    3640            $("#success-alert").hide();
     41            busy = false;
    3742        });
    3843    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Styling/StyleSheet.css

    r13827 r13847  
    44    background-color: #fff;
    55    -webkit-font-smoothing: antialiased;
    6     font: normal 14px Roboto,arial,sans-serif;
     6    font: normal 14px Roboto,arial,sans-serif !important;
    77}
    88
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Jobs/FileOpeningService.cs

    r13827 r13847  
    4343        public void NewModel()
    4444        {
    45             vm = new FileOpeningViewModel();
     45            vm = new FileOpeningViewModel(weblog.getCurrentUser(UserId));
    4646            Job = new RefreshableJob();
    4747
     
    8080            return null;
    8181        }
    82         public void SaveToFile(string file)
     82        public void SaveToFile(string file, string dname)
    8383        {
    8484            if(vm != null)
    8585            {
    8686                var uploads = Path.Combine(env.WebRootPath, "uploads", weblog.getServiceLocator(UserId).getHiveServiceClient().ClientCredentials.UserName.UserName,
    87                     "HiveChanged");
     87                    dname);
    8888                Directory.CreateDirectory(uploads);
    8989                var cont = Job.HiveTasks.First().ItemTask.Item;
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs

    r13841 r13847  
    11using HeuristicLab.Clients.Access.Administration;
     2using HeuristicLab.Clients.Hive.WebJobManager.Models;
    23using HeuristicLab.Clients.Hive.WebJobManager.ViewModels;
    34using System;
     
    2324        private List<AccessAdministrationClient> accessclients;
    2425        private List<HiveAdminClientWeb> adminclients;
     26        private List<HiveWebUser> loggedinUsers;
    2527        /// <summary>
    2628        /// Service instance that keeps all the information per user seperated. Data is in  different lists so
     
    5153            accessclients = new List<AccessAdministrationClient>();
    5254            adminclients = new List<HiveAdminClientWeb>();
     55            loggedinUsers = new List<HiveWebUser>();
    5356        }
    5457        /// <summary>
     
    6770            loggedIn.Add(log);
    6871            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());
    7978        }
    8079        /// <summary>
     
    150149            return adminclients.Find(x => x.userId == id);
    151150        }
     151        public HiveWebUser getCurrentUser(Guid id)
     152        {
     153            return loggedinUsers.Find(x => x.webIdToken == id);
     154        }
    152155        /// <summary>
    153156        /// Removes all traces from the logged in user.
     
    164167            adminclients.RemoveAll(x => x.userId == id);
    165168            loggedIn.RemoveAll(x => x.userId == id);
    166 
     169            loggedinUsers.RemoveAll(x => x.webIdToken == id);
    167170        }
    168171    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/FileOpeningViewModel.cs

    r13733 r13847  
    1 using HeuristicLab.Optimization;
    2 
     1using HeuristicLab.Clients.Hive.WebJobManager.Models;
     2using HeuristicLab.Optimization;
     3using System.Collections.Generic;
    34
    45namespace HeuristicLab.Clients.Hive.WebJobManager.ViewModels
     
    1011    {
    1112        public OptimizerHiveTask SelectedTask { get; set; }
     13        public List<string> directories { get; set; }
    1214        public IAlgorithm SelectedAlgorithm { get; set; }
    1315        public Experiment SelectedExperiment { get; set; }
    1416        public BatchRun SelectedBatchRun { get; set; }
    1517        public string message { get; set; }
     18        public HiveWebUser currentUser { get; set; }
     19
     20        public FileOpeningViewModel(HiveWebUser hwu)
     21        {
     22            currentUser = hwu;
     23        }
    1624    }
    1725}
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/JobViewModel.cs

    r13733 r13847  
    1 using System;
     1using HeuristicLab.Clients.Hive.WebJobManager.Models;
     2using System;
    23using System.Collections.Generic;
    34using System.Linq;
     
    1112    public class JobViewModel
    1213    {
     14        public HiveWebUser currentUser { get; set; }
    1315        public List<RefreshableJob> userJobs { get; set; }
    1416
     
    1719        public List<HiveTask> selectedHiveTasks { get; set; }
    1820        public string message { get; set; }
    19         public JobViewModel()
     21        public JobViewModel(HiveWebUser hwu)
    2022        {
    2123            userJobs = null;
     
    2325            selectedHiveTasks = new List<HiveTask>();
    2426            message = "";
     27            currentUser = hwu;
    2528        }
    2629    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/Jobs/UploadedJobViewModel.cs

    r13733 r13847  
    1 using HeuristicLab.Optimization;
     1using HeuristicLab.Clients.Hive.WebJobManager.Models;
     2using HeuristicLab.Optimization;
    23using System;
    34using System.Collections.Generic;
     
    1213    public class UploadedJobViewModel
    1314    {
    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()
    1525        {
    1626            FullDatePaths = new List<string>();
     
    2030            SelectedIndex = -1;
    2131        }
    22 
    2332        public List<string> FullDatePaths { get; set; }
    2433        public List<string> DisplayDatePaths { get; set; }
     
    2736        public int SelectedIndex { get; set; }
    2837        public string message { get; set; }
    29 
     38        public HiveWebUser currentUser { get; set; }
    3039       
    3140    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/NavbarViewModel.cs

    r13733 r13847  
    1 using System;
     1using HeuristicLab.Clients.Hive.WebJobManager.Models;
     2using System;
    23using System.Collections.Generic;
    34using System.Linq;
     
    1011
    1112        public string Active { get; set; }
     13        public HiveWebUser User { get; set; }
    1214
    13         public NavbarViewModel(string ac)
     15        public NavbarViewModel(string ac, HiveWebUser hwu )
    1416        {
    1517            Active = ac;
     18            User = hwu;
    1619        }
    1720    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/User/UserViewModel.cs

    r13805 r13847  
    11using HeuristicLab.Clients.Access.Administration;
     2using HeuristicLab.Clients.Hive.WebJobManager.Models;
    23using System;
    34using System.Collections.Generic;
     
    1213    public class UserViewModel
    1314    {
    14 
     15        public HiveWebUser currentUser { get; set; }
    1516        public string message { get; set; }
    1617        public AccessAdministrationClient accessClient { get; set; }
     
    3132        /// </summary>
    3233        /// <param name="ac">AccessAdminClient for connection</param>
    33         public UserViewModel(AccessAdministrationClient ac)
     34        public UserViewModel(AccessAdministrationClient ac, HiveWebUser hwu)
    3435        {
     36            currentUser = hwu;
    3537            users = new List<Access.User>();
    3638            accessClient = ac;
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml

    r13827 r13847  
    77<div>
    88    <!-- Main nav menu-->
    9     @Html.Partial("Navbar", new NavbarViewModel("Job"))
     9    @Html.Partial("Navbar", new NavbarViewModel("Job", Model.currentUser))
    1010
    1111    <!-- Job menu-->
     
    2727    </ul>
    2828
    29     <div class="row"
    30          style="text-align:center">
    31         @Model.message
    32     </div>
     29    @Html.Partial("_ErrorMessage", Model.message)
    3330
    3431    <div class="row"
     
    5249                        <i class="fa fa-cog"></i> Hive jobs
    5350                    </a>
    54                     @foreach (var job in Model.userJobs)
     51                    @foreach (var job in Model.userJobs.OrderBy(x => x.Job.DateCreated))
    5552                {
    5653                        <a class="btn btn-default
     
    6461                           onclick="showLoader()">
    6562                            @job.Job.Name - @job.Job.DateCreated
    66                             <span class="label
     63                            <span style="text-shadow:2px 2px black; font-size:13px"
     64                                  class="label
    6765                                   @(job.Job.FinishedCount == @job.Job.JobCount ? "label-success" : "label-default")
    6866                                   label-as-badge pull-right">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml

    r13844 r13847  
    1414    <div id="userId" style="display:none">@ViewBag.SessionId</div>
    1515    <!-- 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))
    1717
    1818    <!-- Job menu-->
     
    4242        </a>
    4343    </div>
    44     @Html.Partial("OpenFilePartials/_Help", Model);
     44    @Html.Partial("OpenFilePartials/_Help", Model)
    4545    <!-- Check model to select right partial, partial handles all subloading -->
    46     <div class="col-md-9">
     46    <div class="col-sm-9">
    4747        @if (Model.SelectedAlgorithm != null)
    4848        {
     
    170170                      asp-action="saveToFile"
    171171                      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>
    186188                            </div>
    187189                        </div>
    188190                    </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>
    192220                    </div>
    193221                    <button class="btn btn-success btn-block" type="submit"
     
    203231    </div>
    204232    <!-- Side scrolling menu-->
    205     <nav class="col-md-2" id="scrolly">
     233    <nav class="col-sm-2" id="scrolly">
    206234        <ul class="nav nav-pills nav-stacked"
     235            style="position:fixed"
    207236            data-spy="affix"
    208237            data-offset-top="0">
     
    222251            }
    223252            <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">
    225254                <div class="alert alert-success" id="success-alert">
    226255                    <span id="succText"></span>
     
    262291        });
    263292        collapser = function () {
    264             $('.collapse').collapse('hide');
     293            $('.collapse').not('#helperCol').collapse('hide');
    265294            //closes every collapse
    266295        }
    267296        shower = function () {
    268             $('.collapse').collapse('show');
     297            $('.collapse').not('#helperCol').collapse('show');
     298           
    269299            //opens every collapse
    270300        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Help.cshtml

    r13841 r13847  
    1717    <div class="collapse row"
    1818         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);
    2020                            ">
    2121        <h3>Types</h3>
     
    2323        <span class="label label-primary">Algorithm</span>. Clicking the buttons will expand them and show more information.</p>
    2424        <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>
    2826        <h3>Hive</h3>
    2927        <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
    24<div class="panel panel-default"
    35     style="border-width:2px!important;padding:17px;
     
    57
    68
    7         <form method="post"
    8                asp-action="Uploader"
    9                asp-controller="Job" enctype="multipart/form-data">
    10              <input onchange="printFiles()"
    11                     type="file"
    12                     id="files"
    13                     name="files"
    14                     multiple accept=".hl"
    15                     style="display:none" />
     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" />
    1618
    17              <div onclick="firefilebutton()"
    18                   class="btn btn-info btn-lg btn-block"
    19                   style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.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);
    2022                                 text-shadow:1px 1px black;">
    21                  <i class="fa fa-folder-open-o"></i> Choose file(s) to upload to the server
    22              </div>
     23            <i class="fa fa-folder-open-o"></i> Choose file(s) to upload to the server
     24        </div>
    2325
    24              <div class="row" style="margin:10px">
     26        <div class="row" style="margin:10px">
    2527
    26                  <div id="selectedfiles">
    27                  <h3>Files</h3>
    28                  <p>No files selected: press the above button to choose files</p>
    29                  </div>
     28            <div id="selectedfiles">
     29                <h3>Files</h3>
     30                <p>No files selected: press the above button to choose files</p>
     31            </div>
    3032
    31                  <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);
     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);
    3234                                 text-shadow:2px 2px black;"
    33                       type="button"
    34                          disabled
    35                       id="del"
    36                       class='btn btn-danger'
    37                       onclick='deletefiles()'>
    38                      <span class='glyphicon glyphicon-trash' aria-hidden='true'></span>
    39                      Remove files
    40                  </button>
     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>
    4143
    42                  <div
    43                       style="margin-top:20px;margin-bottom:20px">
     44            <div style="margin-top:20px;margin-bottom:20px">
    4445
    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);
    6273                                 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>
    7181
    7282    </form>
     
    8393            document.getElementById("directory").disabled = false;
    8494
    85            
     95
    8696            for (var i = 0; i < files.length; i++) {
    8797                div.innerHTML += "<p>File " + (i + 1) + ":" + files[i].name +
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml

    r13841 r13847  
    55<div>
    66
    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))
    88
    99    <ul class="nav nav-pills nav-justified">
     
    2323        </li>
    2424    </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
    2928    <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                       "
    3741                   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);
    4046                            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>
    4248                </a>
    4349            </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);"
    5956                       asp-controller="Job"
    6057                       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"
    6370                       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
    6673                    </a>
    6774                </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++)
    71107                    {
    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>
    80142                    }
     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
    81170                </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
    175183    </div>
    176184    <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
    22<div ng-app="wjm" ng-controller="resourceCtrl" data-ng-init="init()">
    33    <div id="userId" style="display:none">@ViewBag.SessionId</div>
    44
    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))
    66
    77
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/Navbar.cshtml

    r13733 r13847  
    22@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel
    33
    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>
    512        <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
    1128        </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            {
    2135            <a asp-controller="Resource"
    2236               asp-action="Index">
    2337                Resources
    2438            </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  
    55<div>
    66
    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))
    88
    99    <ul class="nav nav-pills nav-justified">
     
    3030        </li>
    3131    </ul>
    32     <div class="row"
    33          style="text-align:center">
    34         @Model.message
    35     </div>
     32    @Html.Partial("_ErrorMessage", Model.message)
     33
    3634    <div class="row"
    3735         style="padding:10px; margin-right:0px!important">
     
    5957            <div class="btn-group-vertical btn-block">
    6058               
    61                 @foreach (var group in Model.ugroups)
     59                @foreach (var group in Model.ugroups.OrderBy(x => x.Name))
    6260                {
    6361                    <a class="btn  btn-default @( group.Id == Model.SelectedGroup.Id ? "active" : "" )"
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml

    r13841 r13847  
    44<div>
    55
    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))
    77
    88    <ul class="nav nav-pills nav-justified">
     
    2929        </li>
    3030    </ul>
    31     <div class="row"
    32          style="text-align:center">
    33         @Model.message
    34     </div>
     31    @Html.Partial("_ErrorMessage", Model.message)
     32
    3533    <div class="row"
    3634         style="padding:10px; margin-right:0px!important">
     
    7068
    7169
    72                     @foreach (var user in Model.users)
     70                    @foreach (var user in Model.users.OrderBy(x => x.UserName))
    7371                    {
    7472                        <a class="btn  btn-default @( user.Id == Model.SelectedUser.Id ? "active" : "" )"
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Roles.cshtml

    r13827 r13847  
    55<div>
    66
    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))
    88
    99    <ul class="nav nav-pills nav-justified">
     
    3030        </li>
    3131    </ul>
    32     <div class="row"
    33          style="text-align:center">
    34         @Model.message
    35     </div>
     32    @Html.Partial("_ErrorMessage", Model.message)
    3633    <div class="row"
    3734         style="padding:10px; margin-right:0px!important">
     
    6057            <div class="btn-group-vertical btn-block">
    6158               
    62                 @foreach (var role in Model.roles)
     59                @foreach (var role in Model.roles.OrderBy(x => x.Name))
    6360                {
    6461                    <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}/*!
    22 * Bootstrap v3.3.6 (http://getbootstrap.com)
    33 * 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'>&times;</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")}});
     1function 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'>&times;</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.