Rev 1312 | Rev 1328 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1312 | jmachado | 1 | <%@ page import="jomm.utils.MessageResources" %> |
1076 | jmachado | 2 | <%@ page import="pt.estgp.estgweb.domain.JobServiceTaskImpl" %> |
1312 | jmachado | 3 | <%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %> |
1076 | jmachado | 4 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
5 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
6 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
7 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
11 | <%@ taglib prefix="hmlt" uri="http://jakarta.apache.org/struts/tags-html" %> |
||
12 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
13 | <jsp:useBean id="SchedulleTasksForm" type="pt.estgp.estgweb.web.form.configuration.SchedulleTasksForm" scope="request"/> |
||
14 | <jomm:messages/> |
||
15 | <html:errors/> |
||
16 | |||
17 | |||
18 | |||
19 | <script> |
||
20 | |||
21 | function updateStatus() |
||
22 | { |
||
23 | $.getJSON( "<%=request.getContextPath()%>/admin/schedullerTasksJson?service=loadLog&id=${SchedulleTasksForm.jobServiceTask.id}", function( data ) { |
||
24 | |||
25 | $("#serviceStartDateFormated").html(data.serviceStartDateFormated); |
||
26 | $("#serviceLastUpdateDateFormated").html(data.serviceLastUpdateDateFormated); |
||
27 | $("#serviceFinishDateFormated").html(data.serviceFinishDateFormated); |
||
28 | <% |
||
29 | for(JobServiceTaskImpl.JobStatus jS : JobServiceTaskImpl.JobStatus.values()) |
||
30 | { |
||
31 | %> |
||
32 | if(data.status == "<%=jS.name()%>") |
||
33 | { |
||
34 | $("#status").html("<%=MessageResources.getInstance(request).getMessage("job.status."+jS.name())%>"); |
||
35 | } |
||
36 | <% |
||
37 | } |
||
38 | %> |
||
39 | $("#status").attr("class", "jobStatus"+data.status);(data.status); |
||
40 | $("#progress").html(data.progress + "%"); |
||
41 | $(".progress-bar").css("width",data.progress + "%"); |
||
42 | $(".progress-bar").attr("aria-valuenow",data.progress); |
||
43 | $(".progress-bar").html(data.progress + "%"); |
||
44 | |||
1082 | jmachado | 45 | if(data.status == "STARTED" || data.status == "PENDING") |
1076 | jmachado | 46 | setTimeout("updateStatus()",2000); |
47 | }); |
||
48 | |||
49 | } |
||
50 | $(document).ready(function(){ |
||
51 | updateStatus(); |
||
52 | |||
53 | }); |
||
54 | </script> |
||
55 | |||
56 | <% |
||
57 | |||
58 | %> |
||
59 | |||
60 | |||
61 | <div class="container-fluid"> |
||
62 | <div class="panel panel-default"> |
||
63 | <div class="panel-heading"> |
||
64 | <bean:message key="configuration.taskLog"/> |
||
65 | </div> |
||
66 | <div class="panel-body"> |
||
1085 | jmachado | 67 | <table class="tablesorter tablesortersimple"> |
1076 | jmachado | 68 | <thead> |
69 | <tr> |
||
70 | <th><bean:message key="configuration.task"/></th> |
||
71 | <th>Iniciado</th> |
||
72 | <th>Última Atualização</th> |
||
73 | <th>Terminado</th> |
||
74 | <th>Criado por</th> |
||
75 | <th>Parametros</th> |
||
76 | <th>Status</th> |
||
77 | <th>Progresso</th> |
||
78 | </tr> |
||
79 | </thead> |
||
80 | <tbody> |
||
81 | <tr> |
||
82 | <td><bean:message key="targetService.${SchedulleTasksForm.jobServiceTask.targetService}"/></td> |
||
83 | <td id="serviceStartDateFormated">${SchedulleTasksForm.jobServiceTask.serviceStartDateFormated}</td> |
||
84 | <td id="serviceLastUpdateDateFormated">${SchedulleTasksForm.jobServiceTask.serviceLastUpdateDateFormated}</td> |
||
85 | <td id="serviceFinishDateFormated">${SchedulleTasksForm.jobServiceTask.serviceFinishDateFormated}</td> |
||
86 | <td>${SchedulleTasksForm.jobServiceTask.createdBy.username}</td> |
||
87 | <td> |
||
88 | <table cellspacing="0" cellspadding="0"> |
||
89 | <logic:iterate id="taskParam" name="SchedulleTasksForm" property="jobServiceTask.serviceTaskParameters" type="pt.estgp.estgweb.domain.JobServiceTaskParameter"> |
||
90 | <tr> |
||
91 | <td> |
||
1312 | jmachado | 92 | <bean:message key="task.param.${taskParam.name}"/> |
1076 | jmachado | 93 | </td> |
94 | <td> |
||
1312 | jmachado | 95 | <logic:equal value="JOB_institution_KEY" name="taskParam" property="name"> |
96 | <%=ConfigProperties.getProperty("institution.code.prefix." + taskParam.getObject())%> |
||
97 | </logic:equal> |
||
98 | <logic:notEqual value="JOB_institution_KEY" name="taskParam" property="name"> |
||
99 | ${taskParam.object} |
||
100 | </logic:notEqual> |
||
1076 | jmachado | 101 | </td> |
102 | </tr> |
||
103 | </logic:iterate> |
||
104 | </table> |
||
105 | </td> |
||
106 | <logic:notEmpty name="SchedulleTasksForm" property="jobServiceTask"> |
||
107 | <td id="status" class="jobStatus${SchedulleTasksForm.jobServiceTask.status}"> |
||
108 | <bean:message key="job.status.${SchedulleTasksForm.jobServiceTask.status}"/> |
||
109 | </td> |
||
110 | <td id="progress" style="text-align: right"> |
||
111 | ${SchedulleTasksForm.jobServiceTask.progress} % |
||
112 | </td> |
||
113 | </logic:notEmpty> |
||
114 | <logic:empty name="SchedulleTasksForm" property="jobServiceTask"> |
||
115 | <td></td> |
||
116 | <td></td> |
||
117 | </logic:empty> |
||
118 | </tr> |
||
119 | </tbody> |
||
120 | |||
121 | </table> |
||
122 | <div class="progress"> |
||
123 | <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" |
||
124 | aria-valuemin="0" aria-valuemax="100" style="width:0%"> |
||
125 | 70% |
||
126 | </div> |
||
127 | </div> |
||
128 | <div id="screens"></div> |
||
129 | <a href="<%=request.getContextPath()%>/logServiceStream/${SchedulleTasksForm.jobServiceTask.logFilePath}">Download Log Completo</a> |
||
130 | </div> |
||
131 | </div> |
||
132 | <script type="text/javascript" src="<%=request.getContextPath()%>/js/logtailer/logtail.js"></script> |
||
133 | |||
134 | <style> |
||
135 | |||
136 | .header { |
||
137 | background-color: #ccc; |
||
138 | padding: 0.5em; |
||
139 | font-family: sans-serif; |
||
140 | } |
||
141 | |||
142 | .header .buttons { |
||
143 | float: right; |
||
144 | } |
||
145 | |||
146 | .header h2 { |
||
147 | margin: 0; |
||
148 | } |
||
149 | |||
150 | .screen { |
||
1312 | jmachado | 151 | height: 512px; |
1076 | jmachado | 152 | background-color: black; |
153 | padding: 4px; |
||
154 | overflow: auto; |
||
155 | margin-bottom: 20px; |
||
156 | } |
||
157 | |||
158 | .screen div { |
||
159 | padding: 0; |
||
160 | margin: 0; |
||
161 | border: 0; |
||
162 | background-color: black; |
||
163 | color: #bbb; |
||
164 | line-height: 1.2; |
||
165 | white-space: pre-wrap; |
||
166 | font-family: monospace; |
||
167 | } |
||
168 | </style> |
||
169 | <script> |
||
170 | $(document).ready(function(){ |
||
171 | // |
||
172 | // this is a list of logs we want to tail on this page. make sure these |
||
173 | // point to your own server instead of mine ;) |
||
174 | // |
||
175 | var logs = { |
||
1079 | jmachado | 176 | 'Messages' : '<%=request.getContextPath()%>/logServiceStream/${SchedulleTasksForm.jobServiceTask.logFilePath}' |
1076 | jmachado | 177 | }; |
178 | // |
||
179 | // for each one we create a log_handler() object, passed it a title, |
||
180 | // log URL and a parent element to put the log tailer into. |
||
181 | // |
||
182 | for (var i in logs){ |
||
183 | new log_handler(i, logs[i], $('#screens')); |
||
184 | } |
||
185 | }); |
||
186 | </script> |
||
187 | |||
188 | |||
189 | |||
190 | </div> |