Free cookie consent management tool by TermsFeed Policy Generator

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

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

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

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