Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml @ 13847

Last change on this file since 13847 was 13847, checked in by jlodewyc, 8 years ago

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

File size: 8.8 KB
Line 
1@using HeuristicLab.Clients.Hive.WebJobManager.ViewModels
2@model JobViewModel
3
4<!-- Displays the job manager overview -->
5
6<div id="userId" style="display:none">@ViewBag.SessionId</div>
7<div>
8    <!-- Main nav menu-->
9    @Html.Partial("Navbar", new NavbarViewModel("Job", Model.currentUser))
10
11    <!-- Job menu-->
12    <ul class="nav nav-pills nav-justified">
13        <li role="presentation"
14            class="active">
15            <a asp-controller="Job"
16               asp-action="Index">
17                <i class="fa fa-tasks"></i> Jobs
18            </a>
19        </li>
20        <li role="presentation"
21            class="">
22            <a asp-controller="Job"
23               asp-action="Uploads">
24                <i class="fa fa-cloud"></i>  Uploads
25            </a>
26        </li>
27    </ul>
28
29    @Html.Partial("_ErrorMessage", Model.message)
30
31    <div class="row"
32         style="padding:10px; margin-right:0px!important">
33        @if (Model.userJobs.Count == 0)
34            {
35            <div>
36                <p style="text-align:center">
37                    No jobs found
38                </p>
39            </div>
40
41        }
42        else
43        {<!-- Display side menu containing jobs. -->
44            <div class="col-sm-4">
45                <div class="btn-group-vertical btn-block">
46                    <a class="btn btn-info btn-lg btn-block disabled"
47                       style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
48                            text-shadow:2px 2px black;">
49                        <i class="fa fa-cog"></i> Hive jobs
50                    </a>
51                    @foreach (var job in Model.userJobs.OrderBy(x => x.Job.DateCreated))
52                {
53                        <a class="btn btn-default
54                           @(Model.selectedJob != null && job.Id == Model.selectedJob.Id ? "active" : "" )
55                           "
56                           asp-controller="Job"
57                           asp-action="Selected"
58                           asp-route-id="@job.Id"
59                           style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
60                                text-align:left;"
61                           onclick="showLoader()">
62                            @job.Job.Name - @job.Job.DateCreated
63                            <span style="text-shadow:2px 2px black; font-size:13px"
64                                  class="label
65                                   @(job.Job.FinishedCount == @job.Job.JobCount ? "label-success" : "label-default")
66                                   label-as-badge pull-right">
67                                <strong>@job.Job.FinishedCount / @job.Job.JobCount</strong>
68                            </span>
69                        </a>
70                    }
71
72                </div>
73            </div>
74            <p style="display:none" id="loader" class="text-center">
75                <br /><br /><br /><br /><br /><br /><br />
76                <i class="fa fa-cog fa-spin fa-5x" id="spinner">
77                </i>
78            </p>
79
80            <div class="col-sm-8"
81                 id="content"
82                 style="padding:5px; padding-left:10px;">
83                @if (Model.selectedJob != null)
84                { <!-- A job has been selected by the user, load info into view -->
85                    <div class="panel panel-default"
86                         style="border-width:2px!important;padding:17px;
87                        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
88                        <div class="row">
89                            <h2 style="padding-left:20px">
90                                <!-- Header of the job (title and delete button) -->
91                                @Model.selectedJob.Job.Name
92                                <a onclick="popUpDelete()"
93                                   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);
94                                    text-shadow:2px 2px black;"
95                                   class='btn btn-danger'>
96                                    <span class="glyphicon glyphicon-trash"
97                                          aria-hidden="true"></span>
98                                    Delete job
99                                </a>
100                                <!-- HIDDEN BUTTON FOR ASP ACTION -->
101                                <a style="display:none; "
102                                   asp-action="Delete"
103                                   asp-route-id="@Model.selectedJob.Id"
104                                   asp-controller="Job" id="del"
105                                   onclick="showDeleter()"></a>
106
107                                <script type="text/javascript">
108                                    function popUpDelete() {//Quick inline popup with hidden asp button
109                                        if (confirm("Are you sure you want to delete this job?") == true) {
110                                            document.getElementById("del").click();
111                                        }
112
113                                    }
114                                </script>
115
116                            </h2>
117                            <div class="col-sm-6" style="padding-left:30px">
118                                <!-- Information of the job -->
119                                <p>Description: @Model.selectedJob.Job.Description</p>
120                                <p>Resources: @Model.selectedJob.Job.ResourceNames</p>
121                                <p>Created: @Model.selectedJob.Job.DateCreated</p>
122                                <p>Owned by: @Model.selectedJob.Job.OwnerUsername</p>
123
124                            </div>
125                            <div class="col-sm-6" style="padding-left:30px">
126                                <p id="jobcalculating">
127                                    Calculating: @Model.selectedJob.Job.CalculatingCount
128                                </p>
129                                <p id="jobfinished">
130                                    Finished: @Model.selectedJob.Job.FinishedCount
131                                </p>
132                                <p>
133                                    Automatic refresh:
134                                    <input type="checkbox"
135                                           checked
136                                           data-toggle="toggle"
137                                           data-onstyle="success"
138                                           id="refreshtogg"
139                                           onchange="autoRefresh()" />
140                                </p>
141                            </div>
142
143                        </div>
144                        <script src="~/js/hubs/graphhubber.js"></script>
145                        <div class="row" style="text-align:center">
146                            @Html.Partial("_Graphlegend")
147                            <!-- Main graph giving overview of all the jobs-->
148                            <div id="graphMain" style="width:100%;height:0px">
149
150                            </div>
151                            <div class="btn btn-lg btn-info"
152                                 onclick="redrawMain()"
153                                 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
154                            text-shadow:2px 2px black;">Refresh main graph</div>
155                        </div>
156                        <div class="row">
157                            <h3 style="padding-left:20px; ">
158                                @Model.selectedJob.Job.JobCount Tasks
159                            </h3>
160                            @foreach (var task in Model.selectedJob.HiveTasks)
161                            {<!--Display all child jobs recursively -->
162                                @Html.Partial("SelectedJobPartials/_TaskPartial",
163                           new HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer(task))
164
165                            }
166                        </div>
167                    </div>
168                }
169            </div>
170
171
172        }
173        <script type="text/javascript">
174            function showLoader() {//Shows load spinner
175                document.getElementById("content").style.display = "none";
176                document.getElementById("loader").style.display = "";
177
178            }
179            function showDeleter() {//Shows delete spinner
180                document.getElementById("content").style.display = "none";
181                document.getElementById("loader").style.display = "";
182
183                document.getElementById("spinner").className = "fa fa-trash-o fa-spin fa-5x";
184            }
185        </script>
186    </div>
187</div>
Note: See TracBrowser for help on using the repository browser.