Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/16 17:13:50 (8 years ago)
Author:
jlodewyc
Message:

#2582 Parameter changing busy, save file, download file and email on pass reset

Location:
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
Files:
8 added
28 edited

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs

    r13754 r13827  
    310310            }
    311311        }
    312         //TODO Work in progress
    313         /* public async Task<IActionResult> DownloadFile(int index, int filedex)
    314          {
    315              if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin())
    316              {
    317                  UploadedJobViewModel upper = new UploadedJobViewModel();
    318                  fillUploadsPaths(upper, index);
    319 
    320                 HttpContext.Response.ContentType = "APPLICATION/OCTET-STREAM";
    321                  String Header = "Attachment; Filename=" + upper.DisplayFilesPaths[filedex];
    322                  HttpContext.Response.Headers.Add("Content-Disposition", Header);
    323                  System.IO.FileInfo Dfile = new System.IO.FileInfo(upper.FullFilesPaths[filedex]);
    324                  await HttpContext.Response.WriteAsync(Dfile.FullName);
    325                  //HttpContext.Response.End();
    326 
    327                  var message = upper.DisplayFilesPaths[filedex] + " has been downloaded";
    328 
    329                  upper.message = message;
    330                  ViewBag.Title = "Downloaded file";
    331 
    332                  return View("Uploads", upper);
    333              }
     312        [HttpPost]
     313        public IActionResult saveToFile(string fname)
     314        {
     315            if (init())
     316            {
     317                weblog.getFileOpener(userId).SaveToFile(fname);
     318                return RedirectToAction("Uploads", "Job");
     319            }
    334320             else
    335              {
    336                  HiveServiceLocatorWeb.SetLoginErrorMessage();
    337                  return RedirectToAction("Index", "Home");
    338              }
    339          }*/
     321            {
     322                return RedirectToAction("Index", "Home");
     323            }
     324        }
     325
     326        public FileResult DownloadFile(int index, int filedex)
     327        {
     328            if (init())
     329            {
     330                UploadedJobViewModel upper = new UploadedJobViewModel();
     331                fillUploadsPaths(upper, index);
     332
     333                System.IO.FileInfo Dfile = new System.IO.FileInfo(upper.FullFilesPaths[filedex]);
     334                var fileName = Dfile.Name;
     335                byte[] fileBytes = System.IO.File.ReadAllBytes(upper.FullFilesPaths[filedex]);
     336                return File(fileBytes, "application/x-msdownload", fileName);
     337            }
     338            else
     339            {
     340                return null;
     341            }
     342        }
    340343
    341344        #endregion
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs

    r13805 r13827  
    132132                    user.UserName = inpusername;
    133133                    uid = accessClient.addUser(user);
     134                    accessClient.RefreshUsers();
    134135                    var newpass = accessClient.resetPassword(uid);
    135136                    sendPassmail(accessClient.Users.Find(x => x.Id == uid), newpass);
     
    172173        public static void sendPassmail(Access.User u, string pass)
    173174        {/*
    174             SmtpClient smtpClient = new SmtpClient("mail.MyWebsiteDomainName.com", 25);
    175 
    176             smtpClient.Credentials = new System.Net.NetworkCredential("info@MyWebsiteDomainName.com", "myIDPassword");
     175            SmtpClient smtpClient = new SmtpClient("smtp.gmail.com",587);
    177176            smtpClient.UseDefaultCredentials = true;
     177            smtpClient.Credentials = new System.Net.NetworkCredential("trac.heuristiclab@gmail.com", "||||||||||||");
    178178            smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    179179            smtpClient.EnableSsl = true;
     
    181181
    182182            //Setting From , To and CC
    183             mail.From = new MailAddress("info@MyWebsiteDomainName", "MyWeb Site");
     183            mail.From = new MailAddress("trac.heuristiclab@gmail.com", "HeuristicLab");
    184184            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 + "'.";
     185            mail.Body = "Hello " + u.FullName + ", " + Environment.NewLine + Environment.NewLine+
     186                "Your password was changed through the HeuristicLab Hive web application." + Environment.NewLine+
     187                "The new password for " + u.UserName + " is ' " + pass + " '." + Environment.NewLine + Environment.NewLine +
     188                "HeuristicLab Hive";
    188189            mail.To.Add(new MailAddress(u.Email));
    189190
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/ProgressHub.cs

    r13739 r13827  
    66using System.Linq;
    77using System.Threading.Tasks;
     8using HeuristicLab.Data;
     9using System.Reflection;
    810
    911namespace HeuristicLab.Clients.Hive.WebJobManager
     
    2628                userId = Guid.Empty;
    2729            }
    28             else {
     30            else
     31            {
    2932                userId = Guid.Parse(uid);
    3033                fileopener = weblog.getFileOpener(userId);
     
    5154            if (name != null)
    5255                fileopener.Job.Job.Name = name;
    53             if(resource != null && resource != "")
     56            if (resource != null && resource != "")
    5457            {
    5558                fileopener.Job.Job.ResourceNames += "/" + resource;
     
    7073            {//check if upper job
    7174                current.ItemTask.ComputeInParallel = !current.ItemTask.ComputeInParallel;
    72                
    73             }
    74             else {
     75
     76            }
     77            else
     78            {
    7579                for (var i = 0; i < arr.Length; i++)
    7680                {
     
    8993
    9094                    }
    91                     else {//not deep enough, select right path
     95                    else
     96                    {//not deep enough, select right path
    9297                        if (current.ItemTask.Item is BatchRun)
    9398                            current = current.ChildHiveTasks[arr[i][1]]; // select right batch
     
    115120
    116121            }
    117             else {
     122            else
     123            {
    118124                for (var i = 0; i < arr.Length; i++)
    119125                {//loop for depth
     
    132138
    133139                    }
    134                     else {//not deep enough, choose right path
     140                    else
     141                    {//not deep enough, choose right path
    135142                        if (current.ItemTask.Item is BatchRun)
    136143                            current = current.ChildHiveTasks[arr[i][1]]; // select right batch
     
    177184
    178185        }
     186        public void paraEdit(int[][] arr, string problem, string name, string type, string value)
     187        {
     188
     189
     190            loader();
     191            HiveTask current = fileopener.Job.HiveTasks.ToList()[0];
     192            if (arr.Length == 0)
     193            {//check if upper job
     194                if (current.ItemTask.Item is Algorithm)
     195                {
     196                    searchEditPara(current, problem, name, type, value);
     197                }
     198            }
     199            else
     200            {
     201                for (var i = 0; i < arr.Length; i++)
     202                {//loop for depth
     203                    if (i == arr.Length - 1)
     204                    {//Right depth reached, change priority for current
     205                        if (current.ItemTask.Item is BatchRun)
     206                        {
     207                            current = current.ChildHiveTasks[arr[i][1]];
     208                        }
     209                        else if (current.ItemTask.Item is Experiment)
     210                        {
     211                            current = current.ChildHiveTasks[arr[i][0]];
     212                        }
     213                        if (current.ItemTask.Item is Algorithm)
     214                        {
     215                            searchEditPara(current, problem, name, type, value);
     216                        }
     217                    }
     218                    else
     219                    {//not deep enough, choose right path
     220                        if (current.ItemTask.Item is BatchRun)
     221                            current = current.ChildHiveTasks[arr[i][1]]; // select right batch
     222                        else if (current.ItemTask.Item is Experiment)
     223                            current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment
     224                    }
     225                }
     226            }
     227        }
     228        /// <summary>
     229        /// Generic parameter setter
     230        /// </summary>
     231        /// <param name="curr">Current task to edit </param>
     232        /// <param name="problem">Problem parameter or normal parameter</param>
     233        /// <param name="name">Property name</param>
     234        /// <param name="type">Datatype</param>
     235        /// <param name="value">New value</param>
     236        private void searchEditPara(HiveTask curr, string problem, string name, string type, string value)
     237        {
     238            var prob = problem == "True" ? true : false;
     239
     240            var dattype = Type.GetType(type);
     241            if (dattype == null)
     242            {//Use assemblies to find correct datatype
     243                foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
     244                {
     245                    dattype = a.GetType(type);
     246                    if (dattype != null)
     247                        break;
     248                }
     249            }
     250            //find parse method
     251            var parse = dattype.GetMethod("Parse", new[] { typeof(string) });
     252
     253            if (parse != null)
     254            {
     255                //Parses string to correct datatype
     256                var val = parse.Invoke(null, new object[] { value });
     257
     258                //BUGGERS
     259                if (name == "ReevaluateElites")
     260                    name = "ReevaluteElites";
     261                if (name == "DominateOnEqualQualities" || name == "PlusSelection" || name == "ReevaluteElites")
     262                    val = ((BoolValue)val).Value;
     263               
     264               // if (name == "ReduceToPopulationSize")
     265                    //name += "Parameter";
     266
     267                try
     268                {
     269                    Algorithm alg = (Algorithm)curr.ItemTask.Item;
     270                    if (prob)
     271                        alg.Problem.GetType().GetProperty(name).SetValue(alg, val);
     272                    else
     273                        alg.GetType().GetProperty(name).SetValue(alg, val);
     274                }
     275                catch (NullReferenceException e)
     276                {
     277                    Console.WriteLine("NullRefException: " + name + " - " + type);
     278                }
     279                catch(TargetException e)
     280                {
     281                    Console.WriteLine("TargetException: " + name + " - " + type);
     282                }
     283            }
     284
     285        }
    179286
    180287    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/ProgressHubber.js

    r13754 r13827  
    7777    document.getElementById("prior" + id).className = "btn dropdown-toggle ";
    7878}
     79
     80
     81function paraEdit(arr, problem, name, type, value) {
     82    hubber.server.paraEdit(arr, problem, name, type, value);
     83}
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Styling/StyleSheet.css

    r13795 r13827  
    159159        background-color:#74a9d8 !important;
    160160    }
     161    rect{
     162        -webkit-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
     163-moz-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
     164box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
     165    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Jobs/FileOpeningService.cs

    r13740 r13827  
    11using HeuristicLab.Clients.Hive.WebJobManager.ViewModels;
     2using HeuristicLab.Common;
     3using HeuristicLab.Optimization;
    24using Microsoft.AspNet.Hosting;
     5using Microsoft.AspNet.Mvc;
    36using System;
    47using System.Collections.Generic;
     8using System.IO;
    59using System.Linq;
    610using System.Threading;
     
    4145            vm = new FileOpeningViewModel();
    4246            Job = new RefreshableJob();
     47
    4348            Job.Job.Name = "init";
    4449           
     
    7580            return null;
    7681        }
     82        public void SaveToFile(string file)
     83        {
     84            if(vm != null)
     85            {
     86                var uploads = Path.Combine(env.WebRootPath, "uploads", weblog.getServiceLocator(UserId).getHiveServiceClient().ClientCredentials.UserName.UserName,
     87                    "HiveChanged");
     88                Directory.CreateDirectory(uploads);
     89                var cont = Job.HiveTasks.First().ItemTask.Item;
     90                if (!file.EndsWith(".hl"))
     91                    file += ".hl";
     92                var fileloc = uploads + "\\" + file;
     93                if(cont is Experiment)
     94                    ContentManager.Save((Experiment)cont, fileloc, false);
     95                else if(cont is BatchRun)
     96                    ContentManager.Save((BatchRun)cont, fileloc, false);
     97                else if(cont is Algorithm)
     98                {
     99                    IAlgorithm t = (IAlgorithm)Job.HiveTasks.First().ItemTask.Item;
     100                    ContentManager.Save((IStorableContent)t, fileloc, false);
     101                }
     102                 
     103            }
     104        }
     105       
    77106    }
    78107}
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Home/Index.cshtml

    r13733 r13827  
    11
    22@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.LoginViewModel
    3 
     3<!-- Login page -->
    44<div class="container">
    55    <div class="row" style="align-content:center">
    66        <div class="col-xs-offset-4 col-sm-4" >
    7             <div class="form-login">
     7            <div class="form-login"> 
    88                <h4>Welcome to HeuristicLab Hive</h4>
    99                <form asp-controller="Home" asp-action="Login" method="POST">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml

    r13754 r13827  
    11@using HeuristicLab.Clients.Hive.WebJobManager.ViewModels
    22@model JobViewModel
     3
     4<!-- Displays the job manager overview -->
     5
    36<div id="userId" style="display:none">@ViewBag.SessionId</div>
    47<div>
     8    <!-- Main nav menu-->
    59    @Html.Partial("Navbar", new NavbarViewModel("Job"))
    610
     11    <!-- Job menu-->
    712    <ul class="nav nav-pills nav-justified">
    813        <li role="presentation"
     
    3843
    3944        }
    40         else {
     45        else
     46        {<!-- Display side menu containing jobs. -->
    4147            <div class="col-sm-4">
    4248                <div class="btn-group-vertical btn-block">
     
    7884                 style="padding:5px; padding-left:10px;">
    7985                @if (Model.selectedJob != null)
    80                 {
     86                { <!-- A job has been selected by the user, load info into view -->
    8187                    <div class="panel panel-default"
    8288                         style="border-width:2px!important;padding:17px;
     
    8490                        <div class="row">
    8591                            <h2 style="padding-left:20px">
     92                                <!-- Header of the job (title and delete button) -->
    8693                                @Model.selectedJob.Job.Name
    8794                                <a onclick="popUpDelete()"
     
    93100                                    Delete job
    94101                                </a>
    95                                 <a style="display:none; "
     102                                <!-- HIDDEN BUTTON FOR ASP ACTION -->
     103                                <a style="display:none; "
    96104                                   asp-action="Delete"
    97105                                   asp-route-id="@Model.selectedJob.Id"
     
    100108
    101109                                <script type="text/javascript">
    102                                     function popUpDelete() {
     110                                    function popUpDelete() {//Quick inline popup with hidden asp button
    103111                                        if (confirm("Are you sure you want to delete this job?") == true) {
    104112                                            document.getElementById("del").click();
     
    110118                            </h2>
    111119                            <div class="col-sm-6" style="padding-left:30px">
     120                                <!-- Information of the job -->
    112121                                <p>Description: @Model.selectedJob.Job.Description</p>
    113122                                <p>Resources: @Model.selectedJob.Job.ResourceNames</p>
     
    138147                        <div class="row" style="text-align:center">
    139148                            @Html.Partial("_Graphlegend")
     149                            <!-- Main graph giving overview of all the jobs-->
    140150                            <div id="graphMain" style="width:100%;height:0px">
    141151
     
    151161                            </h3>
    152162                            @foreach (var task in Model.selectedJob.HiveTasks)
    153                             {
     163                            {<!--Display all child jobs recursively -->
    154164                                @Html.Partial("SelectedJobPartials/_TaskPartial",
    155165                           new HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer(task))
     
    164174        }
    165175        <script type="text/javascript">
    166             function showLoader() {
     176            function showLoader() {//Shows load spinner
    167177                document.getElementById("content").style.display = "none";
    168178                document.getElementById("loader").style.display = "";
    169179
    170180            }
    171             function showDeleter() {
     181            function showDeleter() {//Shows delete spinner
    172182                document.getElementById("content").style.display = "none";
    173183                document.getElementById("loader").style.display = "";
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml

    r13754 r13827  
    33@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel
    44
    5 
     5<!-- Displays the contents of a file -->
     6<!-- Another body used for the side scroller menu-->
    67<body id="top"
    78      class="row"
     
    1213      style="margin-bottom:500px;margin-left:1px;margin-right:1px;">
    1314    <div id="userId" style="display:none">@ViewBag.SessionId</div>
     15    <!-- Main nav menu -->
    1416    @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job"))
    1517
     18    <!-- Job menu-->
    1619    <ul class="nav nav-pills nav-justified">
    1720        <li role="presentation"
     
    3033        </li>
    3134    </ul>
     35    <!-- Back button -->
    3236    <div class="row"
    3337         style="margin-left:20px">
     
    3842        </a>
    3943    </div>
    40 
     44    <!-- Check model to select right partial, partial handles all subloading -->
    4145    <div class="col-md-9">
    4246        @if (Model.SelectedAlgorithm != null)
     
    5559
    5660        }
    57 
     61        <!-- Main menu for job creation -->
    5862        <hr style="border-color:gray; margin-top:50px" />
    59         <div id="finish"
    60              style="text-align:center">
    61             <h2>
    62                 Hive job information
    63             </h2>
    64             <div class="row"
    65                  style="margin-bottom:20px">
    66 
    67                 <div class="col-sm-6"
    68                      style="text-align:right">
    69                     <h5>Job name</h5>
    70                 </div>
    71                 <div class="col-sm-6"
    72                      style="text-align:left">
    73                     <div class="form-group">
    74                         <div class="input-group">
    75                             <input type="text"
    76                                    class="form-control"
    77                                    name="jname"
    78                                    id="jname"
    79                                    placeholder="Job name">
    80                         </div>
     63        <div class="row">
     64            <div id="finish" class="col-sm-8"
     65                 style="text-align:center; border-right:1px solid">
     66                <h2>
     67                    Hive job information
     68                </h2>
     69                <div class="row"
     70                     style="margin-bottom:20px">
     71
     72                    <div class="col-sm-6"
     73                         style="text-align:right">
     74                        <h5>Job name</h5>
     75                    </div>
     76                    <div class="col-sm-6"
     77                         style="text-align:left">
     78                        <div class="form-group">
     79                            <div class="input-group">
     80                                <input type="text"
     81                                       class="form-control"
     82                                       name="jname"
     83                                       id="jname"
     84                                       placeholder="Job name">
     85                            </div>
     86                        </div>
     87                    </div>
     88                </div>
     89                <div class="row"
     90                     style="margin-bottom:20px">
     91                    <div class="col-sm-6"
     92                         style="text-align:right">
     93                        <h5>
     94                            Resources (optional)
     95                        </h5>
     96                    </div>
     97                    <div class="col-sm-6"
     98                         style="text-align:left">
     99                        <div class="form-group">
     100                            <div class="input-group">
     101                                <input type="text"
     102                                       class="form-control"
     103                                       name="jresource"
     104                                       id="jresource"
     105                                       placeholder="(seperate with ;)">
     106                            </div>
     107                        </div>
     108                    </div>
     109                </div>
     110
     111                <div class="row">
     112                    <h5 class="col-sm-6"
     113                        style="text-align:right;margin-top:20px">
     114                        Set global job priority
     115                    </h5>
     116                    <div class="col-sm-6">
     117                        <div class="btn-group pull-left"
     118                             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);
     119                            text-shadow:2px 2px black;">
     120                            <button type="button"
     121                                    id="prior"
     122                                    class="btn btn-info dropdown-toggle"
     123                                    data-toggle="dropdown"
     124                                    aria-haspopup="true" aria-expanded="false">
     125                                Normal <span class="caret"></span>
     126                            </button>
     127                            <ul class="dropdown-menu"
     128                                style="text-shadow:none">
     129                                <li><a onclick="changePriority([],0,'')">Low</a></li>
     130                                <li><a onclick="changePriority([],1,'')">Normal</a></li>
     131                                <li><a onclick="changePriority([],2,'')">Urgent</a></li>
     132                                <li><a onclick="changePriority([],3,'')">Critical</a></li>
     133                            </ul>
     134                        </div>
     135                    </div>
     136                </div>
     137
     138                <!-- adding the job to hive and show progress bar -->
     139                <a class="btn btn-lg btn-success"
     140                   id="fakehiveadd"
     141                   onclick="addtoHive()"
     142                   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);
     143                            text-shadow:2px 2px black;">
     144                    Add this job to Hive
     145                </a>
     146                <!-- HIDDEN BUTTON FOR ASP ACTION -->
     147                <a class="btn btn-success "
     148                   id="realhiveadd"
     149                   asp-controller="Job"
     150                   asp-action="AddToHive"
     151                   style="display:none"></a>
     152
     153                <!-- Progress-->
     154               
     155                <h4 id="result" style="display:none">Start uploading experiment...</h4>
     156                <div class="progress" id="progdiv" style="display:none">
     157
     158                    <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"
     159                         id="progress"
     160                         aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:10%">
     161
    81162                    </div>
    82163                </div>
    83164            </div>
    84             <div class="row"
    85                  style="margin-bottom:20px">
    86                 <div class="col-sm-6"
    87                      style="text-align:right">
    88                     <h5>
    89                         Resources (optional)
    90                     </h5>
    91                 </div>
    92                 <div class="col-sm-6"
    93                      style="text-align:left">
    94                     <div class="form-group">
    95                         <div class="input-group">
    96                             <input type="text"
    97                                    class="form-control"
    98                                    name="jresource"
    99                                    id="jresource"
    100                                    placeholder="(seperate with ;)">
    101                         </div>
    102                     </div>
    103                 </div>
    104             </div>
    105 
    106             <div class="row">
    107                 <h5 class="col-sm-6"
    108                     style="text-align:right;margin-top:20px">
    109                     Set global job priority
    110                 </h5>
    111                 <div class="col-sm-6">
    112                     <div class="btn-group pull-left"
    113                          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);
     165            <div class="col-sm-4">
     166                <h4>Save to file</h4>
     167                <form asp-controller="Job"
     168                   asp-action="saveToFile"
     169                      method="post">
     170                    <div class="col-sm-6"
     171                         style="text-align:right">
     172                        <h5>File name</h5>
     173                    </div>
     174                    <div class="col-sm-6"
     175                         style="text-align:left">
     176                        <div class="form-group">
     177                            <div class="input-group">
     178                                <input type="text"
     179                                       class="form-control"
     180                                       name="fname"
     181                                       id="fname"
     182                                       required
     183                                       placeholder="File name">
     184                            </div>
     185                        </div>
     186                    </div>
     187                    <div class="row"
     188                         style="text-align:center">
     189                        <h5>Directory: /HiveChanged</h5>
     190                    </div>
     191                    <button class="btn btn-success btn-block" type="submit"
     192                            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);
    114193                            text-shadow:2px 2px black;">
    115                         <button type="button"
    116                                 id="prior"
    117                                 class="btn btn-info dropdown-toggle"
    118                                 data-toggle="dropdown"
    119                                 aria-haspopup="true" aria-expanded="false">
    120                             Normal <span class="caret"></span>
    121                         </button>
    122                         <ul class="dropdown-menu"
    123                             style="text-shadow:none">
    124                             <li><a onclick="changePriority([],0,'')">Low</a></li>
    125                             <li><a onclick="changePriority([],1,'')">Normal</a></li>
    126                             <li><a onclick="changePriority([],2,'')">Urgent</a></li>
    127                             <li><a onclick="changePriority([],3,'')">Critical</a></li>
    128                         </ul>
    129                     </div>
    130                 </div>
    131             </div>
    132 
    133 
    134             <a class="btn btn-lg btn-success"
    135                id="fakehiveadd"
    136                onclick="addtoHive()"
    137                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);
    138                             text-shadow:2px 2px black;">
    139                 Add this job to Hive
    140             </a>
    141 
    142 
    143 
    144             <a class="btn btn-success " id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a>
    145             <h4 id="result" style="display:none">Start uploading experiment...</h4>
    146             <div class="progress" id="progdiv" style="display:none">
    147 
    148                 <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"
    149                      id="progress"
    150                      aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:10%">
    151 
    152                 </div>
     194                    Save to file</button>
     195                </form>
    153196            </div>
    154197        </div>
    155198
    156199
    157 
    158 
    159200    </div>
     201    <!-- Side scrolling menu-->
    160202    <nav style="margin-top:50px; "
    161203         class="col-md-2" id="scrolly">
     
    166208            <li><a href="#top"><i class="fa fa-angle-up"></i> Top</a></li>
    167209            @if (Model.SelectedAlgorithm != null)
    168             {
     210            {//Algortihm loaded
    169211                <li><a href="#algorithm">Algorithm parameters</a></li>
    170212                <li><a href="#problem">Problem parameters</a></li>
    171213            }
    172214            else
    173             {
     215            {//batch run or experiment
    174216                <li><a id="ctasks" href="#tasks">Child tasks </a></li>
    175217                <li><a onclick="shower()" href="#tasks"><i class="fa fa-eye"></i> Show all tasks</a></li>
     
    210252        collapser = function () {
    211253            $('.collapse').collapse('hide');
    212 
     254            //closes every collapse
    213255        }
    214256        shower = function () {
    215257            $('.collapse').collapse('show');
    216 
     258            //opens every collapse
    217259        }
    218260    </script>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Algorithm.cshtml

    r13754 r13827  
    1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel
    2 @{System.Random randomizer = new Random();
    3     int randy = randomizer.Next(5000); }
     1@using HeuristicLab.Core;
    42
    53
     4@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel
     5@{System.Random randomizer = new Random();
     6    int randy = randomizer.Next(50000); }
     7
     8<!-- Partial for opening an algorithm only file-->
    69<div style="margin-left:20px;margin-right:20px">
    710    <div class="row" style="text-align:center">
     
    1215            <span class="label label-primary">Algorithm: @Model.SelectedTask.ItemTask.Name</span>
    1316        </h1>
    14        
     17
    1518    </div>
    1619
     
    3033                    @foreach (var par in Model.SelectedAlgorithm.Parameters.OrderBy(x => x.Name))
    3134                    {
    32                         <tr>
    33                             <td>@par.Name</td>
    3435
    35                             <td>@par.ActualValue</td>
    36                         </tr>
    37 
     36                        @Html.Partial("OpenFilePartials/DataPartials/DataMaster",
     37                new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.Jobs.DataPackageVM( par,"[]",0, false)) 
    3838                    }
    3939                </tbody>
     
    5858                    @foreach (var prob in Model.SelectedAlgorithm.Problem.Parameters.OrderBy(x => x.Name))
    5959                    {
    60                         <tr>
    61                             <td>@prob.Name</td>
    62 
    63                             <td>@prob.ActualValue</td>
    64                         </tr>
     60                        @Html.Partial("OpenFilePartials/DataPartials/DataMaster",
     61                new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.Jobs.DataPackageVM(prob, "[]", 0,true))
    6562
    6663                    }
     
    6966        </div>
    7067    </div>
    71    
     68
    7269
    7370</div>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_AlgorithmSmall.cshtml

    r13733 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.Models.AlgorithmContainer
    2 @{int randomal = Model.randy.Next(5000);
     2@{int randomal = Model.randy.Next(50000);
    33    var builder = "[";
    44    foreach (var arr in Model.depth)
     
    88    builder += "]";
    99}
     10<!-- Partial for displaying a small version of an algorithm -->
     11
    1012<p class="text-center">
    1113    <a class="btn btn-primary"
     
    1416       aria-expanded="false"
    1517       aria-controls="collapseExample@(randomal)"
    16        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);
     18       style="margin:10px;margin-bottom:0; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    1719                            text-shadow:2px 2px black;">
    1820        @Model.algo.Name
     
    6264                @foreach (var par in Model.algo.Parameters.OrderBy(x => x.Name))
    6365                {
    64                     <tr>
    65                         <td>@par.Name</td>
    66 
    67                         <td>@par.ActualValue</td>
    68                     </tr>
     66                    @Html.Partial("OpenFilePartials/DataPartials/DataMaster",
     67                new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.Jobs.DataPackageVM(par, builder, randomal, false))
    6968
    7069                }
     
    8483                @foreach (var prob in Model.algo.Problem.Parameters.OrderBy(x => x.Name))
    8584                {
    86                     <tr>
    87                         <td>@prob.Name</td>
    88 
    89                         <td>@prob.ActualValue</td>
    90                     </tr>
     85                    @Html.Partial("OpenFilePartials/DataPartials/DataMaster",
     86                new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.Jobs.DataPackageVM(prob, builder, randomal, true))
    9187
    9288                }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml

    r13754 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel
    22@{System.Random randomizer = new Random();
    3     int randy = randomizer.Next(5000); }
     3    int randy = randomizer.Next(50000); }
     4
     5<!-- Partial for displaying a Bach run file -->
     6
    47<div style="margin-left:20px;margin-right:20px">
    58    <div class="row" style="text-align:center">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml

    r13735 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.Models.BatchRunContainer
    22@{
    3     int randombr = Model.randy.Next(5000);
     3    int randombr = Model.randy.Next(50000);
    44    var builder = "[";
    55    foreach (var arr in Model.depth)
     
    99    builder += "]";
    1010}
    11 
     11<!-- Partial for displaying a small version of a batch file-->
    1212
    1313<p class="text-center">
     
    1717       aria-expanded="false"
    1818       aria-controls="collapseExample@(randombr)"
    19         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);
     19        style="margin:10px;margin-bottom:0; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    2020                            text-shadow:2px 2px black;">
    2121        @Model.batch.Name
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml

    r13754 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel
    22@{System.Random randomizer = new Random();
    3     int randy = randomizer.Next(5000); }
     3    int randy = randomizer.Next(50000); }
    44
    5 
     5<!-- Partial for displaying an experiment file-->
    66<div style="margin-left:20px;margin-right:20px; ">
    77    <div class="row" style="text-align:center">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml

    r13735 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.Models.ExperimentContainer
    2 @{int randomex = Model.randy.Next(5000);
     2@{int randomex = Model.randy.Next(50000);
    33    var builder = "[";
    44    foreach (var arr in Model.depth)
     
    88    builder += "]";
    99}
     10<!-- Partial for displaying a small version of an experiment-->
    1011<p class="text-center">
    1112    <a class="btn btn-danger"
     
    1415       aria-expanded="false"
    1516       aria-controls="collapseExample@(randomex)"
    16        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);
     17       style="margin:10px; margin-bottom:0; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    1718                            text-shadow:2px 2px black;">
    1819        @Model.exp.Name
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_AlgTask.cshtml

    r13735 r13827  
    1414
    1515    <div class="panel-heading"
    16          data-toggle="collapse"
    17          data-target="#panbody@(Model.hiveTask.Task.Id)"
     16         
    1817         onclick="redrawGraph('@(Model.hiveTask.Task.Id)')"
    1918         aria-expanded="false"
     
    8281            </tbody>
    8382        </table>
     83        <a style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     84                            text-shadow:2px 2px black;"
     85           class="btn btn-info btn-block"
     86           data-toggle="collapse"
     87         data-target="#panbody@(Model.hiveTask.Task.Id)"><i class="fa fa-bar-chart-o"></i> Show graph</a>
    8488    </div>
    8589    <div class="panel-body " style="text-shadow:none">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_BatchTask.cshtml

    r13740 r13827  
    1313
    1414    <div class="panel-heading"
    15          data-toggle="collapse"
    16          data-target="#panbody@(Model.hiveTask.Task.Id)"
    1715         onclick="redrawGraph('@(Model.hiveTask.Task.Id)')"
    1816         aria-expanded="false"
     
    9391            </tbody>
    9492        </table>
     93        <a style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     94                            text-shadow:2px 2px black;"
     95           class="btn btn-info btn-block"
     96           data-toggle="collapse"
     97           data-target="#panbody@(Model.hiveTask.Task.Id)"><i class="fa fa-bar-chart-o"></i>Show graph</a>
    9598    </div>
    9699    <div class="panel-body " style="text-shadow:none">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_ExpTask.cshtml

    r13735 r13827  
    1717
    1818    <div class="panel-heading"
    19          data-toggle="collapse"
    20          data-target="#panbody@(Model.hiveTask.Task.Id)"
    2119         onclick="redrawGraph('@(Model.hiveTask.Task.Id)')"
    2220       aria-expanded="false"
     
    9391            </tbody>
    9492        </table>
     93        <a style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     94                            text-shadow:2px 2px black;"
     95           class="btn btn-info btn-block"
     96           data-toggle="collapse"
     97           data-target="#panbody@(Model.hiveTask.Task.Id)"><i class="fa fa-bar-chart-o"></i>Show graph</a>
    9598    </div>
    9699    <div class="panel-body " style="text-shadow:none">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/UploaderPartial/_UploaderPartial.cshtml

    r13741 r13827  
    44                        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
    55
    6     <form method="post"
    7           asp-action="Uploader"
    8           asp-controller="Job" enctype="multipart/form-data">
    9         <input onchange="printFiles()"
    10                type="file"
    11                id="files"
    12                name="files"
    13                multiple accept=".hl"
    14                style="display:none" />
    156
    16         <div onclick="firefilebutton()"
    17              class="btn btn-info btn-lg btn-block"
    18              style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    19                             text-shadow:1px 1px black;">
    20             <i class="fa fa-folder-open-o"></i> Choose file(s) to upload to the server
    21         </div>
     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" />
    2216
    23         <div class="row" style="margin:10px">
     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);
     20                                 text-shadow:1px 1px black;">
     21                 <i class="fa fa-folder-open-o"></i> Choose file(s) to upload to the server
     22             </div>
    2423
    25             <div id="selectedfiles">
    26             <h3>Files</h3>
    27             <p>No files selected: press the above button to choose files</p>
    28             </div>
     24             <div class="row" style="margin:10px">
    2925
    30             <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);
    31                             text-shadow:2px 2px black;"
    32                  type="button"
    33                     disabled
    34                  id="del"
    35                  class='btn btn-danger'
    36                  onclick='deletefiles()'>
    37                 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span>
    38                 Remove files
    39             </button>
     26                 <div id="selectedfiles">
     27                 <h3>Files</h3>
     28                 <p>No files selected: press the above button to choose files</p>
     29                 </div>
    4030
    41             <div
    42                  style="margin-top:20px;margin-bottom:20px">
     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);
     32                                 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>
    4341
    44                 <label for="basic-url">Directory name</label>
    45                 <div class="input-group">
    46                     <span class="input-group-addon"
    47                           id="basic-addon3">
    48                         .../uploads/@ViewBag.Name
    49                     </span>
    50                     <input
    51                            type="text"
    52                            disabled
    53                            class="form-control"
    54                            id="directory"
    55                            name="directory"
    56                            aria-describedby="basic-addon3"
    57                            value="@(DateTime.Now.ToString("yyyy.MM.dd"))" />
    58                 </div>
    59             </div>
    60             <button 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;"
    62                    disabled
    63                     id="upl"
    64                    class="btn btn-lg btn-block btn-success"
    65                    type="submit"
    66                     >
    67                 <i class="fa fa-plus-square"></i> Add to uploads
    68                 </button>
    69         </div>
     42                 <div
     43                      style="margin-top:20px;margin-bottom:20px">
     44
     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);
     62                                 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>
    7071
    7172    </form>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml

    r13742 r13827  
    11@model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.UploadedJobViewModel
    22
     3
     4<!-- Shows uploaded files and the uploader -->
    35<div>
    46
     
    4446        else {
    4547            <div class="col-sm-4">
    46                 <div class="btn-group-vertical btn-block">
     48                <div class="btn-group btn-group-justified btn-block"
     49                     role="group" style="margin-bottom:-4px">
     50
    4751                    <a class="btn btn-info btn-lg btn-block disabled"
    48                        style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     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);
    4953                            text-shadow:2px 2px black;">
    5054                        <i class="fa fa-cloud"></i> Uploads
     
    5963                       style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    6064                            text-shadow:2px 2px black;">
    61                         <i class="fa fa-cloud-upload"></i> Upload new file(s)
     65                        <i class="fa fa-cloud-upload"></i>
    6266                    </a>
     67                </div>
     68                <div class="btn-group-vertical btn-block">
     69                   
    6370                    @for (int i = 0; i < Model.DisplayDatePaths.Count; i++)
    6471                    {
     
    7279                        </a>
    7380                    }
    74 
    7581                </div>
    7682            </div>
     
    100106                {
    101107                    <div class="col-sm-8">
    102 
     108                        <h4>Click on a file to prepare it for upload to Hive</h4>
    103109                        @for (int i = 0; i < Model.DisplayFilesPaths.Count; i++)
    104110                    {
     111                           
    105112                            <div class="btn-group-justified btn-block">
    106 
     113                               
    107114                                <a class="btn btn-default @(Model.DisplayFilesPaths[i].EndsWith(".hl") ? "" : "disabled" )"
    108115                                   asp-controller="Job"
     
    111118                                   asp-route-filedex="@i"
    112119                                   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);">
    113                                     @Model.DisplayFilesPaths[i]
     120                                   <i class="fa fa-list-alt"></i>  @Model.DisplayFilesPaths[i]
     121                                </a>
     122                                <a id="down"
     123                                   style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     124                            text-shadow:2px 2px black;"
     125                                   class='btn btn-group btn-success'
     126                                   asp-controller="Job"
     127                                   asp-action="DownloadFile"
     128                                   asp-route-index="@(Model.SelectedIndex)"
     129                                   asp-route-filedex="@i">
     130                                    <span class='glyphicon glyphicon-download-alt' aria-hidden='true'></span>
    114131                                </a>
    115132                                <a id="del"
     
    124141                                    <span class='glyphicon glyphicon-trash' aria-hidden='true'></span>
    125142                                </a>
     143                               
    126144                            </div>
    127145                        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Resource/Index.cshtml

    r13805 r13827  
    4141                   class="btn pull-right"
    4242                   style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    43                             text-shadow:2px 2px black;font-weight:bold;margin-bottom:5px"
     43                            text-shadow:2px 2px black;font-weight:bold;margin-bottom:5px;"
    4444                   ng-class="{ 'btn-success': treeview.currentNode.IsDisposable, 'btn-warning': !treeview.currentNode.IsDisposable }"
    4545                   ng-click="toggleDisposable()">
     
    6060                    ng-class="{ 'active': permissionview }"
    6161                    ng-style="{ 'text-decoration': permissionview ? 'underline' : ''}">
    62                     <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border: 1px solid white;"
     62                    <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border:1px solid white;"
    6363                       href=""
    6464                       ng-click="menuchange(1)">
     
    6969                    role="presentation"
    7070                    ng-class="{ 'active': resaddview }"
    71                     ng-style="{ 'text-decoration': resaddview ? 'underline' : ''}">
     71                    ng-style="{'text-decoration': resaddview ? 'underline' : ''}">
    7272
    7373                    <a style="text-shadow:2px 2px black; color:white; font-weight:bold; border: 1px solid white;"
     
    8888                    <p>
    8989                        This shows only
    90                         <span style="text-decoration:underline">direct members</span>
     90                        <span style="text-decoration:underline;">direct members</span>
    9191                        of the group (not members of subgroups).
    9292                    </p>
     93                    <p><span style="color:lightgray;">Gray clients</span> are already subscribed to another group. White are ungrouped.</p>
    9394                    <p>Adding a member will overwrite the current group it's a member in (if any)</p>
    9495                    <p>Removing an existing member will make it revert to Ungrouped.</p>
     
    9798                       style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    9899                            text-shadow:2px 2px black;">Reset to current members</a>
    99                     <div class="row" style="margin:5px">
     100                    <div class="row" style="margin:5px;">
    100101                        <h4>All resources</h4>
    101102                        <label class="col-sm-3"
    102103                               ng-style="{
    103                                    'background-color':client.add === true ? 'green' : '' }"
    104                                ng-repeat="client in clients  | orderBy:['!add', 'Name' ]  | filter:searchText">
    105                             <input type="checkbox"
     104                                   'background-color':client.add === true ? 'green' : '',
     105                               'color':client.ParentResourceId != null ? 'lightgray' : ''}"
     106                               ng-repeat="client in clients  | orderBy:['!add', 'Name']  | filter:searchText">
     107                            <input
     108                                  type="checkbox"
    106109                                   name="addres"
    107110                                   value="{{client.Id}}"
     
    110113                    </div>
    111114                </div>
    112                 <input style="display:none"
     115                <input style="display:none;"
    113116                       type="text"
    114117                       id="groupid"
     
    163166                  class="row panel-heading"
    164167                  style="padding:10px;">
    165                 <table class="table" style="margin-bottom:0px">
     168                <table class="table" style="margin-bottom:0;">
    166169                    <tbody>
    167170                        <tr>
     
    186189                            <td>
    187190
    188                                 <input style="display:none" type="text" id="inpid" name="inpid" value="{{treeview.currentNode.Id}}" />
     191                                <input style="display:none;" type="text" id="inpid" name="inpid" value="{{treeview.currentNode.Id}}" />
    189192                                <input type="checkbox" ng-model="checkDel" /> I want to delete this group
    190193                            </td>
     
    225228                  class="row"
    226229                  style="padding:10px;">
    227                 <input style="display:none" type="text" id="inpid" name="inpid" value="{{treeview.currentNode.Id}}" />
    228 
    229                 <span style="padding:0px" class="col-sm-4">Change group: </span>
     230                <input style="display:none;" type="text" id="inpid" name="inpid" value="{{treeview.currentNode.Id}}" />
     231
     232                <span style="padding:0;" class="col-sm-4">Change group: </span>
    230233
    231234                <select class="form-control col-sm-5"
     
    258261                 ui-calendar="uiConfig.calendar"
    259262                 id="resourcecalendar"
    260                  style="font-size:medium"
     263                 style="font-size:medium;"
    261264                 class="span8 calendar"
    262265                 ng-model="currentcal.down"></div>
     
    304307                    <td>
    305308                        <input type="checkbox" class="checkbox" ng-model="currentcal.down[0][selectedEventId].rec.recurrence" ng-change="setChanged(selectedEventId)" />
    306                         <p ng-if="currentcal.down[0][selectedEventId].changed && currentcal.down[0][selectedEventId].rec.recurrence" style="color:darkred;font-weight:bold">
     309                        <p ng-if="currentcal.down[0][selectedEventId].changed && currentcal.down[0][selectedEventId].rec.recurrence" style="color:darkred; font-weight:bold;">
    307310                            The recurrence itself will be made during saving, settings can be changed here.
    308311                        </p>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Groups.cshtml

    r13805 r13827  
    156156                                <div class="form-group">
    157157                                    <label class="col-sm-3 control-label">
    158                                         Members
     158                                       @Model.SelectedGroupMembers.Count members
    159159                                    </label>
    160160                                    <div class="col-sm-8 control-label" >
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml

    r13805 r13827  
    221221                                <div class="form-group">
    222222                                    <label class="col-sm-3 control-label">
    223                                         Member of
     223                                        Member of @Model.SelectedUserSubscriptions.Count groups
    224224                                    </label>
    225225                                    <div class="col-sm-8 control-label" style="text-align:left">
     
    293293                                <div class="form-group">
    294294                                    <label class="col-sm-3 control-label">
    295                                         Roles
     295                                       @Model.SelectedUserRoles.Count Roles
    296296                                    </label>
    297297                                    <div class="col-sm-8 control-label" style="text-align:left">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Roles.cshtml

    r13805 r13827  
    157157                            <div class="form-group">
    158158                                <label class="col-sm-3 control-label">
    159                                     Users
     159                                   @Model.SelectedRoleEnrolled.Count Users
    160160                                </label>
    161161                                <div class="col-sm-8 control-label" style="text-align:left">
     
    189189                            </div>
    190190                            <div class="form-group">
    191                                 <div class="col-sm-offset-3 col-sm-3">
    192                                     <button type="submit"
    193                                             id="inpsaver"
    194                                             disabled
    195                                             class="btn btn-default"
    196                                             onclick="showSaver()">
    197                                         <i class="fa fa-save"></i> Save changes
    198                                     </button>
    199                                 </div>
    200                                 <div class="col-sm-5">
     191     
     192                                <div class="col-sm-3">
    201193                                    <a class="btn btn-danger pull-right"
    202194                                       asp-controller="User"
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/css/site.min.css

    r13805 r13827  
    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}/*!
     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}/*!
    22 * Bootstrap v3.3.6 (http://getbootstrap.com)
    33 * Copyright 2011-2015 Twitter, Inc.
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/calendarhubber.js

    r13805 r13827  
    1212               var hubber = $.connection.calendarHub;
    1313
    14                vm.alertMessage = "No alerts";
    15                vm.currentcal = [];
    16                $scope.permissionview = false;
    17                $scope.resaddview = false;
    18                vm.selectedEventId = -1;
    19                vm.groups = [];
    20                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
    2120               vm.init = function () {
    22 
    23                    //  $.connection.hub.logging = true;
    24 
    2521
    2622                   var v = document.getElementById("userId").innerHTML;
    2723                   $.connection.hub.qs = { 'userid': v };
     24                   //Connection string set to identify the unique session ID for the user
    2825                   $.connection.hub.start().done(function () {
    29                        hubber.server.requestInfo();
    30                    });
     26                       hubber.server.requestInfo();//initial data request
     27                   });
     28
     29                   //Process all initial data needed (heavy load)
    3130                   hubber.client.processData = function (data, users, groups) {
    3231                       vm.data = JSON.parse(data);
     
    3736                       $scope.$apply();
    3837                   };
     38
     39                   //Saving from current graph is done -> refresh it
    3940                   hubber.client.savingCurrentDone = function () {
    4041                       vm.calendarSaver = false;
     
    4243                       $scope.$apply();
    4344                   };
     45
     46                   //Saving all graphs done -> clear everything
    4447                   hubber.client.savingAllDone = function () {
    4548                       vm.calendarSaver = false;
     
    4750                       $scope.$apply();
    4851                   };
     52
     53                   //Dispose toggle refresh for current
    4954                   hubber.client.processDispose = function (disp) {
    5055                       vm.treeview.currentNode.IsDisposable = disp;
     
    5257                       $scope.$apply();
    5358                   }
     59
     60                   //Permissions refresh for specific resource
    5461                   hubber.client.processPermissions = function (id, perm) {
    5562                       var json = JSON.parse(perm);
     
    6067                       $scope.$apply();
    6168                   }
     69
     70                   //Process downtimes for a resource. Data conversion
    6271                   hubber.client.processDowntime = function (id, down) {
    6372                       var json = JSON.parse(down);
     
    99108                   }
    100109
     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
    101197                   $scope.$watch("treeview.currentNode", function (newValue, oldValue) {
    102198                       $scope.currentcal = [];
     
    105201                       $scope.selectedEventId = -1;
    106202                       
     203                       //Check if resource already has downtime data loaded
    107204                       if ($scope.treeview.currentNode != null && $scope.treeview.currentNode.Id != undefined) {
    108205                           if ($scope.treeview.currentNode.calendar.length === 0) {
     206                               //Reach out to server to receive resource data
    109207                               hubber.server.requestPermissions(vm.treeview.currentNode.Id);
    110208                               hubber.server.requestDownTime(vm.treeview.currentNode.Id);
     
    114212                               $timeout(function () {
    115213                                   refreshPermissions();
    116                                    
     214                                   //set previously loaded data
    117215                                   $scope.currentcal = $scope.treeview.currentNode.calendar;
    118216                               }, 0);
     
    124222                   });
    125223               }
     224
     225               //Resets the add resources menu
    126226               $scope.refreshAdds = function() {
    127227                   for (var i = 0; i < $scope.clients.length; i++) {
     
    133233                   }
    134234               }
     235
     236               //Resets the permissions menu
    135237               function refreshPermissions() {
    136238                   for (var i = 0; i < $scope.permUsers.length; i++){
     
    149251                   }
    150252               }
     253
     254               //Add resource group show by clearing the tree
    151255               $scope.clearTreeSelect = function () {
    152256                   if (vm.treeview.currentNode != undefined) {
     
    156260                   }
    157261               }
    158                $scope.buildTree = function () {
    159                    vm.tree = [];
    160                    vm.temptree = [];
    161                    vm.top = false;
    162                    var ungrouped = {
    163                        children: [],
    164                        Name: 'Ungrouped'
    165                    }
    166                    for (; vm.data.length > 0;) {
    167 
    168                        if (vm.data[0].ParentResourceId == null && vm.data[0].IsDisposable !== undefined) {
    169                            var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]);
    170                            vm.clients.push(curr);
    171                            ungrouped.children.push(curr);
    172                        }
    173                        else if (vm.data[0].ParentResourceId == null) {
    174                            var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]);
    175                            vm.groups.push(curr);
    176                            vm.tree.push(curr);
    177                        }
    178                        else {
    179                            var curr = $scope.seekChildren(vm.data.splice(0, 1)[0]);
    180                            if (curr.IsDisposable !== undefined)
    181                                vm.clients.push(curr);
    182                            else
    183                                vm.groups.push(curr);
    184                            vm.temptree.push(curr);
    185                        }
    186                    }
    187                    vm.tree.push(ungrouped);
    188 
    189                };
    190 
    191                $scope.seekChildren = function (current) {
    192                    current.calendar = [];
    193                    current.children = [];
    194                    current.todelete = [];
    195                    current.changes = false;
    196                    current.collapsed = true;
    197                    for (var t = 0; t < vm.temptree.length;) {
    198                        if (current.Id == vm.temptree[t].ParentResourceId) {
    199                            current.children.push(vm.temptree.splice(t, 1)[0]);
    200                        }
    201                        else {
    202                            t++;
    203                        }
    204                    }
    205                    var childc = current.children.length;//Remembers count of children received from temp tree;
    206                    for (var t = 0; t < vm.data.length;) {
    207                        if (current.Id == vm.data[t].ParentResourceId) {
    208                            if (vm.data[t].IsDisposable !== undefined)
    209                                vm.clients.push(vm.data[t]);
    210                            else
    211                                vm.groups.push(vm.data[t]);
    212                            current.children.push(vm.data.splice(t, 1)[0]);
    213                        }
    214                        else {
    215                            t++;
    216                        }
    217                    }
    218                    for (var t = childc; t < current.children.length; t++) {
    219                        current.children[t] = $scope.seekChildren(current.children[t]);
    220                    }
    221                    return current;
    222                }
     262
     263               //Reach out to server to toggle disposable for current calendar
    223264               $scope.toggleDisposable = function () {
    224265                   $scope.calendarDispose = true;
    225266                   hubber.server.toggleDisposable(vm.treeview.currentNode.Id);
    226267               }
     268
     269               //Pushes permissions to server
    227270               $scope.pushPermissions = function () {
    228271                   var perms = [];
     
    239282                   hubber.server.changePermissions(perms, node.Id);
    240283               }
     284
     285               //Collects all data from a single resource to save to the server
    241286               function collectInfoToSave(node, refresh, last) {
    242287                   var arr = node.calendar.down[0];
     
    246291                   for (var i = 0; i < arr.length; i++) {
    247292                       if (arr[i].id === '00000000-0000-0000-0000-000000000000') {
     293                           //NEW DOWNTIME
    248294                           var t = arr[i].allDay.toString();
    249295                           toadd.push([
     
    263309                       }
    264310                       else if (arr[i].changed === true) {
     311                           //EDIT EXISTING DOWNTIME
    265312                           var t = arr[i].allDay.toString();
    266313                           toupd.push([
     
    282329                   hubber.server.saveCalendar(node.Id, todel, toadd, toupd, refresh, last);
    283330               }
     331
     332               //Save current calendar
    284333               $scope.saveCurrentCalendar = function () {
    285334                   vm.calendarSaver = true;
    286                    collectInfoToSave(vm.treeview.currentNode, true, false);
     335                   collectInfoToSave(vm.treeview.currentNode, true, false);//true for refresh, false for save all
    287336                   //true for refresh, false for showing it's only one calendar saved.
    288337               }
     338
     339               //Save all changed calendars
    289340               $scope.saveAllCalendars = function () {
    290341
     
    302353                   }).then(function (success) {
    303354                       vm.calendarSaver = true;
     355
    304356                       for (var i = 0; i < $scope.allSave.length; i++) {
    305357                           if (i >= $scope.allSave.length - 1)
     
    312364
    313365               }
     366
     367               //Checks treeview for edits and builds new array containing these (recurse for children)
    314368               function createSaveRequests(node) {
    315369                   if (node.changes === true)
     
    319373                   }
    320374               }
     375
     376               //Clears and refreshes calendar for current resource (delete current changes)
    321377               $scope.clearCurrentCalendar = function () {
    322378
     
    332388
    333389               }
     390
     391               //Clears all calendars and refreshes current (Deletes all changes)
    334392               $scope.clearAllCalendars = function () {
    335393                   ngDialog.openConfirm({
     
    346404
    347405               }
     406
     407               //Function that clears all calendar (separate so dialog is not called when saveAll is finished)
    348408               function clearAllCalendarsFunc() {
    349409                   $(".ng-binding.changed").removeClass('changed');
     
    360420                   $(".selected.ng-scope").addClass('loaded');
    361421               }
     422
     423               //Recurse trough tree view
    362424               function clearCalendarsRecurse(node) {
    363425
     
    369431                   }
    370432               }
     433
     434               //Delete all downtimes from current resource
    371435               $scope.deleteAllEvents = function () {
    372436                   vm.calendarDeleter = true;
     
    386450                   });
    387451               }
     452
     453               //Delete all past events
    388454               $scope.deleteAllPreviousEvents = function () {
    389455                   vm.calendarDeleter = true;
     
    408474               }
    409475
    410 
     476               //Sets the status of a downtime AND the current resource to changed
    411477               $scope.setChanged = function (id) {
    412478                   if (id != -1) {
     
    421487                   $(".selected").addClass('changed');
    422488               }
    423                //*Add event by click
     489
     490               //Adds event by click on empty space
    424491               $scope.calendarClick = function (date, jsEvent, view) {
    425492
     
    431498                   end.setHours(dat.getHours() + 2);
    432499                   vm.treeview.currentNode.calendar.down[0].push({
    433                        id: '00000000-0000-0000-0000-000000000000',
     500                       id: '00000000-0000-0000-0000-000000000000',//Makes it recognizable as new for the server
    434501                       title: 'Unavailable',
    435502                       start: dat,
     
    453520
    454521               }
     522
     523               //Finds array index for specific _id
    455524               function checkId(id) {
    456525                   for (var i = 0; i < vm.treeview.currentNode.calendar.down[0].length ; i++) {
     
    460529                   return -1;
    461530               }
    462                /* alert on eventClick */
     531               //Set selected downtime
    463532               $scope.eventClick = function (date, jsEvent, view) {
    464533                   vm.selectedEventId = checkId(date._id);
    465534               };
     535               //Sets selected downtime by clicking on the button at bottom on the page, moves to date
    466536               $scope.eventClickBtn = function (id) {
    467537                   vm.selectedEventId = checkId(id);
    468538                   vm.goToDate();
    469539               };
    470                /* alert on Drop */
     540
     541               //Drag and drop downtime
    471542               $scope.dragandDrop = function (event, delta, revertFunc, jsEvent, ui, view) {
    472543                   vm.selectedEventId = checkId(event._id);
     
    487558                   vm.treeview.currentNode.calendar.down[0][vm.selectedEventId].end = new Date(event.end);
    488559               };
    489                /* alert on Resize */
     560               //Resize downtime
    490561               $scope.resizeEvent = function (event, delta, revertFunc, jsEvent, ui, view) {
    491562                   vm.selectedEventId = checkId(event._id);
     
    495566               };
    496567
    497                /* remove event */
     568               //Removes a downtime from client (existing downtime gets referenced in todelete
    498569               $scope.remove = function (index) {
    499570                   vm.selectedEventId = -1;
     
    506577
    507578               };
     579               //Remove trough list view at bottom
    508580               $scope.removeList = function (id) {
    509581                   var index = checkId(id);
     
    517589
    518590               };
    519 
     591               //Check if start is before end AND start is after now (recursion)
    520592               $scope.checkDateStartEnd = function () {
    521593                   if ($scope.currentcal.down[0][vm.selectedEventId].rec.start > $scope.currentcal.down[0][vm.selectedEventId].rec.end ||
     
    528600                       $scope.currentcal.down[0][vm.selectedEventId].rec.start = new Date();
    529601               }
    530                //pushes all changes to other recurs
     602               //pushes all changes to other existing recurs and creates new downtimes where needed
    531603               $scope.pushRecurChanges = function (recid) {
    532604                   ngDialog.openConfirm({
     
    539611                       plain: true
    540612                   }).then(function (success) {
     613
    541614                       var arr = vm.treeview.currentNode.calendar.down[0];
     615                       //Deep copy of downtime for referencing
    542616                       var ob = $.extend(true, {}, arr[vm.selectedEventId]);
    543                        for (var i = 0; i < arr.length;) {
     617
     618                       for (var i = 0; i < arr.length;) {//Go trough downtimes and find all recurrences
    544619                           if (arr[i].rec.recid === recid) {
    545620                               if (new Date(arr[i].start) < new Date(ob.rec.start) ||
    546621                                        new Date(arr[i].end) > new Date(ob.rec.end) ||
    547622                                        !ob.rec.days[new Date(arr[i].start).getDay()]) {
    548                                    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
    549626                                   vm.selectedEventId = -1;
    550627
    551628                               }
    552629                               else {
    553 
     630                                   //Edit downtime when it is within the bounds
    554631                                   arr[i].start.setHours(ob.start.getHours(), ob.start.getMinutes());
    555632                                   arr[i].end.setHours(ob.end.getHours(), ob.end.getMinutes());
     
    564641                               i++;
    565642                       }
     643                       //init for new downtimes.
    566644                       var start = new Date(ob.rec.start);
    567                        start.setHours(2, 0, 0, 0);
     645                       start.setHours(2, 0, 0, 0);//Beginning of the day + time conversion +02
    568646                       var end = new Date(ob.rec.end);
    569                        end = new Date(end.setHours(24, 0, 0, 0) + 1000 * 3600 * 2);
    570 
    571                        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
    572650                           for (var d = (start.getTime()) ; d < (end.getTime()) ;) {
    573651                               var tog = ob.rec.days[new Date(d).getDay()];
     652                               //Check if day of the week is included in recursion
    574653                               if (tog) {
    575                                    loop2:
     654                                   loop2://Loop checking existing downtime array to see if day is already filled or not
    576655                                       for (var i = 0; i < arr.length; i++) {
    577656
     
    580659                                               if (arr[i].start.getTime() >= d &&
    581660                                                   arr[i].end.getTime() <= dend) {
    582                                                    d += (1000 * 3600 * 24);
    583                                                    continue loop1;
     661                                                   d += (1000 * 3600 * 24);//add day to loop 1
     662                                                   continue loop1;//breaks out of loop2 and skips to next day
    584663                                               }
    585664                                           }
    586665                                       }
    587 
     666                                   //Made it here = new event needed: init
    588667                                   var ts = new Date(d);
    589668                                   ts.setHours(new Date(ob.start).getHours(), new Date(ob.start).getMinutes());
     
    602681                               }
    603682
    604                                d += (1000 * 3600 * 24);// 1 day
    605 
    606                            }
    607                    });
    608                }
     683                               d += (1000 * 3600 * 24);// adds one day
     684
     685                           }
     686                   });
     687               }
     688
     689               //Delete all bound recurrences
    609690               $scope.deleteAllRecurrences = function (recid) {
    610691                   ngDialog.openConfirm({
     
    627708               }
    628709
     710               //Moves calendar to selected date
    629711               $scope.goToDate = function () {
    630712                   $("#resourcecalendar").fullCalendar('gotoDate', vm.currentcal.down[0][vm.selectedEventId].start);
    631713               }
    632                /* Render Tooltip */
     714               /* Renders Tooltip */
    633715               $scope.eventRender = function (event, element, view) {
    634716                   element.attr({
     
    638720                   //$compile(element)($scope);
    639721               };
    640                /* config object */
     722               //Calendar configuration
    641723               $scope.uiConfig = {
    642724                   calendar: {
     
    663745               };
    664746
    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                }
     747               
    681748
    682749
    683750
    684751           }).filter('disp', function () {
    685                return function (input) {
     752               return function (input) {//Filter boolean to string
    686753                   return input ? 'Disposable' : 'Not disposable';
    687754               }
    688755           }).directive('animateOnChange', function ($timeout) {
    689                return function (scope, element, attr) {
     756               return function (scope, element, attr) {//Animation on downtime info to show change
    690757                   scope.$watch(attr.animateOnChange, function (nv, ov) {
    691758
     
    695762                               $timeout(function () {
    696763                                   element.removeClass('changed');
    697                                }, 250); // Could be enhanced to take duration as a parameter
     764                               }, 250);
    698765                           }
    699766                           else {
     
    701768                               $timeout(function () {
    702769                                   element.removeClass('changedshut');
    703                                }, 250); // Could be enhanced to take duration as a parameter
     770                               }, 250);
    704771                           }
    705772                       }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/progresshubber.js

    r13754 r13827  
    1 function addtoHive(){var a=document.getElementById("jname").value,b=document.getElementById("jresource").value;a&&""!=a&&null!=a?(hubber.server.changeNameResource(a,b),document.getElementById("fakehiveadd").style.display="none",document.getElementById("progdiv").style.display="",document.getElementById("result").style.display="",document.getElementById("realhiveadd").click()):alert("Job name not set!")}function toggleChild(a,b){console.log(a+" toggled"),hubber.server.toggleChild(a),"none"==$("#childs"+b).css("display")?$("#childs"+b).css("display",""):$("#childs"+b).css("display","none"),$("body").click()}function changePriority(a,b,c){switch(console.log(a+" to priority "+b),hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))}});
     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(console.log(a+" to priority "+b),hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}function paraEdit(a,b,c,d,e){hubber.server.paraEdit(a,b,c,d,e)}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))}});
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/userinfohubber.js

    r13805 r13827  
    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>")}});
     1function resetPass(a){hubber.server.resetPassword(a)}var hubber=$.connection.userInfoHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start(),hubber.client.showNewPass=function(a){$("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: "+a+". An email has been sent to the user containing the new password</label>")}});
Note: See TracChangeset for help on using the changeset viewer.