1 |
<%@page contentType="text/html" pageEncoding="UTF-8"%> |
2 |
|
3 |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
4 |
|
5 |
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %> |
6 |
|
7 |
<%@ page import="dk.daoas.daoadresseservice.*" %> |
8 |
<%@ page import="dk.daoas.daoadresseservice.beans.*" %> |
9 |
|
10 |
|
11 |
<t:genericpage> |
12 |
|
13 |
<jsp:body> |
14 |
|
15 |
<script> |
16 |
|
17 |
function resizeIframe(obj){ |
18 |
{obj.style.height = 0;}; |
19 |
{obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';} |
20 |
} |
21 |
|
22 |
|
23 |
|
24 |
function refreshLoaderStatus() { |
25 |
$.get("admin?isrunning=1", function(data) { |
26 |
if (data == "true") { |
27 |
$("#reloadData").text("Running") |
28 |
.removeClass("btn-success") |
29 |
.addClass("btn-danger") |
30 |
.attr("disabled","disabled"); |
31 |
} else { |
32 |
$("#reloadData").text("Not running") |
33 |
.removeClass("btn-danger") |
34 |
.addClass("btn-success") |
35 |
.removeAttr("disabled"); |
36 |
} |
37 |
}); |
38 |
} |
39 |
|
40 |
$(document).ready( function() { |
41 |
|
42 |
$('iframe').load(function() { //dynamically resize all iframes on load |
43 |
resizeIframe( this ); |
44 |
}); |
45 |
|
46 |
$("#reloadData").click(function() { |
47 |
$.get("admin?reload=1&trigger=Manual"); |
48 |
|
49 |
$(this).text("Running") |
50 |
.removeClass("btn-success") |
51 |
.addClass("btn-danger") |
52 |
.attr("disabled","disabled"); |
53 |
}); |
54 |
|
55 |
$("#dbConnectionProbe").click(function() { |
56 |
$("#dbProbeContent").load("DbConnectionProbe"); |
57 |
}); |
58 |
|
59 |
var options = { |
60 |
//Boolean - Whether we should show a stroke on each segment |
61 |
segmentShowStroke : true, |
62 |
|
63 |
//String - The colour of each segment stroke |
64 |
segmentStrokeColor : "#fff", |
65 |
|
66 |
//Number - The width of each segment stroke |
67 |
segmentStrokeWidth : 2, |
68 |
|
69 |
//Number - The percentage of the chart that we cut out of the middle |
70 |
percentageInnerCutout : 50, // This is 0 for Pie charts |
71 |
|
72 |
//Number - Amount of animation steps |
73 |
animationSteps : 10, |
74 |
|
75 |
//String - Animation easing effect |
76 |
animationEasing : "easeOutBounce", |
77 |
|
78 |
//Boolean - Whether we animate the rotation of the Doughnut |
79 |
animateRotate : true, |
80 |
|
81 |
//Boolean - Whether we animate scaling the Doughnut from the centre |
82 |
animateScale : false, |
83 |
|
84 |
}; |
85 |
|
86 |
|
87 |
if ( "<c:out value="${stats.direkteCount}"></c:out>" != "") { |
88 |
var data = [ |
89 |
{ |
90 |
value: <c:out value="${stats.direkteCount}"></c:out>, |
91 |
color: "#46BFBD", //grøn |
92 |
highlight: "#5AD3D1", |
93 |
|
94 |
label: "Direkte" |
95 |
}, |
96 |
{ |
97 |
value: <c:out value="${stats.extendedCount}"></c:out>, |
98 |
color: "#FDB45C", //gul |
99 |
highlight: "#FFC870", |
100 |
label: "Udvidet" |
101 |
}, |
102 |
{ |
103 |
value: <c:out value="${stats.hundredePctCount}"></c:out>, |
104 |
color: "#949FB1", //grey |
105 |
highlight: "#A8B3C5", |
106 |
label: "100%" |
107 |
} |
108 |
, |
109 |
{ |
110 |
value: <c:out value="${stats.ikkeDaekketCount}"></c:out>, |
111 |
color:"#F7464A", //rød |
112 |
highlight: "#FF5A5E", |
113 |
label: "Ikke dækket" |
114 |
} |
115 |
] |
116 |
|
117 |
// Get context with jQuery - using jQuery's .get() method. |
118 |
var ctx = $("#myChart").get(0).getContext("2d"); |
119 |
// This will get the first returned node in the jQuery collection. |
120 |
var myNewChart = new Chart(ctx).Pie(data,options); |
121 |
|
122 |
} |
123 |
|
124 |
|
125 |
|
126 |
|
127 |
refreshLoaderStatus(); |
128 |
setInterval(refreshLoaderStatus, 5000 ); |
129 |
|
130 |
}); |
131 |
|
132 |
|
133 |
|
134 |
</script> |
135 |
|
136 |
|
137 |
<div class="row"> |
138 |
<div class="col-sm-4"> |
139 |
<h3>Dækning</h3> |
140 |
|
141 |
<c:choose> |
142 |
<c:when test="${hasSearch}"> |
143 |
<table> |
144 |
<tr> |
145 |
<td>Direkte: </td> |
146 |
<td align="right"><c:out value="${stats.direkteCount}"></c:out></td> |
147 |
</tr> |
148 |
<tr> |
149 |
<td>Udvidet: </td> |
150 |
<td align="right"><c:out value="${stats.extendedCount}"></c:out></td> |
151 |
</tr> |
152 |
<tr> |
153 |
<td>100%: </td> |
154 |
<td align="right"> |
155 |
<a href='CsvUdtraek?type=100pct' target='_blank'><c:out value="${stats.hundredePctCount}"></c:out></a> |
156 |
</td> |
157 |
</tr> |
158 |
<tr> |
159 |
<td>Ikke dækket: </td> |
160 |
<td align="right"> |
161 |
<a href='CsvUdtraek?type=ikkedaekket' target='_blank'><c:out value="${stats.ikkeDaekketCount}"></c:out></a> |
162 |
</td> |
163 |
</tr> |
164 |
<tr> |
165 |
<td>Total: </td> |
166 |
<td align="right"><c:out value="${stats.totalCount}"></c:out></td> |
167 |
</tr> |
168 |
</table> |
169 |
|
170 |
<canvas id="myChart" width="150" height="150"></canvas> |
171 |
|
172 |
</c:when> |
173 |
<c:otherwise> |
174 |
Data ikke læst endnu |
175 |
</c:otherwise> |
176 |
</c:choose> |
177 |
|
178 |
<h3>Data</h3> |
179 |
|
180 |
<c:choose> |
181 |
<c:when test="${hasSearch}"> |
182 |
<table> |
183 |
<tr> |
184 |
<td>Indlæst: </td> |
185 |
<td align="right"><c:out value="${stats.buildTime}"></c:out></td> |
186 |
</tr> |
187 |
<tr> |
188 |
<td>Forbrugt (ms): </td> |
189 |
<td align="right"><c:out value="${stats.elapsed}"></c:out></td> |
190 |
</tr> |
191 |
</table> |
192 |
|
193 |
</c:when> |
194 |
<c:otherwise> |
195 |
Data ikke læst endnu |
196 |
</c:otherwise> |
197 |
</c:choose> |
198 |
|
199 |
<h3>Dataloader</h3> |
200 |
<button type="button" class="btn" id="reloadData"> awaiting status</button> |
201 |
|
202 |
<h3>DB Connection</h3> |
203 |
<button type="button" class="btn" id="dbConnectionProbe">Test Connection</button><br> |
204 |
<span id="dbProbeContent"></span> |
205 |
|
206 |
<h3>Pages</h3> |
207 |
<ul> |
208 |
<li><a href='CsvUdtraek'>CSV Udtræk</a></li> |
209 |
<li><a href='inspectData.jsp'>Inspect Data</a></li> |
210 |
</ul> |
211 |
|
212 |
<h3>Software</h3> |
213 |
<table> |
214 |
<tr> |
215 |
<td>SVN version: </td> |
216 |
<td align="right"><c:out value="${scmrevision}"></c:out></td> |
217 |
</tr> |
218 |
<tr> |
219 |
<td>Build Time: </td> |
220 |
<td align="right"><c:out value="${buildtime}"></c:out></td> |
221 |
</tr> |
222 |
</table> |
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
</div> |
229 |
<!-- ------------------------------------------ --> |
230 |
|
231 |
<div class="col-sm-8"> |
232 |
<h3>Runtime options</h3> |
233 |
<iframe src="ConfigServlet" width="100%" height="250" style="border-width: 0px; margin-bottom: 20px;" > |
234 |
</iframe> |
235 |
|
236 |
|
237 |
<iframe src="CircuitBreakerServlet" width="100%" height="450" style="border-width: 0px;"> |
238 |
</iframe> |
239 |
|
240 |
</div> |
241 |
|
242 |
</div> |
243 |
|
244 |
|
245 |
</jsp:body> |
246 |
</t:genericpage> |