Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/16 16:55:18 (8 years ago)
Author:
jlodewyc
Message:

#2582 More parameter datatypes, splitting fileopening service, approving users, reopen last file, change name tasks and repetitions

Location:
branches/WebJobManager
Files:
9 added
30 edited

Legend:

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

    r13827 r13841  
    104104                //vm.selectedJob.RefreshAutomatically = true;
    105105                clientWeb.LoadJob(vm.selectedJob);
    106                 weblog.getFileOpener(userId).NewModel();
    107                 weblog.getFileOpener(userId).Job = vm.selectedJob;
     106                weblog.getJobOpener(userId).NewModel();
     107                weblog.getJobOpener(userId).Job = vm.selectedJob;
    108108                ViewBag.Title = vm.selectedJob.Job.Name + " - Jobs";
    109109                ViewBag.SessionId = HttpContext.Session.GetString("UserId");
     
    153153                ViewBag.Name = serviceClient.ClientCredentials.UserName.UserName;
    154154                ViewBag.Title = "Uploads";
     155                //Recently opened
     156                if (weblog.getFileOpener(userId).Job != null)
     157                    ViewBag.active = true;
    155158                return View("Uploads", upper);
    156159            }
     
    175178                else
    176179                    ViewBag.Title = "Add files - Uploads";
     180                //Recently opened
     181                if (weblog.getFileOpener(userId).Job != null)
     182                    ViewBag.active = true;
    177183                return View("Uploads", upper);
    178184            }
     
    236242                fillUploadsPaths(upper, index);
    237243                upper.message = message;
     244                //recently opened
     245                if (weblog.getFileOpener(userId).Job != null)
     246                    ViewBag.active = true;
    238247                ViewBag.Title = "File deleted - Uploads";
    239248
     
    289298        }
    290299        /// <summary>
     300        /// Opens the last opened file in the fileopening service
     301        /// </summary>
     302        /// <returns></returns>
     303        public IActionResult OpenRecent()
     304        {
     305            if (init())
     306            {
     307                var serve = weblog.getFileOpener(userId);
     308                ViewBag.JobsCount = serve.Job.Job.JobCount;
     309                ViewBag.Title = serve.vm.SelectedTask.ItemTask.Name + " - Uploads";
     310                ViewBag.SessionId = HttpContext.Session.GetString("UserId");
     311                return View("OpenFile", serve.vm);
     312            }
     313            else
     314            {
     315                return RedirectToAction("Index", "Home");
     316            }
     317        }
     318        /// <summary>
    291319        /// Adds current opened file to hive, uses FileOpeningService singleton
    292320        /// </summary>
     
    318346                return RedirectToAction("Uploads", "Job");
    319347            }
    320              else
     348            else
    321349            {
    322350                return RedirectToAction("Index", "Home");
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs

    r13827 r13841  
    192192            */
    193193        }
     194
     195        public IActionResult ApproveUser(string id)
     196        {
     197            if (init())
     198            {
     199                Guid curr = Guid.Parse(id);
     200
     201                UserViewModel vm = new UserViewModel(accessClient).refreshAll();
     202               
     203                    var us = vm.getUserById(curr);
     204                us.IsApproved = true;
     205                accessClient.updateUser(us);
     206                return RedirectToAction("SelectUser", new { id = id });
     207
     208            }
     209            else
     210            {
     211                return RedirectToAction("Index", "Home");
     212            }
     213        }
    194214        /// <summary>
    195215        /// Delete a user
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/JobUpdaterHub.cs

    r13739 r13841  
    3232            else {
    3333                userId = Guid.Parse(uid);
    34                 fileopener = weblog.getFileOpener(userId);
     34                fileopener = weblog.getJobOpener(userId);
    3535            }
    3636        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/ProgressHub.cs

    r13834 r13841  
    103103                }
    104104            }
     105            Clients.Caller.processMessage("Connection Established");
     106        }
     107        public void changeName(int[][] arr, string name, int idname)
     108        {
     109           
     110            if (name != "" && name != null)
     111            {
     112                loader();
     113
     114                HiveTask current = fileopener.Job.HiveTasks.ToList()[0];
     115                if (arr.Length == 0)
     116                {//check if upper job
     117                    current.ItemTask.Name = name;
     118
     119                }
     120                else
     121                {
     122                    for (var i = 0; i < arr.Length; i++)
     123                    {//loop for depth
     124                        if (i == arr.Length - 1)
     125                        {//Right depth reached, change name for current
     126                            if (current.ItemTask.Item is BatchRun)
     127                            {
     128                                current.ChildHiveTasks[arr[i][1]].ItemTask.Name = name;
     129                            }
     130                            else if (current.ItemTask.Item is Experiment)
     131                            {
     132                                current.ChildHiveTasks[arr[i][0]].ItemTask.Name = name;
     133                            }
     134
     135                        }
     136                        else
     137                        {//not deep enough, choose right path
     138                            if (current.ItemTask.Item is BatchRun)
     139                                current = current.ChildHiveTasks[arr[i][1]]; // select right batch
     140                            else if (current.ItemTask.Item is Experiment)
     141                                current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment
     142                        }
     143                    }
     144                }
     145                Clients.Caller.processName(name, idname);
     146            }
     147        }
     148        public void changeRepit(int[][] arr, int repit)
     149        {
     150            loader();
     151            HiveTask current = fileopener.Job.HiveTasks.ToList()[0];
     152            string Name = "failed";
     153            if (arr.Length == 0)
     154            {//check if upper job
     155                if (current.ItemTask.Item is BatchRun)
     156                {
     157                    var b = (BatchRun)current.ItemTask.Item;
     158                    b.Repetitions = repit;
     159                    Name = current.ItemTask.Name;
     160                }
     161
     162            }
     163            else
     164            {
     165                for (var i = 0; i < arr.Length; i++)
     166                {//loop for depth
     167                    if (i == arr.Length - 1)
     168                    {//Right depth reached, change name for current
     169                        if (current.ChildHiveTasks[arr[i][0]].ItemTask.Item is BatchRun)
     170                        {
     171                            var b = (BatchRun)current.ChildHiveTasks[arr[i][0]].ItemTask.Item;
     172                            b.Repetitions = repit;
     173                            Name = current.ChildHiveTasks[arr[i][0]].ItemTask.Name;
     174                        }
     175                    }
     176                    else
     177                    {//not deep enough, choose right path
     178                        if (current.ItemTask.Item is BatchRun)
     179                            current = current.ChildHiveTasks[arr[i][1]]; // select right batch
     180                        else if (current.ItemTask.Item is Experiment)
     181                            current = current.ChildHiveTasks[arr[i][0]]; // select right sub task from experiment
     182                    }
     183                }
     184            }
     185            Clients.Caller.processRepit(Name, repit);
     186
    105187        }
    106188        /// <summary>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/ProgressHubber.js

    r13834 r13841  
    2222        }
    2323    };
     24    hubber.client.processName = function (name, random) {
     25
     26            $("#nameCarrier" + random).html(name);
     27       
     28    };
     29    hubber.client.processRepit = function (name, repit) {
     30        if (name === "failed") {
     31            window.alert("Something went wrong while changing the repititions, please try again")
     32        }
     33        else
     34            window.alert("Repititions for " + name + " has been changed to " + repit + ". These changes are not shown in the interface but happen directly after uploading or saving.");
     35    }
    2436    hubber.client.dataNotSupported = function (name) {
    2537        window.alert("Parameter " + name + " could not be changed for it is a fixed parameter. All changes done in this view are not saved to Hive.");
     
    5668//Changes a tasks priority
    5769function changePriority(arr, prior, idprior) {
    58     console.log(arr + " to priority " + prior);
    5970    hubber.server.changePriority(arr, prior);
    6071    resetPrior(idprior);
     
    8394    document.getElementById("prior" + id).className = "btn dropdown-toggle ";
    8495}
    85 
    86 
     96//changes name of a task
     97function changeName(arr, name, idname) {
     98    hubber.server.changeName(arr, name, idname);
     99}
     100function changeRepit(arr, repit) {
     101    hubber.server.changeRepit(arr, repit);
     102}
    87103function paraEdit(arr, problem, name, type, value) {
    88104    hubber.server.paraEdit(arr, problem, name, type, value);
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Scripts/Hubs/UserInfoHubber.js

    r13805 r13841  
    88    $.connection.hub.start();
    99    hubber.client.showNewPass = function (pass) {
    10         $("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: " + pass + ". An email has been sent to the user containing the new password</label>");
     10        $("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: '" + pass + "'. An email has been sent to the user containing the new password</label>");
    1111                                     
    1212    };
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs

    r13805 r13841  
    1919        private List<HiveServiceLocatorWeb> locators;
    2020        private List<HiveClientWeb> webclients;
     21        private List<FileOpeningService> jobopeners;
    2122        private List<FileOpeningService> fileopeners;
    2223        private List<AccessAdministrationClient> accessclients;
     
    4647            locators = new List<HiveServiceLocatorWeb>();
    4748            webclients = new List<HiveClientWeb>();
     49            jobopeners = new List<FileOpeningService>();
    4850            fileopeners = new List<FileOpeningService>();
    4951            accessclients = new List<AccessAdministrationClient>();
     
    6971            var temp2 = new FileOpeningService(log.userId);
    7072            fileopeners.Add(temp2);
     73            temp2 = new FileOpeningService(log.userId);
     74            jobopeners.Add(temp2);
    7175            var temp3 = new AccessAdministrationClient(log.userId);
    7276            accessclients.Add(temp3);
     
    124128        }
    125129
     130        public FileOpeningService getJobOpener(Guid id)
     131        {
     132            return jobopeners.Find(x => x.UserId == id);
     133        }
    126134        /// <summary>
    127135        /// Returns the AccessAdministrationClient used for User/Group/Role management
     
    152160            locators.RemoveAll(x => x.UserId == id);
    153161            fileopeners.RemoveAll(x => x.UserId == id);
     162            jobopeners.RemoveAll(x => x.UserId == id);
    154163            accessclients.RemoveAll(x => x.userId == id);
    155164            adminclients.RemoveAll(x => x.userId == id);
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml

    r13834 r13841  
    4242        </a>
    4343    </div>
     44    @Html.Partial("OpenFilePartials/_Help", Model);
    4445    <!-- Check model to select right partial, partial handles all subloading -->
    4546    <div class="col-md-9">
     
    164165            </div>
    165166            <div class="col-sm-4">
    166                 <h4>Save to file</h4>
     167                <h3 style="text-align:center">Save to file</h3>
     168                <p style="text-align:center;font-style:italic">Changed parameters get saved but child distribution and task priority get lost in the process.</p>
    167169                <form asp-controller="Job"
    168170                   asp-action="saveToFile"
     
    200202    </div>
    201203    <!-- Side scrolling menu-->
    202     <nav style="margin-top:50px; "
     204    <nav
    203205         class="col-md-2" id="scrolly">
    204206        <ul class="nav nav-pills nav-stacked"
     
    238240                        $('html, body').animate({
    239241                            scrollTop: target.offset().top
    240                         }, 1000);
     242                        }, 700);
    241243                        return false;
    242244                    }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/DataPartials/DataMaster.cshtml

    r13834 r13841  
    1212                @Html.Partial("OpenFilePartials/DataPartials/Bool", Model);
    1313            }
     14            else if (Model.Data.ActualValue is BoolArray)
     15            {
     16                @Html.Partial("OpenFilePartials/DataPartials/BoolArray", Model);
     17            }
     18            else if (Model.Data.ActualValue is BoolMatrix)
     19            {
     20                @Html.Partial("OpenFilePartials/DataPartials/BoolMatrix", Model);
     21            }
    1422            else if (Model.Data.ActualValue is StringValue)
    1523            {
    1624                @Html.Partial("OpenFilePartials/DataPartials/String", Model);
     25            }
     26            else if (Model.Data.ActualValue is StringArray)
     27            {
     28                @Html.Partial("OpenFilePartials/DataPartials/StringArray", Model);
     29            }
     30            else if (Model.Data.ActualValue is StringMatrix)
     31            {
     32                @Html.Partial("OpenFilePartials/DataPartials/StringMatrix", Model);
    1733            }
    1834            else if (Model.Data.ActualValue is IntValue)
     
    2036                @Html.Partial("OpenFilePartials/DataPartials/Int", Model);
    2137            }
     38            else if (Model.Data.ActualValue is IntArray && !(Model.Data.ActualValue is HeuristicLab.Encodings.PermutationEncoding.Permutation))
     39            {
     40                @Html.Partial("OpenFilePartials/DataPartials/IntArray", Model);
     41            }
     42            else if (Model.Data.ActualValue is IntMatrix)
     43            {
     44                @Html.Partial("OpenFilePartials/DataPartials/IntMatrix", Model);
     45            }
    2246            else if (Model.Data.ActualValue is PercentValue)
    2347            {
    2448                @Html.Partial("OpenFilePartials/DataPartials/Percent", Model);
    2549            }
     50            else if (Model.Data.ActualValue is PercentArray)
     51            {
     52                @Html.Partial("OpenFilePartials/DataPartials/PercentArray", Model);
     53            }
     54            else if (Model.Data.ActualValue is PercentMatrix)
     55            {
     56                @Html.Partial("OpenFilePartials/DataPartials/PercentMatrix", Model);
     57            }
    2658            else if (Model.Data.ActualValue is DoubleValue)
    2759            {
    2860                @Html.Partial("OpenFilePartials/DataPartials/Double", Model);
    29             }
    30             else if (Model.Data.ActualValue is IntArray)
    31             {
    32                 @Html.Partial("OpenFilePartials/DataPartials/IntArray", Model);
    3361            }
    3462            else if (Model.Data.ActualValue is DoubleArray)
     
    4270            else if (Model.Data.ActualValue is IItem)
    4371            {
    44                 @Html.Partial("OpenFilePartials/DataPartials/Others", Model);
     72                @Html.Partial("OpenFilePartials/DataPartials/OthersClean", Model);//just Others to print the datatype too
    4573                }
    4674        }
    4775        catch(NotSupportedException e)
    4876        {
    49             @Html.Partial("OpenFilePartials/DataPartials/Others", Model)
     77            @Html.Partial("OpenFilePartials/DataPartials/OthersClean", Model)
    5078
    5179        }
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/DataPartials/DoubleMatrix.cshtml

    r13834 r13841  
    1010        {
    1111            s += "[ ";
    12             s += dat[d,0] + "; " + dat[d,1];
     12            for (var i = 0; i < dat.Columns; i++)
     13            {
     14                s += dat[d, i];
     15                if (i < dat.Columns - 1)
     16                {
     17                    s += "; ";
     18                }
     19
     20            }
    1321            s += " ] " + Environment.NewLine;
    1422
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Algorithm.cshtml

    r13827 r13841  
    1313    <div class="row" style="text-align:center">
    1414        <h1>
    15             <span class="label label-primary">Algorithm: @Model.SelectedTask.ItemTask.Name</span>
     15            <span class="label label-primary">Algorithm:<span id="nameCarrier@(randy)">@Model.SelectedTask.ItemTask.Name</span></span>
    1616        </h1>
    17 
     17        <p>
     18            <input type="text"
     19                   style="width:50%;display:initial; background-color:transparent;text-align:center"
     20                   onchange="changeName([],this.value,@randy)"
     21                   value="@Model.SelectedTask.ItemTask.Name" />
     22        </p>
    1823    </div>
    1924
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_AlgorithmSmall.cshtml

    r13827 r13841  
    1212<p class="text-center">
    1313    <a class="btn btn-primary"
     14       id="nameCarrier@(randomal)"
    1415       data-toggle="collapse"
    1516       href="#collapseExample@(randomal)"
     
    3334        text-shadow:none">
    3435        <div class="panel-heading panel-primary text-center">
     36            <p>
     37                <input type="text"
     38                       class="form-control"
     39                       style="width:50%;display:initial; background-color:transparent; color:white;text-align:center"
     40                       onchange="changeName(@builder,this.value,@randomal)"
     41                       value="@Model.algo.Name" />
     42            </p>
    3543            <p>@Model.algo.Description</p>
    3644
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml

    r13827 r13841  
    1111    <div class="row"
    1212         style="text-align:center">
    13         <h1
    14             >
     13        <h1>
    1514            <span class="label label-warning "
    1615                  style="text-shadow:2px 2px black;">
    17                 Batch: @Model.SelectedBatchRun.Name
     16                Batch: <span id="nameCarrier@(randy)">@Model.SelectedBatchRun.Name</span>
    1817            </span>
     18
    1919        </h1>
     20        <input type="text"
     21               class="form-control"
     22               style="width:50%;display:initial; background-color:transparent;text-align:center"
     23               onchange="changeName([],this.value,@randy)"
     24               value="@Model.SelectedTask.ItemTask.Name" />
    2025    </div>
    2126    <h4 id="tasks">
    22         Repeats: @Model.SelectedBatchRun.Repetitions x
     27        Repeats:
     28        <input type="number"
     29               class="form-control"
     30               style="width:80px;display:initial"
     31               min="1"
     32               value="@Model.SelectedBatchRun.Repetitions"
     33               onchange="changeRepit([],this.value,@randy)" />
     34          x
    2335
    2436    </h4>
     
    3042               data-onstyle="warning"
    3143               onchange="toggleChild([], @randy)" />
    32        
     44
    3345    </p>
    3446    <div id="childs@(randy)">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml

    r13827 r13841  
    1313<p class="text-center">
    1414    <a class="btn btn-warning"
     15       id="nameCarrier@(randombr)"
    1516       data-toggle="collapse"
    1617       href="#collapseExample@(randombr)"
     
    3637            text-shadow:2px 2px black">
    3738        <div class="panel-heading  text-center">
     39            <p>
     40                <input type="text"
     41                       class="form-control"
     42                       style="width:50%;display:initial; background-color:transparent;text-align:center;color:white"
     43                       onchange="changeName(@builder,this.value,@randombr)"
     44                       value="@Model.batch.Name" />
     45            </p>
    3846            <p class="panel-title">
    39                 Repeats @Model.batch.Repetitions X
     47                Repeats:
     48                <input type="number"
     49                       class="form-control"
     50                       style="width:80px;display:initial; margin-bottom:5px"
     51                       min="1"
     52                       value="@Model.batch.Repetitions"
     53                       onchange="changeRepit(@builder,this.value,@randombr)" />
     54                x
    4055            </p>
    4156            <p>
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml

    r13827 r13841  
    1212            >
    1313            <span class="label label-danger"
    14                   style="text-shadow:2px 2px black;">
    15                 Experiment: @Model.SelectedTask.ItemTask.Name
     14                  style="text-shadow:2px 2px black;">Experiment:
     15                <span id="nameCarrier@(randy)">
     16                     @Model.SelectedTask.ItemTask.Name
     17                </span>
    1618            </span>
    1719        </h1>
    18 
     20        <p>
     21            <input type="text"
     22                   style="width:50%;display:initial; background-color:transparent;text-align:center"
     23                   onchange="changeName([],this.value,@randy)"
     24                   value="@Model.SelectedTask.ItemTask.Name" />
     25        </p>
    1926    </div>
    2027    <h4 id="tasks">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml

    r13827 r13841  
    1414       href="#collapseExample@(randomex)"
    1515       aria-expanded="false"
     16       id="nameCarrier@(randomex)"
    1617       aria-controls="collapseExample@(randomex)"
    1718       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);
     
    3435
    3536        <div class="panel-heading panel-danger text-center">
     37            <p>
     38                <input type="text"
     39                       class="form-control"
     40                       style="width:50%;display:initial; background-color:transparent; color:white;text-align:center"
     41                       onchange="changeName(@builder,this.value,@randomex)"
     42                       value="@Model.exp.Name" />
     43            </p>
    3644            <p class="panel-title">
    3745                Children: @Model.exp.Optimizers.Count
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml

    r13827 r13841  
    8080                    }
    8181                </div>
     82                @if (ViewBag.active != null && ViewBag.active == true)
     83                {
     84                    <div>
     85                        <a class="btn btn-warning btn-block"
     86                           asp-controller="Job"
     87                           asp-action="OpenRecent"
     88                           style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     89                            text-shadow:2px 2px black;margin-top:10px">
     90                            <i class="fa fa-undo"></i> Reopen last file
     91                        </a>
     92                    </div>
     93
     94                }
     95               
    8296            </div>
    8397            <p style="display:none"
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml

    r13827 r13841  
    6868                </div>
    6969                <div class="btn-group-vertical btn-block">
    70                    
    71                    
     70
     71
    7272                    @foreach (var user in Model.users)
    7373                    {
     
    111111                        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
    112112                    <div class="row">
    113                         <h2 style="padding-left:20px">
     113                        @if (Model.SelectedUser.Id != Guid.Empty && Model.SelectedUser.IsApproved)
     114                        {<div class="row" style="margin-right:20px">
     115                            <a class="btn btn-success pull-right disabled"><i class="fa fa-check-square-o "></i> Approved</a>
     116                        </div>
     117                        }
     118                        else if (Model.SelectedUser.Id != Guid.Empty && !Model.SelectedUser.IsApproved)
     119                        {<div class="row" style="margin-right:20px">
     120                            <a class="btn btn-warning pull-right"
     121                               asp-action="approveUser"
     122                               asp-controller="User"
     123                               asp-route-id="@Model.SelectedUser.Id">
     124                                <i class="fa fa-square-o" ></i> Not approved
     125                            </a>
     126                           
     127                        </div>
     128                        }
     129                        <h2 style="padding-left:20px; margin-top:0">
    114130                            @if (Model.SelectedUser.Id != Guid.Empty)
    115131                            {
    116                                 <i class="fa fa-user "></i> @Model.SelectedUser.UserName;
     132                                <i class="fa fa-user "></i> @Model.SelectedUser.UserName
     133
    117134                            }
    118135                            else
     
    122139                            }
    123140                        </h2>
     141                       
    124142                        <form class="form-horizontal"
    125143                              method="post"
     
    189207
    190208                                </div>
    191                                 <div class="form-group">
    192                                     <label class="col-sm-3 control-label">
    193                                         User created
    194                                     </label>
    195                                     <label class="col-sm-8 control-label" style="text-align:left">
    196                                         @Model.SelectedUser.CreationDate.AddHours(2).ToString();
    197                                     </label>
    198                                 </div>
    199                                 <div class="form-group">
    200                                     <label class="col-sm-3 control-label">
    201                                         Last activity
    202                                     </label>
    203                                     <label class="col-sm-8 control-label" style="text-align:left">
    204                                         @Model.SelectedUser.LastActivityDate.AddHours(2).ToString()
    205                                     </label>
    206                                 </div>
    207                                 <div class="form-group">
    208                                     <label class="col-sm-3 control-label">
    209                                         Password
    210                                     </label>
    211                                     <div id="inppassreset" class="col-sm-8">
    212                                         Last change: @Model.SelectedUser.LastPasswordChangedDate.ToShortDateString()
    213                                         <button type="button"
    214                                                 onclick="resetPass('@(Model.SelectedUser.Id)')"
    215                                                 class="btn btn-default">
    216                                             <i class="fa fa-unlock"></i> Reset password
    217                                         </button>
    218                                     </div>
    219                                 </div>
    220 
    221                                 <div class="form-group">
    222                                     <label class="col-sm-3 control-label">
    223                                         Member of @Model.SelectedUserSubscriptions.Count groups
    224                                     </label>
    225                                     <div class="col-sm-8 control-label" style="text-align:left">
    226                                         @if (Model.SelectedUserSubscriptions.Count > 0)
    227                                         {
    228                                             @foreach (var g in Model.SelectedUserSubscriptions)
     209                                    <div class="form-group">
     210                                        <label class="col-sm-3 control-label">
     211                                            User created
     212                                        </label>
     213                                        <label class="col-sm-8 control-label" style="text-align:left">
     214                                            @Model.SelectedUser.CreationDate.AddHours(2).ToString();
     215                                        </label>
     216                                    </div>
     217                                    <div class="form-group">
     218                                        <label class="col-sm-3 control-label">
     219                                            Last activity
     220                                        </label>
     221                                        <label class="col-sm-8 control-label" style="text-align:left">
     222                                            @Model.SelectedUser.LastActivityDate.AddHours(2).ToString()
     223                                        </label>
     224                                    </div>
     225                                    <div class="form-group">
     226                                        <label class="col-sm-3 control-label">
     227                                            Password
     228                                        </label>
     229                                        <div id="inppassreset" class="col-sm-8">
     230                                            Last change: @Model.SelectedUser.LastPasswordChangedDate.ToShortDateString()
     231                                            <button type="button"
     232                                                    onclick="resetPass('@(Model.SelectedUser.Id)')"
     233                                                    class="btn btn-default">
     234                                                <i class="fa fa-unlock"></i> Reset password
     235                                            </button>
     236                                        </div>
     237                                    </div>
     238
     239                                    <div class="form-group">
     240                                        <label class="col-sm-3 control-label">
     241                                            Member of @Model.SelectedUserSubscriptions.Count groups
     242                                        </label>
     243                                        <div class="col-sm-8 control-label" style="text-align:left">
     244                                            @if (Model.SelectedUserSubscriptions.Count > 0)
    229245                                            {
    230                                                 <div class="row">
    231                                                     <p class="col-sm-10"><i class="fa fa-group"></i> @g.Name</p>
    232                                                     <p class="col-sm-2">
    233                                                         <a class="btn btn-danger pull-right"
    234                                                            asp-controller="User"
    235                                                            asp-action="deleteUserGroup"
    236                                                            asp-route-id="@Model.SelectedUser.Id"
    237                                                            asp-route-group="@g.Id"
    238                                                            onclick="showDeleter()">
    239                                                             <i class="fa fa-trash-o"></i>
    240                                                         </a>
    241                                                     </p>
    242                                                 </div>
     246                                                @foreach (var g in Model.SelectedUserSubscriptions)
     247                                                {
     248                                                    <div class="row">
     249                                                        <p class="col-sm-10"><i class="fa fa-group"></i> @g.Name</p>
     250                                                        <p class="col-sm-2">
     251                                                            <a class="btn btn-danger pull-right"
     252                                                               asp-controller="User"
     253                                                               asp-action="deleteUserGroup"
     254                                                               asp-route-id="@Model.SelectedUser.Id"
     255                                                               asp-route-group="@g.Id"
     256                                                               onclick="showDeleter()">
     257                                                                <i class="fa fa-trash-o"></i>
     258                                                            </a>
     259                                                        </p>
     260                                                    </div>
     261                                                }
    243262                                            }
    244                                         }
    245                                         else
    246                                         {
    247                                             <p>Not a member of any groups</p>
    248                                         }
    249                                     </div>
    250                                 </div>
     263                                            else
     264                                            {
     265                                                <p>Not a member of any groups</p>
     266                                            }
     267                                        </div>
     268                                    </div>
    251269                            }
    252270
     
    293311                                <div class="form-group">
    294312                                    <label class="col-sm-3 control-label">
    295                                        @Model.SelectedUserRoles.Count Roles
     313                                        @Model.SelectedUserRoles.Count Roles
    296314                                    </label>
    297315                                    <div class="col-sm-8 control-label" style="text-align:left">
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/progresshubber.js

    r13834 r13841  
    1 function addtoHive(){var a=document.getElementById("jname").value,b=document.getElementById("jresource").value;a&&""!=a&&null!=a?(hubber.server.changeNameResource(a,b),document.getElementById("fakehiveadd").style.display="none",document.getElementById("progdiv").style.display="",document.getElementById("result").style.display="",document.getElementById("realhiveadd").click()):alert("Job name not set!")}function toggleChild(a,b){console.log(a+" toggled"),hubber.server.toggleChild(a),"none"==$("#childs"+b).css("display")?$("#childs"+b).css("display",""):$("#childs"+b).css("display","none"),$("body").click()}function changePriority(a,b,c){switch(console.log(a+" to priority "+b),hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}function paraEdit(a,b,c,d,e){hubber.server.paraEdit(a,b,c,d,e)}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))},hubber.client.dataNotSupported=function(a){window.alert("Parameter "+a+" could not be changed for it is a fixed parameter. All changes done in this view are not saved to the server.")},hubber.client.formatWrong=function(a,b){window.alert("Parameter "+a+" could not be changed, the format for "+b+" was wrong. Make sure you follow the example exactly. No changes made on the server")}});
     1function addtoHive(){var a=document.getElementById("jname").value,b=document.getElementById("jresource").value;a&&""!=a&&null!=a?(hubber.server.changeNameResource(a,b),document.getElementById("fakehiveadd").style.display="none",document.getElementById("progdiv").style.display="",document.getElementById("result").style.display="",document.getElementById("realhiveadd").click()):alert("Job name not set!")}function toggleChild(a,b){console.log(a+" toggled"),hubber.server.toggleChild(a),"none"==$("#childs"+b).css("display")?$("#childs"+b).css("display",""):$("#childs"+b).css("display","none"),$("body").click()}function changePriority(a,b,c){switch(hubber.server.changePriority(a,b),resetPrior(c),b){case 0:document.getElementById("prior"+c).className+="btn-default",document.getElementById("prior"+c).innerHTML="Low";break;case 1:document.getElementById("prior"+c).className+="btn-info",document.getElementById("prior"+c).innerHTML="Normal";break;case 2:document.getElementById("prior"+c).className+="btn-warning",document.getElementById("prior"+c).innerHTML="Urgent";break;case 3:document.getElementById("prior"+c).className+="btn-danger",document.getElementById("prior"+c).innerHTML="Critical"}document.getElementById("prior"+c).innerHTML+="<span class='caret'></span>"}function resetPrior(a){document.getElementById("prior"+a).className="btn dropdown-toggle "}function changeName(a,b,c){hubber.server.changeName(a,b,c)}function changeRepit(a,b){hubber.server.changeRepit(a,b)}function paraEdit(a,b,c,d,e){hubber.server.paraEdit(a,b,c,d,e)}var hubber=$.connection.progressHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start().done(function(){$("#progress").css("width","0%"),$("#progress").attr("aria-valuenow",0),hubber.server.handleMessage("Looking for connection...")}),hubber.client.processMessage=function(a,b){b>$("#progress").attr("aria-valuenow")&&($("#progress").css("width",b+"%"),$("#progress").attr("aria-valuenow",b),$("#progress").html(b+"%"),$("#result").html(a))},hubber.client.processName=function(a,b){$("#nameCarrier"+b).html(a)},hubber.client.processRepit=function(a,b){"failed"===a?window.alert("Something went wrong while changing the repititions, please try again"):window.alert("Repititions for "+a+" has been changed to "+b+". These changes are not shown in the interface but happen directly after uploading or saving.")},hubber.client.dataNotSupported=function(a){window.alert("Parameter "+a+" could not be changed for it is a fixed parameter. All changes done in this view are not saved to Hive.")},hubber.client.formatWrong=function(a,b){window.alert("Parameter "+a+" could not be changed, the format for "+b+" was wrong. Make sure you follow the example exactly. No changes made on Hive")}});
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/hubs/userinfohubber.js

    r13827 r13841  
    1 function resetPass(a){hubber.server.resetPassword(a)}var hubber=$.connection.userInfoHub;$(function(){var a=document.getElementById("userId").innerHTML;console.log(a),$.connection.hub.qs={userid:a},$.connection.hub.start(),hubber.client.showNewPass=function(a){$("#inppassreset").html("<label class=' control-label' style='text-align:left'>New pass: "+a+". An email has been sent to the user containing the new password</label>")}});
     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>")}});
  • branches/WebJobManager/HeuristicLab.Data/3.3/BoolArray.cs

    r12012 r13841  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using System.Linq;
    2627
    2728namespace HeuristicLab.Data {
     
    4142      return new BoolArray(this, cloner);
    4243    }
    43 
    44     protected virtual bool Validate(string value, out string errorMessage) {
     44        public static BoolArray Parse(string val)
     45        {
     46            try
     47            {
     48                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     49                bool[] a = arr.Where(s => s != "").ToList().ConvertAll(s => bool.Parse(s)).ToArray();
     50                return new BoolArray(a);
     51            }
     52            catch (System.FormatException e)
     53            {
     54                return null;
     55            }
     56        }
     57        protected virtual bool Validate(string value, out string errorMessage) {
    4558      bool val;
    4659      bool valid = bool.TryParse(value, out val);
  • branches/WebJobManager/HeuristicLab.Data/3.3/BoolMatrix.cs

    r12012 r13841  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using System.Linq;
    2728
    2829namespace HeuristicLab.Data {
     
    4647      return new BoolMatrix(this, cloner);
    4748    }
     49        public static BoolMatrix Parse(string val)
     50        {
     51            try
     52            {
     53                val = val.Replace("]", string.Empty);
    4854
    49     protected virtual bool Validate(string value, out string errorMessage) {
     55                string[] parts = val.Split('[');
     56                var r = parts.Length;
     57                var c = parts[1].Split(';').Length;
     58                val = val.Replace("\n", ";");
     59                val = val.Replace("[", string.Empty);
     60                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     61                bool[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (bool.Parse(s))).ToArray();
     62                bool[,] b = new bool[r, c];
     63                var rowcount = 0;
     64                for (int i = 0; i < a.Length;)
     65                {
     66                    for (int j = 0; j < c; j++)
     67                    {
     68                        b[rowcount, j] = a[i];
     69                        i++;
     70                    }
     71                    rowcount++;
     72                }
     73                return new BoolMatrix(b);
     74            }
     75            catch (System.FormatException e)
     76            {
     77                return null;
     78            }
     79        }
     80        protected virtual bool Validate(string value, out string errorMessage) {
    5081      bool val;
    5182      bool valid = bool.TryParse(value, out val);
  • branches/WebJobManager/HeuristicLab.Data/3.3/DoubleArray.cs

    r12432 r13841  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using System;
     27using System.Linq;
    2628
    2729namespace HeuristicLab.Data {
     
    4143      return new DoubleArray(this, cloner);
    4244    }
     45        public static DoubleArray Parse(string val)
     46        {
     47            try
     48            {
     49                string[] arr = Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     50                double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => double.Parse(s)).ToArray();
     51                return new DoubleArray(a);
     52            }
     53            catch (FormatException e)
     54            {
     55                return null;
     56            }
     57        }
    4358
    44     protected virtual bool Validate(string value, out string errorMessage) {
     59        protected virtual bool Validate(string value, out string errorMessage) {
    4560      double val;
    4661      bool valid = double.TryParse(value, out val);
  • branches/WebJobManager/HeuristicLab.Data/3.3/DoubleMatrix.cs

    r12432 r13841  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using System.Linq;
    2728
    2829namespace HeuristicLab.Data {
     
    4647      return new DoubleMatrix(this, cloner);
    4748    }
     49        public static DoubleMatrix Parse(string val)
     50        {
     51            try
     52            {
     53               
     54                val = val.Replace("]", string.Empty);
     55               
     56                string[] parts = val.Split('[');
     57                var r = parts.Length;
     58                var c = parts[1].Split(';').Length;
     59                val = val.Replace("\n", ";");
     60                val = val.Replace("[", string.Empty);
     61                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     62                double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => double.Parse(s)).ToArray();
     63                double[,] b = new double[r,c];
     64                var rowcount = 0;
     65                for(int i = 0; i < a.Length;)
     66                {
     67                    for(int j = 0; j < c; j++)
     68                    {
     69                        b[rowcount, j] = a[i];
     70                        i++;
     71                    }
     72                    rowcount++;
     73                }
     74                return new DoubleMatrix(b);
     75            }
     76            catch (System.FormatException e)
     77            {
     78                return null;
     79            }
     80        }
    4881
    49     protected virtual bool Validate(string value, out string errorMessage) {
     82        protected virtual bool Validate(string value, out string errorMessage) {
    5083      double val;
    5184      bool valid = double.TryParse(value, out val);
  • branches/WebJobManager/HeuristicLab.Data/3.3/IntMatrix.cs

    r12012 r13841  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using System.Linq;
    2728
    2829namespace HeuristicLab.Data {
     
    4647      return new IntMatrix(this, cloner);
    4748    }
     49        public static IntMatrix Parse(string val)
     50        {
     51            try
     52            {
     53                val = val.Replace("]", string.Empty);
    4854
    49     protected virtual bool Validate(string value, out string errorMessage) {
     55                string[] parts = val.Split('[');
     56                var r = parts.Length;
     57                var c = parts[1].Split(';').Length;
     58                val = val.Replace("\n", ";");
     59                val = val.Replace("[", string.Empty);
     60                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     61                int[] a = arr.Where(s => s != "").ToList().ConvertAll(s => int.Parse(s)).ToArray();
     62                int[,] b = new int[r, c];
     63                var rowcount = 0;
     64                for (int i = 0; i < a.Length;)
     65                {
     66                    for (int j = 0; j < c; j++)
     67                    {
     68                        b[rowcount, j] = a[i];
     69                        i++;
     70                    }
     71                    rowcount++;
     72                }
     73                return new IntMatrix(b);
     74            }
     75            catch (System.FormatException e)
     76            {
     77                return null;
     78            }
     79        }
     80        protected virtual bool Validate(string value, out string errorMessage) {
    5081      int val;
    5182      bool valid = int.TryParse(value, out val);
  • branches/WebJobManager/HeuristicLab.Data/3.3/PercentArray.cs

    r12012 r13841  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using System.Linq;
    2627
    2728namespace HeuristicLab.Data {
     
    4142      return new PercentArray(this, cloner);
    4243    }
    43 
    44     public override string ToString() {
     44       
     45        public static PercentArray Parse(string val)
     46        {
     47            try
     48            {
     49                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     50                double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (double.Parse(s)/100)).ToArray();
     51                return new PercentArray(a);
     52            }
     53            catch (System.FormatException e)
     54            {
     55                return null;
     56            }
     57        }
     58        public override string ToString() {
    4559      StringBuilder sb = new StringBuilder();
    4660      sb.Append("[");
  • branches/WebJobManager/HeuristicLab.Data/3.3/PercentMatrix.cs

    r12012 r13841  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using System.Linq;
    2728
    2829namespace HeuristicLab.Data {
     
    4647      return new PercentMatrix(this, cloner);
    4748    }
     49        public static PercentMatrix Parse(string val)
     50        {
     51            try
     52            {
     53                val = val.Replace("]", string.Empty);
    4854
    49     public override string ToString() {
     55                string[] parts = val.Split('[');
     56                var r = parts.Length;
     57                var c = parts[1].Split(';').Length;
     58                val = val.Replace("\n", ";");
     59                val = val.Replace("[", string.Empty);
     60                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     61                double[] a = arr.Where(s => s != "").ToList().ConvertAll(s => (double.Parse(s)/100)).ToArray();
     62                double[,] b = new double[r, c];
     63                var rowcount = 0;
     64                for (int i = 0; i < a.Length;)
     65                {
     66                    for (int j = 0; j < c; j++)
     67                    {
     68                        b[rowcount, j] = a[i];
     69                        i++;
     70                    }
     71                    rowcount++;
     72                }
     73                return new PercentMatrix(b);
     74            }
     75            catch (System.FormatException e)
     76            {
     77                return null;
     78            }
     79        }
     80        public override string ToString() {
    5081      StringBuilder sb = new StringBuilder();
    5182      sb.Append("[");
  • branches/WebJobManager/HeuristicLab.Data/3.3/StringArray.cs

    r13656 r13841  
    7777      }
    7878    }
    79     public virtual string this[int index]
     79        public static StringArray Parse(string val)
     80        {
     81            try
     82            {
     83                string[] arr = Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     84                return new StringArray(arr);
     85            }
     86            catch (FormatException e)
     87            {
     88                return null;
     89            }
     90        }
     91        public virtual string this[int index]
    8092    {
    8193      get { return array[index]; }
  • branches/WebJobManager/HeuristicLab.Data/3.3/StringMatrix.cs

    r13656 r13841  
    9292      }
    9393    }
    94 
    95     public virtual int Rows
     94        public static StringMatrix Parse(string val)
     95        {
     96            try
     97            {
     98                val = val.Replace("]", string.Empty);
     99
     100                string[] parts = val.Split('[');
     101                var r = parts.Length;
     102                var c = parts[1].Split(';').Length;
     103                val = val.Replace("\n", ";");
     104                val = val.Replace("[", string.Empty);
     105                string[] arr = System.Array.ConvertAll(val.Trim().Split(';'), p => p.Trim());
     106                string[] a = arr.Where(s => s != "").ToArray();
     107                string[,] b = new string[r, c];
     108                var rowcount = 0;
     109                for (int i = 0; i < a.Length;)
     110                {
     111                    for (int j = 0; j < c; j++)
     112                    {
     113                        b[rowcount, j] = a[i];
     114                        i++;
     115                    }
     116                    rowcount++;
     117                }
     118                return new StringMatrix(b);
     119            }
     120            catch (System.FormatException e)
     121            {
     122                return null;
     123            }
     124        }
     125        public virtual int Rows
    96126    {
    97127      get { return matrix.GetLength(0); }
Note: See TracChangeset for help on using the changeset viewer.