/[projects]/dao/DaoAdresseVedligehold/src/main/webapp/index.html
ViewVC logotype

Diff of /dao/DaoAdresseVedligehold/src/main/webapp/index.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2852 by torben, Tue Jan 26 22:24:13 2016 UTC revision 2932 by torben, Thu Feb 11 17:35:31 2016 UTC
# Line 2  Line 2 
2    <head>    <head>
3    <head>    <head>
4          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5            
6            <link rel="stylesheet" href="webjars/jquery-ui/1.11.4/jquery-ui.css" />
7    
8          <link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" />          <link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" />
9                    
10          <link rel="stylesheet" href="webjars/bootstrap-fileinput/4.2.7/css/fileinput.min.css" />          <link rel="stylesheet" href="webjars/bootstrap-fileinput/4.2.7/css/fileinput.min.css" />
11            
12            <style>
13            
14    @media (min-width: 1300px) {
15            .container {
16                width: 1300px; /*default 1170px*/
17            }
18    }
19            </style>
20    
21  <!--  use webjars for dependencies -->  <!--  use webjars for dependencies -->
22          <script src="webjars/jquery/2.1.4/jquery.js"></script>          <script src="webjars/jquery/2.1.4/jquery.js"></script>
23            <script src="webjars/jquery-ui/1.11.4/jquery-ui.js"></script>
24          <script src="webjars/bootstrap/3.3.5/js/bootstrap.min.js"></script>          <script src="webjars/bootstrap/3.3.5/js/bootstrap.min.js"></script>
25                    
26          <script src="webjars/bootstrap-fileinput/4.2.7/js/fileinput.min.js"></script>          <script src="webjars/bootstrap-fileinput/4.2.7/js/fileinput.min.js"></script>
# Line 19  Line 31 
31    
32    
33  function loadTasks() {  function loadTasks() {
34          $.get("TaskServlet", function(data) {          $.get("rest/tasks/list", function(data) {
35                  //console.log(data);                  //console.log(data);
36                                    
37                                    
# Line 41  function loadTasks() { Line 53  function loadTasks() {
53                                                    
54                                                    
55                          html += "<div class='panel " + pclass + "'>";                          html += "<div class='panel " + pclass + "'>";
56                          html += "<div class='panel-heading'><h4 class='panel-title'>" + entry.description + "</h4></div>";                          html += "<div class='panel-heading'>";
57                            if (entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED" || entry.state ==  "STATE_QUEUED") {
58                                    html += "<button type='button' class='close removetask' aria-label='Close' taskid='" + entry.id+ "'><span aria-hidden='true'>&times;</span></button>";
59                            }
60                            html += "<h4 class='panel-title'>" + entry.description + "</h4>";
61                            html += "</div>";
62                            html += "  <div class='panel-body'>";
63    
64                          html += entry.detail;                          html += entry.detail;
65                                                    
66                          if (entry.state == "STATE_ABORTED")                          if (entry.state == "STATE_ABORTED")
67                                  html += "<br><div style='color: red'>" + entry.errorMessage + "</div>";                                  html += "<br><div style='color: red'>" + entry.errorMessage + "</div>";
68                                    
69                            if (entry.state == "STATE_RUNNING") {
70                                    if (entry.percentCompleted >= 0) {
71                                            var percent = entry.percentCompleted.toFixed(2);
72                                            html += "<div class='progress'>";
73                                            html += "<div class='progress-bar' role='progressbar' aria-valuenow='" + percent + "' aria-valuemin='0' aria-valuemax='100' style='width:" + percent + "%'> " ;
74                                            html +=  percent + "%";
75                                            html += " </div>";
76                                            html += "</div>";
77                                    }
78                            }
79                                                    
80                          html += "<br/><div style='font-size: 8px; margin: 7px;'>" + entry.state + "</div>";                          var viewlog = "";
81                            if (entry.state == "STATE_RUNNING" || entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") {
82                                    viewlog = "<span style='float: right'><a href='#' class='viewlog' taskid='" + entry.id+ "'>Log</a></span>";
83                            }
84                                                    
85                          html += "</div>";                          html += "  <div style='font-size: 8px; '>" + entry.state + viewlog + "</div>";
86                            
87                            html += "  </div>"; //panel-body
88                            html += "</div>"; //panel
89                                                    
90                  });                  });
91                  if (html == "") {                  if (html == "") {
# Line 76  function genUploadExtraData (previewId, Line 111  function genUploadExtraData (previewId,
111    
112  $(document).ready( function() {  $(document).ready( function() {
113          loadTasks();          loadTasks();
114          setInterval(loadTasks, 2500);          setInterval(loadTasks, 5000);
115            
116            $("#center").resizable({
117            handles: 'e, w'
118            });
119            
120            
121            $(document).on('click', '.viewlog', function(event) { // Bind future elements
122                    var taskid = $(this).attr('taskid');
123                    $("#logview").load('rest/tasks/log/' + taskid);
124                    
125            });
126                    
127            $(document).on('click', '.removetask', function(event) { // Bind future elements
128                    var taskid = $(this).attr('taskid');
129                    $.get('rest/tasks/remove/' + taskid, function() {
130                            loadTasks();
131                    });            
132            });
133                    
134          $("#file").fileinput({          $("#file").fileinput({
135                  //'showUpload':false,                  //'showUpload':false,
# Line 103  $(document).ready( function() { Line 155  $(document).ready( function() {
155                  $('#file').fileinput('upload');                  $('#file').fileinput('upload');
156          });          });
157                    
158            
159            $("#afstandBtn").click( function(){
160                    var dist = $("#afstand_distributor").val();
161                    if (dist == "") {
162                            alert("Du skal vælge distributør");
163                            return;
164                    }
165                    var type = $("#afstand_type").val();
166                    var url = "rest/commands/distancecalculation/" + dist + "/" + type;
167                    
168                    
169                    $.get(url, function() {
170                            loadTasks(); //Force reload of tasks immediately
171                    } );
172                    
173            });
174            
175  });  });
176    
177  </script>        </script>      
# Line 115  $(document).ready( function() { Line 184  $(document).ready( function() {
184      <h1>Dao Adresse Vedligehold</h1>      <h1>Dao Adresse Vedligehold</h1>
185    </div>    </div>
186    <div id="body">    <div id="body">
187      <div class="row">      <div class="row">
188        <div class="col-sm-3" id="leftCol" >        <div class="col-sm-3" id="leftCol" >
189          <div class="panel panel-primary">          <div class="panel panel-primary">
190                  <div class="panel-heading">                  <div class="panel-heading">
# Line 129  $(document).ready( function() { Line 198  $(document).ready( function() {
198          </div>          </div>
199        </div>        </div>
200                
201        <div class="col-sm-6" id="center" >        <div class="col-sm-6" id="center">
202          b        <pre id="logview">
203          </pre>
204        </div>        </div>
205                
206        <div class="col-sm-3" id="rightCol" >        <div class="col-sm-3" id="rightCol" >
207          <div class="panel panel-primary">          <div class="panel panel-primary">
208                  <div class="panel-heading">                  <div class="panel-heading">
209                          <h3 class="panel-title">Actions</h3>                          <h3 class="panel-title">Upload File</h3>
210                          </div>                          </div>
211                          <div class="panel-body">                          <div class="panel-body">
212                                                    
# Line 167  $(document).ready( function() { Line 237  $(document).ready( function() {
237                                                                    
238                                                    
239                          </div>                          </div>
240          </div>          </div> <!--  upload panel -->
241        </div>          
242      </div>            <div class="panel panel-primary">
243                    <div class="panel-heading">
244                            <h3 class="panel-title">Afstand anden rute</h3>
245                            </div>
246                            <div class="panel-body">
247                            
248                            
249                              <label for="distributor">Distributør:</label>
250                              <select class="form-control" id="afstand_distributor" name="afstand_distributor">
251                                    <option></option>
252                                <option>BK</option>
253                                <option>DAO</option>
254                              </select>
255    
256                              
257                              <label for="type">Type:</label>
258                              <select class="form-control" id="afstand_type" name="afstand_type">
259                                <option>Incremental</option>
260                                <option>Full</option>                          
261                              </select>
262                              <br>
263    
264                              
265                              <button class="btn btn-primary" id="afstandBtn">Beregn</button>
266      
267                              
268                            </div>
269                    </div><!-- Afstand-andenrute panel -->
270                            
271            
272            
273          </div><!-- rightcol -->
274        </div> <!-- row -->
275                
276    </div>    </div><!-- body -->
277      
278      
279  </div>  </div>
280        
281    

Legend:
Removed from v.2852  
changed lines
  Added in v.2932

  ViewVC Help
Powered by ViewVC 1.1.20