Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2582 Overhaul Login service, done

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