source: branches/samerajarmeh/web/xslt/cws-status-resp.xsl@ 171

Last change on this file since 171 was 171, checked in by merek, 12 years ago

Remove start-date, end-date and kick from status page ... if you need this ... patch it in your own version

File size: 49.2 KB
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output method="html"/>
4
5 <xsl:template match="cws-status-resp">
6 <div id="header">
7 <div id="headerInfoLeft"><xsl:call-template name="jvm"/></div>
8 <div id="headerInfo">
9 <img id="busyImg" src="/images/bigrotation.gif" alt="loading" style="visibility: hidden;"/>
10 </div>
11
12 </div>
13 <div id="subheader">
14 <a href="#" id="events">Events</a>&#160;
15 <a href="#" id="channels">Channels</a>&#160;
16 <a href="#" id="status">Status</a>&#160;
17 <a href="#" id="sessions">Sessions</a>&#160;
18 <a href="#" id="admin" style="visibility: hidden">Admin</a>&#160;
19 <a href="#" id="config" style="visibility: hidden">Config</a>&#160;
20 <!-- <a href="#" id="viewXml">View XML</a>&#160; -->
21 <a href="#" id="logout" style="visibility: visible; position: absolute; left: 745px">Logout</a>
22 </div>
23 <div id="mainstart">&#160;</div>
24 <div id="main">
25 <div id="content">
26 <xsl:apply-templates/>
27 </div>
28 </div>
29 <div id="footer">&#160;</div>
30 </xsl:template>
31
32 <xsl:template match="error-log">
33 <xsl:call-template name="profile-filter"/>
34 <fieldset>
35 <legend><strong>CWS Events</strong> (connector activities) <input id="clearEventsBtn" type="button" value="Clear"/> </legend>
36 <table class="error-log">
37 <tbody>
38 <tr><td>
39 <xsl:for-each select="event">
40 <xsl:value-of select="@timestamp"/> -
41 <strong> <xsl:value-of select="@label"/>: </strong>
42 <strong>
43 <xsl:choose>
44 <xsl:when test="@type = 1">Channel changed</xsl:when>
45 <xsl:when test="@type = 2">Successfully connected</xsl:when>
46 <xsl:when test="@type = 3">Disconnected</xsl:when>
47 <xsl:when test="@type = 4">Connection attempt failed</xsl:when>
48 <xsl:when test="@type = 5">Warning (timeout)</xsl:when>
49 <xsl:when test="@type = 6">Lost service</xsl:when>
50 <xsl:when test="@type = 9">Found service</xsl:when>
51 <xsl:when test="@type = 8">Invalid card data</xsl:when>
52 <xsl:when test="@type = 10">Startup</xsl:when>
53 <xsl:otherwise>Unknown</xsl:otherwise>
54 </xsl:choose>
55 </strong> - <xsl:value-of select="@msg"/><br />
56 </xsl:for-each>
57 <xsl:if test="@size = 0">No events</xsl:if>
58 </td></tr>
59 </tbody>
60 </table>
61 </fieldset><br /><br />
62 </xsl:template>
63
64 <xsl:template match="file-log">
65 <xsl:if test="@size > -1">
66 <fieldset>
67 <legend><strong>File Log Events</strong> (recent WARNING and SEVERE level loggings) <input id="clearFileLogBtn" type="button" value="Clear"/> </legend>
68 <table class="error-log">
69 <tbody>
70 <tr><td>
71 <xsl:for-each select="event">
72 <xsl:value-of select="@timestamp"/> -
73 <strong> <xsl:value-of select="@log-level"/>: </strong>
74 <strong><xsl:value-of select="@label"/></strong> - <xsl:value-of select="@msg"/><br />
75 </xsl:for-each>
76 <xsl:if test="@size = 0">No events</xsl:if>
77 </td></tr>
78 </tbody>
79 </table>
80 </fieldset><br /><br />
81 </xsl:if>
82 </xsl:template>
83
84 <xsl:key name="ev-by-time" match="ecm" use="substring(@timestamp, 1, string-length(@timestamp) - 3)"/>
85
86 <xsl:template match="user-warning-log">
87 <fieldset>
88 <legend><strong>User Transaction Warnings</strong> (recent potential traffic problems) <input id="clearWarningsBtn" type="button" value="Clear"/> </legend>
89 <table class="error-log">
90 <tbody>
91 <tr><td> <!-- bwahaha, this is just an insane amount of xsl crud just to get grouping of events per minute -->
92 <xsl:for-each select="ecm[generate-id(.) = generate-id(key('ev-by-time', substring(@timestamp, 1, string-length(@timestamp) - 3))[1])]">
93 <xsl:variable name="curcount" select="count(key('ev-by-time', substring(@timestamp, 1, string-length(@timestamp) - 3)))"/>
94 <xsl:variable name="trunctime" select="substring(@timestamp, 1, string-length(@timestamp) - 3)"/>
95 <xsl:choose>
96 <xsl:when test="$curcount = 1"> <!-- show as single event, no indentation -->
97 <xsl:call-template name="user-warning-entry">
98 <xsl:with-param name="indent" select="''"/>
99 </xsl:call-template>
100 </xsl:when>
101 <xsl:otherwise>
102 <a id="openhref"> <!-- show as group, indented and collapsible with the minute-timestamp as href -->
103 <xsl:attribute name="href"><xsl:value-of select="translate($trunctime, ' ', '_')"/></xsl:attribute>
104 <xsl:value-of select="$trunctime"/> (<xsl:value-of select="$curcount"/> events)
105 </a>
106 <br /><div>
107 <xsl:attribute name="style">display: <xsl:value-of select="@display"/>;</xsl:attribute>
108 <xsl:attribute name="id"><xsl:value-of select="translate($trunctime, ' ', '_')"/></xsl:attribute>
109 <xsl:for-each select="key('ev-by-time', $trunctime)">
110 <xsl:call-template name="user-warning-entry">
111 <xsl:with-param name="indent" select="'&#160;&#160;&#160;'"/>
112 </xsl:call-template>
113 </xsl:for-each>
114 </div>
115 </xsl:otherwise>
116 </xsl:choose>
117 </xsl:for-each>
118 <xsl:if test="count(ecm) = 0">No warnings (debugging must be enabled per ca-profile for these to be logged)</xsl:if>
119 </td></tr>
120 </tbody>
121 </table>
122 </fieldset><br /><br />
123 <xsl:if test="count(ecm) &gt; 0">
124 <xsl:call-template name="flag-legend"/>
125 </xsl:if>
126 </xsl:template>
127
128 <xsl:template match="cws-connectors">
129 <xsl:call-template name="proxy-status"/>
130 <br />
131 <xsl:call-template name="cache-status"/>
132 <xsl:call-template name="proxy-plugins"/>
133 <br />
134 <xsl:call-template name="ca-profiles"/>
135 <br />
136 <fieldset>
137 <legend><strong>Connectors (<xsl:value-of select="count(connector)"/>)</strong></legend>
138 <xsl:for-each select="connector">
139 <xsl:sort select="@profile"/>
140 <xsl:sort select="@name"/>
141 <div class="cwsheader">
142 <table border="0" width="98%" cellspacing="0" cellpadding="0"><tr>
143 <td width="25%"><strong><xsl:value-of select="@protocol"/>Cws: </strong>
144 <xsl:choose>
145 <xsl:when test="@duration"> <!-- duration exists == connector is connected -->
146 <a id="openhref">
147 <xsl:attribute name="href"><xsl:value-of select="@name"/></xsl:attribute>
148 <xsl:value-of select="@name"/>
149 </a>
150 </xsl:when>
151 <xsl:otherwise>
152 <xsl:value-of select="@name"/>
153 </xsl:otherwise>
154 </xsl:choose>
155 </td>
156 <td width="20%"><strong>Status: </strong><xsl:value-of select="@status"/></td>
157 <td width="20%"><strong>Profile: </strong><xsl:value-of select="@profile"/></td>
158 <td width="15%">
159 <xsl:if test="@service-count">
160 <strong>Services: </strong><xsl:value-of select="@service-count"/>
161 </xsl:if>
162 <xsl:if test="@disconnected">
163 <strong>Disconnected: </strong><br /><xsl:value-of select="@disconnected"/>
164 </xsl:if>
165 </td>
166 <td width="10%">
167 <xsl:if test="@metric != 1">
168 <strong>Metric: </strong><xsl:value-of select="@metric"/>
169 </xsl:if>
170 </td>
171 <td width="20%" align="right">
172 <xsl:if test="@utilization">
173 <xsl:choose>
174 <xsl:when test="@utilization &gt; 100">
175 <strong><font color="red"><xsl:value-of select="@utilization"/>%</font></strong>
176 </xsl:when>
177 <xsl:otherwise>
178 <xsl:value-of select="@utilization"/>%
179 </xsl:otherwise>
180 </xsl:choose>
181 &#160;(<xsl:value-of select="@ecm-load"/>)
182 </xsl:if>
183 <xsl:if test="@next-attempt">
184 <strong>Retry in: </strong><xsl:value-of select="@next-attempt"/>
185 </xsl:if>
186 </td>
187 </tr>
188 </table>
189 <div class="cwscontent">
190 <xsl:attribute name="style">display: <xsl:value-of select="@display"/>;</xsl:attribute>
191 <xsl:attribute name="id"><xsl:value-of select="concat('toggle-', @name)"/></xsl:attribute>
192 <xsl:if test="@host"><strong>Host: </strong><xsl:value-of select="@host"/><br /></xsl:if>
193 <xsl:if test="@provider-idents"><strong>Provider-idents: </strong><xsl:value-of select="@provider-idents"/><br /></xsl:if>
194 <strong>Connected: </strong><xsl:value-of select="@connected"/><br />
195 <strong>Uptime: </strong><xsl:value-of select="@duration"/><br />
196 <xsl:if test="@card-data1"><strong>Card-data: </strong><xsl:value-of select="@card-data1"/><br /></xsl:if>
197 <strong>Processing time: </strong><xsl:value-of select="@cutime"/> ms (avg: <xsl:value-of select="@avgtime"/> ms)<br />
198 <strong>Utilization: </strong><xsl:value-of select="@utilization"/>% (total: <xsl:value-of select="@avgutilization"/>%)<br />
199 <strong>Estimated capacity: </strong><xsl:value-of select="@capacity"/><br />
200 <strong>Queue size: </strong><xsl:value-of select="@sendq"/><br />
201 <strong>ECM count: </strong><xsl:value-of select="@ecm-count"/><br />
202 <strong>ECM load: </strong><xsl:value-of select="@ecm-load"/> (over the last cw-max-age period)<br />
203 <xsl:if test="@emm-count &gt; 0"><strong>EMM count: </strong><xsl:value-of select="@emm-count"/><br /></xsl:if>
204 <strong>Timeouts: </strong><xsl:value-of select="@timeout-count"/><br />
205 <xsl:if test="@cws-log">
206 <strong>Transaction log: </strong>
207 <a target="_blank">
208 <xsl:attribute name="href">/xmlHandler?command=cws-log&amp;name=<xsl:value-of select="@name"/></xsl:attribute>
209 <xsl:value-of select="@cws-log"/>
210 </a>
211 <br />
212 </xsl:if>
213 <br />
214 <table width="95%" cellspacing="0" cellpadding="0"><tr>
215 <td width="55%" valign="top">
216 <strong>Services: </strong>&#160;
217 <xsl:if test="count(service) > 0">
218 <a target="_blank">
219 <xsl:attribute name="href">/xmlHandler?command=export-services&amp;name=<xsl:value-of select="@name"/></xsl:attribute>
220 show full
221 </a>&#160;
222 <a target="_blank">
223 <xsl:attribute name="href">/xmlHandler?command=export-services&amp;name=<xsl:value-of select="@name"/>&amp;format=hex</xsl:attribute>
224 show hex
225 </a>
226 </xsl:if>
227 <ul>
228 <xsl:for-each select="service">
229 <xsl:sort select="@name"/>
230 <li>
231 <xsl:choose>
232 <xsl:when test="@hit = 'true'"><font color="blue"><strong><xsl:value-of select="@name"/></strong></font></xsl:when>
233 <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
234 </xsl:choose>
235 <xsl:choose>
236 <xsl:when test="not(starts-with(@name, 'Unknown '))"> (<xsl:value-of select="@hex-id"/><xsl:if test="@profile">:<xsl:value-of select="@profile"/></xsl:if>)</xsl:when>
237 <xsl:otherwise><xsl:if test="@profile"> (<xsl:value-of select="@profile"/>)</xsl:if></xsl:otherwise>
238 </xsl:choose>
239 </li>
240 </xsl:for-each>
241 </ul>
242 </td>
243 <td valign="top">
244 <strong>Remote properties: </strong>
245 <ul>
246 <xsl:for-each select="remote-info/cws-param"><li>
247 <strong><xsl:value-of select="@name"/>: </strong>
248 <xsl:choose>
249 <xsl:when test="@name = 'url'">
250 <a target="_blank">
251 <xsl:attribute name="href"><xsl:value-of select="@value"/></xsl:attribute>
252 <xsl:value-of select="@value"/>
253 </a>
254 </xsl:when>
255 <xsl:otherwise>
256 <xsl:value-of select="@value"/>
257 </xsl:otherwise>
258 </xsl:choose>
259 </li>
260 </xsl:for-each>
261 </ul>
262 </td>
263 </tr></table>
264 </div>
265 </div>
266 </xsl:for-each>
267 </fieldset><br />
268 </xsl:template>
269
270 <xsl:template match="watched-services">
271 <xsl:call-template name="profile-filter"/>
272
273 <xsl:if test="count(//linked-services/link/service) &gt; 0">
274 <fieldset>
275 <legend><strong>Channel groups using same dcw (configured, not verified) (<xsl:value-of select="count(//linked-services/link)"/>)</strong></legend><br />
276 <xsl:for-each select="//linked-services/link">
277 <xsl:if test="count(service) &gt; 0">
278 <xsl:value-of select="@id"/>.
279 <xsl:for-each select="service">
280 <xsl:variable name="srvname" select="@name"/>
281 <xsl:variable name="srvprofile" select="@profile"/>
282 <xsl:choose>
283 <xsl:when test="//watched-services/service[@name=$srvname and @profile=$srvprofile]"> <!-- highlight linked services currently being watched -->
284 <font color="blue"><strong><xsl:value-of select="@name"/></strong> (<xsl:value-of select="@profile"/>:<xsl:value-of select="@cdata"/>) </font>
285 </xsl:when>
286 <xsl:otherwise>
287 <strong><xsl:value-of select="@name"/></strong> (<xsl:value-of select="@profile"/>:<xsl:value-of select="@cdata"/>)
288 </xsl:otherwise>
289 </xsl:choose>
290 </xsl:for-each>
291 <br />
292 </xsl:if>
293 </xsl:for-each>
294 <br />
295 </fieldset><br />
296 </xsl:if>
297
298 <fieldset>
299 <legend><strong>Currently watched channels (<xsl:value-of select="@count"/>)</strong></legend><br />
300 <xsl:for-each select="service">
301 <xsl:sort select="@profile"/>
302 <strong><xsl:value-of select="@name"/></strong> (<xsl:value-of select="@profile"/>:<xsl:value-of select="@hex-id"/>) - <strong><xsl:value-of select="@watchers"/></strong> viewers<br />
303 </xsl:for-each>
304 <xsl:if test="count(service) = 0">No channels</xsl:if>
305 <br />
306 </fieldset><br />
307
308 <xsl:if test="count(//all-services) = 0">
309 <br />
310 <strong>All mapped channels: </strong><a href="#" id="showAllServices"> show</a>
311 </xsl:if>
312 </xsl:template>
313
314 <xsl:template match="all-services">
315 <!-- xsl:call-template name="profile-filter"/ -->
316 <!-- xsl:call-template name="watched-services"/ -->
317 <br />
318 <fieldset>
319 <legend><strong>All mapped channels (<xsl:value-of select="@count"/>)</strong></legend><br />
320 <ul id="chanList">
321 <xsl:for-each select="service">
322 <li class="channel">
323 <xsl:attribute name="id"><xsl:value-of select="concat('channel', @id)"/></xsl:attribute>
324 <img width="40">
325 <xsl:attribute name="src"><xsl:value-of select="concat('picon/', @id, '.', @profile, '.png')"/></xsl:attribute>
326 </img>
327 <input name="chanId" type="checkbox">
328 <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
329 <xsl:attribute name="id"><xsl:value-of select="concat('chan', @id)"/></xsl:attribute>
330 </input>
331 <label>
332 <xsl:attribute name="for"><xsl:value-of select="concat('chan', @id)"/></xsl:attribute>
333 <strong><xsl:value-of select="@name"/></strong> (<xsl:value-of select="@profile"/>:<xsl:value-of select="@hex-id"/>)
334 </label>
335 </li>
336 </xsl:for-each>
337 </ul><br />
338 <xsl:if test="count(service) > 0">
339 <input name="checkAllCb" id="checkAllCb" type="checkbox"/>
340 <label for="checkAllCb">Check all</label>&#160;
341 <input name="enigma2Cb" id="enigma2Cb" type="checkbox"/>
342 <label for="enigma2Cb">Use enigma2 format</label>&#160;
343 <input value="Create bouquet file" type="button" id="createChannelFileBtn"/><br />
344 </xsl:if>
345 <xsl:if test="count(service) = 0">
346 No channels<br />
347 </xsl:if>
348 </fieldset>
349 </xsl:template>
350
351 <xsl:template match="last-seen">
352 <strong>Name: </strong><xsl:value-of select="../proxy-status/@name"/><br />
353 <strong>State: </strong>up<br />
354 <br />
355 <strong>Sessions: </strong><a href="javascript:clickSection('sessions');">show current</a><br />
356 <br />
357 <xsl:for-each select="//last-seen">
358 <xsl:if test="count(entry) > 0">
359 <fieldset id="disconnectedUsers">
360 <legend><strong>Disconnected users (last seen)</strong></legend>
361 <div class="cwsheader">
362 <table border="0" width="80%"><tbody>
363 <tr>
364 <td><strong>User</strong></td><td><strong>Profile</strong></td><td><strong>Last login</strong></td><td><strong>Last seen (or logout)</strong></td><td><strong>IP</strong></td><td><strong>Log</strong></td>
365 </tr>
366 <xsl:for-each select="entry">
367 <xsl:sort order="descending" select="@last-seen"/>
368 <tr>
369 <xsl:if test="position() mod 2 = 1">
370 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
371 </xsl:if>
372 <td><xsl:value-of select="@name"/></td>
373 <td><xsl:value-of select="@profile"/></td>
374 <td><xsl:value-of select="@last-login"/></td>
375 <td><xsl:value-of select="@last-seen"/></td>
376 <td><xsl:value-of select="@host"/></td>
377 <td><a target="_blank">
378 <xsl:attribute name="href">/xmlHandler?command=user-log&amp;name=<xsl:value-of select="@name"/>&amp;profile=<xsl:value-of select="@profile"/></xsl:attribute>
379 <xsl:value-of select="@user-log"/>
380 </a></td>
381 </tr>
382 </xsl:for-each>
383 </tbody></table>
384 </div>
385 </fieldset>
386 </xsl:if>
387 </xsl:for-each>
388 <br />
389 </xsl:template>
390
391 <xsl:template match="login-failures">
392 <strong>Name: </strong><xsl:value-of select="../proxy-status/@name"/><br />
393 <strong>State: </strong>up<br />
394 <br />
395 <strong>Sessions: </strong><a href="javascript:clickSection('sessions');">show current</a><br />
396 <br />
397 <xsl:for-each select="//login-failures">
398 <xsl:if test="count(entry) > 0">
399 <fieldset id="disconnectedUsers">
400 <legend><strong>Login failures/connection attempts</strong></legend>
401 <div class="cwsheader">
402 <table border="0" width="99%"><tbody>
403 <tr>
404 <td><strong>User</strong></td><td><strong>Context</strong></td><td><strong>Count</strong></td><td><strong>Last failure</strong></td><td><strong>IP</strong></td><td><strong>Reason</strong></td>
405 </tr>
406 <xsl:for-each select="entry">
407 <xsl:sort order="descending" select="@last-failure"/>
408 <tr>
409 <xsl:if test="position() mod 2 = 1">
410 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
411 </xsl:if>
412 <td><xsl:value-of select="@name"/></td>
413 <td><xsl:value-of select="@context"/></td>
414 <td><xsl:value-of select="@failure-count"/></td>
415 <td><xsl:value-of select="@last-failure"/></td>
416 <td><xsl:value-of select="@host"/></td>
417 <td><xsl:value-of select="@reason"/></td>
418 </tr>
419 </xsl:for-each>
420 </tbody></table>
421 </div>
422 </fieldset>
423 </xsl:if>
424 </xsl:for-each>
425 <br />
426 </xsl:template>
427
428 <xsl:template match="proxy-users">
429 <strong>Name: </strong><xsl:value-of select="../proxy-status/@name"/><br />
430 <strong>State: </strong>up<br />
431 <strong>Profiles: </strong><xsl:value-of select="count(../ca-profiles/profile)"/><br />
432 <xsl:if test="@count > 1"><strong>Users: </strong><xsl:value-of select="@count"/><br /></xsl:if>
433 <strong>Sessions: </strong><xsl:value-of select="../proxy-status/@sessions"/> (active: <xsl:value-of select="../proxy-status/@active-sessions"/>)<br />
434 <br />
435 <strong>Disconnected users/last seen: </strong><a href="javascript:clickSection('seen');">show log</a><br />
436 <strong>Login failures/connect attempts: </strong><a href="javascript:clickSection('failures');">show log</a> (<xsl:value-of
437 select="@login-failures"/> entries)<br />
438 <br />
439 <input type="checkbox" name="hideInactiveCb" id="hideInactiveCb">
440 <xsl:if test="@hide-inactive">
441 <xsl:attribute name="checked">checked</xsl:attribute>
442 </xsl:if>
443 </input>
444 <label for="hideInactiveCb">Hide idle sessions</label><br />
445 <br />
446 <div class="cwsheader" style="width: 750px;">
447 <table id="userSessions" border="0" width="100%"><tbody>
448 <tr>
449 <td><strong>User</strong></td><td title="Number of connections/maximum"><strong>#</strong></td><td><strong>IP</strong></td>
450 <td><strong>
451 <xsl:choose>
452 <xsl:when test="@toggle-duration"><a href="#" id="toggleDuration" title="Toggle Connected/Zapped Time">Zapped</a></xsl:when>
453 <xsl:otherwise><a href="#" id="toggleDuration" title="Toggle Connected/Zapped Time">Connected</a></xsl:otherwise>
454 </xsl:choose>
455 </strong></td>
456 <td title="ECMs sent by client since connect"><strong>ECM</strong></td><td title="EMMs sent by client since connect"><strong>EMM</strong></td>
457 <td title="Interval between ECMs (sliding window average)"><strong>Iv</strong></td><td title="Processing time for last ECM transaction"><strong>Time</strong></td>
458 <td title="Proxy flags for last ECM transaction"><strong>Flags</strong></td><td><strong>ClientID</strong></td><td><strong>Service</strong></td>
459 </tr>
460 <xsl:for-each select="../ca-profiles/profile">
461 <xsl:sort select="@name"/>
462 <tr>
463 <td colspan="11" align="left" bgcolor="#dddddd">
464 <div><xsl:value-of select="@name"/> (capacity: <xsl:value-of select="@capacity"/>, mapped-services: <xsl:value-of select="@mapped-services"/>)</div>
465 </td>
466 </tr>
467 <xsl:variable name="profile" select="@name"/>
468 <xsl:for-each select="../../proxy-users/user/session[@profile=$profile]">
469 <tr>
470 <xsl:if test="@active = 'false'">
471 <xsl:attribute name="style">font-style: italic</xsl:attribute>
472 <xsl:if test="@keepalive-count">
473 <xsl:attribute name="style">font-style: italic; color: blue</xsl:attribute>
474 </xsl:if>
475 </xsl:if>
476 <xsl:if test="position() mod 2 = 0">
477 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
478 </xsl:if>
479 <td>&#160;&#160;
480 <a target="_blank">
481 <xsl:attribute name="id"><xsl:value-of select="../@name"/></xsl:attribute>
482 <xsl:if test="@active = 'false'">
483 <xsl:attribute name="style">font-style: italic</xsl:attribute>
484 </xsl:if>
485 <xsl:attribute name="href">/xmlHandler?command=proxy-users&amp;name=<xsl:value-of select="../@name"/></xsl:attribute>
486 <xsl:attribute name="title">Show session xml for user</xsl:attribute>
487 <xsl:choose>
488 <xsl:when test="../@display-name">
489 <xsl:value-of select="../@display-name"/>
490 </xsl:when>
491 <xsl:otherwise>
492 <xsl:value-of select="../@name"/>
493 </xsl:otherwise>
494 </xsl:choose>
495 </a>
496 </td>
497 <td><xsl:value-of select="@count"/></td>
498 <td><xsl:value-of select="@host"/>
499 <xsl:variable name="host" select="@host"/>
500 <xsl:variable name="count" select="count(//proxy-users/user/session[@host=$host])"/>
501 <xsl:if test="$count > 1">&#160;(<xsl:value-of select="$count"/>)</xsl:if>
502 </td>
503 <td>
504 <xsl:value-of select="@duration"/>
505 <xsl:if test="@last-zap">
506 <xsl:value-of select="@last-zap"/>
507 </xsl:if>
508 </td>
509 <td><a target="_blank">
510 <xsl:attribute name="href">/xmlHandler?command=user-log&amp;name=<xsl:value-of select="../@name"/>&amp;profile=<xsl:value-of select="@profile"/></xsl:attribute>
511 <xsl:attribute name="title">Show ECM transaction log for user</xsl:attribute>
512 <xsl:value-of select="@ecm-count"/>
513 </a></td>
514 <td>
515 <xsl:value-of select="@emm-count"/><xsl:if test="@au"> -&gt; <br /><xsl:value-of select="@au"/></xsl:if>
516 </td>
517 <td>
518 <xsl:choose>
519 <xsl:when test="@avg-ecm-interval &lt; 7 and @avg-ecm-interval &gt; 0">
520 <strong><font color="red"><xsl:value-of select="@avg-ecm-interval"/></font></strong>
521 </xsl:when>
522 <xsl:otherwise>
523 <xsl:if test="@avg-ecm-interval &gt; -1">
524 <xsl:value-of select="@avg-ecm-interval"/>
525 </xsl:if>
526 </xsl:otherwise>
527 </xsl:choose>
528 <xsl:if test="@pending-count &gt; 1">
529 (<strong><font color="red"><xsl:value-of select="@pending-count"/></font></strong>)
530 </xsl:if>
531 </td>
532 <td>
533 <xsl:choose>
534 <xsl:when test="@last-transaction &gt; 4500">
535 <strong><font color="red"><xsl:value-of select="@last-transaction"/></font></strong>
536 </xsl:when>
537 <xsl:otherwise>
538 <xsl:if test="@last-transaction &gt; -1">
539 <xsl:value-of select="@last-transaction"/>
540 </xsl:if>
541 </xsl:otherwise>
542 </xsl:choose>
543 </td>
544 <td><xsl:value-of select="@flags"/></td>
545 <td><xsl:value-of select="@client-id"/></td>
546 <td>
547 <xsl:value-of select="service/@name"/>
548 <xsl:if test="service/@profile">:<xsl:value-of select="service/@profile"/></xsl:if>
549 </td>
550 </tr>
551 </xsl:for-each>
552 <tr><td colspan="11">&#160;</td></tr>
553 </xsl:for-each>
554 </tbody></table>
555 </div><br />
556 <xsl:call-template name="flag-legend"/>
557 <!-- xsl:call-template name="last-seen"/ -->
558 </xsl:template>
559
560 <xsl:template match="ctrl-commands">
561 <xsl:for-each select="command-group">
562 <fieldset>
563 <legend><strong><xsl:value-of select="@name"/> commands</strong> (<xsl:value-of select="@handler"/>)</legend>
564 <xsl:for-each select="command">
565 <form action="">
566 <xsl:attribute name="name"><xsl:value-of select="concat(@name, '-form')"/></xsl:attribute>
567 <xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
568 <xsl:value-of select="@label"/>
569 <xsl:for-each select="command-param">
570 <xsl:if test="@label != '' and position() = 1">&#160;-&#160;</xsl:if>
571 <xsl:value-of select="@label"/>:
572 <xsl:choose>
573 <xsl:when test="@allow-arbitrary = 'true'">
574 <xsl:choose>
575 <xsl:when test="@size">
576 <textarea>
577 <xsl:attribute name="style">vertical-align: middle;</xsl:attribute>
578 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
579 <xsl:attribute name="rows"><xsl:value-of select="@size"/></xsl:attribute>
580 <xsl:attribute name="cols">45</xsl:attribute>
581 <xsl:value-of select="@label"/>
582 </textarea>&#160;
583 </xsl:when>
584 <xsl:otherwise>
585 <input type="text">
586 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
587 <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
588 </input>&#160;
589 </xsl:otherwise>
590 </xsl:choose>
591 </xsl:when>
592 <xsl:otherwise>
593 <xsl:choose>
594 <xsl:when test="@boolean">
595 <input type="checkbox">
596 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
597 </input>&#160;
598 </xsl:when>
599 <xsl:otherwise>
600 <select>
601 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
602 <xsl:for-each select="option">
603 <xsl:variable name="listname" select="@value"/>
604 <xsl:choose>
605 <xsl:when test="starts-with(@value, '@')"> <!-- @ indicates named list of options -->
606 <xsl:for-each select="//ctrl-commands/option-list[@name=$listname]/option">
607 <option>
608 <xsl:if test="position() = 1">
609 <xsl:attribute name="selected">selected</xsl:attribute>
610 </xsl:if>
611 <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
612 <xsl:value-of select="@value"/>
613 </option>
614 </xsl:for-each>
615 </xsl:when>
616 <xsl:otherwise> <!-- no named list of options -->
617 <option>
618 <xsl:if test="position() = 1">
619 <xsl:attribute name="selected">selected</xsl:attribute>
620 </xsl:if>
621 <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
622 <xsl:value-of select="@value"/>
623 </option>
624 </xsl:otherwise>
625 </xsl:choose>
626
627 </xsl:for-each>
628 </select>&#160;
629 </xsl:otherwise>
630 </xsl:choose>
631 </xsl:otherwise>
632 </xsl:choose>
633 </xsl:for-each>
634 <xsl:if test="@confirm = 'true'">
635 <input type="hidden" name="confirm" value="true"/>
636 </xsl:if>
637 &#160; <input value="OK" type="submit"/><br />
638 &#8226; <xsl:value-of select="@description"/>
639 </form>
640 </xsl:for-each>
641 </fieldset><br />
642 <br />
643 </xsl:for-each>
644 </xsl:template>
645
646 <!-- common named templates for elements that appear in the root but should only be rendered where explicitly called -->
647
648 <xsl:template name="proxy-status">
649 <xsl:for-each select="//proxy-status">
650 <strong>Name: </strong><xsl:value-of select="@name"/><br />
651 <strong>State: </strong>up<br />
652 <strong>Started: </strong><xsl:value-of select="@started"/><br />
653 <strong>Uptime: </strong><xsl:value-of select="@duration"/><br />
654 <strong>Connectors: </strong><xsl:value-of select="@connectors"/><br />
655 <strong>Sessions: </strong><xsl:value-of select="@sessions"/> (active: <xsl:value-of select="@active-sessions"/>)<br />
656 <strong>Estimated total capacity: </strong><xsl:value-of select="@capacity"/> (ECM-&gt;CW transactions per CW-validity-period)<br />
657 <strong>Estimated total load: </strong><xsl:value-of select="sum(//connector/@ecm-load)"/> (forwards during the last period)<br />
658 <strong>ECM total: </strong><xsl:value-of select="@ecm-count"/> (average rate: <xsl:value-of select="@ecm-rate"/>/s)<br />
659 <strong>ECM forwards: </strong><xsl:value-of select="@ecm-forwards"/>&#160;
660 <xsl:if test="@ecm-count &gt; 0">(<xsl:value-of select="format-number(@ecm-forwards div @ecm-count, '##.0%')"/>)</xsl:if><br />
661 <strong>ECM cache hits: </strong><xsl:value-of select="@ecm-cache-hits"/>&#160;
662 <xsl:if test="@ecm-count &gt; 0">(<xsl:value-of select="format-number(@ecm-cache-hits div @ecm-count, '##.0%')"/>)</xsl:if><br />
663 <strong>ECM denied: </strong><xsl:value-of select="@ecm-denied"/>&#160;
664 <xsl:if test="@ecm-denied &gt; 0">(<xsl:value-of select="format-number(@ecm-denied div @ecm-count, '##.0%')"/>)</xsl:if><br />
665 <strong>ECM filtered: </strong><xsl:value-of select="@ecm-filtered"/>&#160;
666 <xsl:if test="@ecm-filtered &gt; 0">(<xsl:value-of select="format-number(@ecm-filtered div @ecm-count, '##.0%')"/>)</xsl:if><br />
667 <strong>ECM failures: </strong><xsl:value-of select="@ecm-failures"/><br />
668 <strong>EMM total: </strong><xsl:value-of select="@emm-count"/><br />
669 </xsl:for-each>
670 </xsl:template>
671
672 <xsl:template name="jvm">
673 <span style="font-size: smaller">
674 <xsl:for-each select="//proxy-status/jvm">
675 <strong>CSP <xsl:value-of select="../@version"/> <xsl:value-of select="../@build"/></strong> - <strong>JVM: </strong>
676 <span id="jvm">[<xsl:value-of select="@name"/> <xsl:value-of select="@version"/>]</span><strong> Heap: </strong>
677 [<xsl:value-of select="@heap-total - @heap-free"/>k/<xsl:value-of select="@heap-total"/>k] <strong>TC: </strong>
678 <span id="tc"> [<xsl:value-of select="@threads"/>]</span>
679 <xsl:if test="@filedesc-open">
680 <strong> FD: </strong> [<xsl:value-of select="@filedesc-open"/>/<xsl:value-of select="@filedesc-max"/>]
681 </xsl:if>
682 <strong> OS: </strong> [<xsl:value-of select="@os"/>]
683 <div style="position: absolute; top: 30px; left: 120px;"><strong><xsl:value-of select="@time"></xsl:value-of></strong></div>
684 <div id="autoPollDiv" style="position: absolute; top: 26px; left: 660px;">
685 <input type="checkbox" name="autoPollCb" id="autoPollCb" checked="checked"/>
686 <label for="autoPollCb">Auto polling</label>
687 </div>
688 </xsl:for-each>
689 </span>
690 </xsl:template>
691
692 <xsl:template name="cache-status">
693 <xsl:for-each select="//cache-status">
694 <div class="cwsheader"><strong>Cache-Handler: </strong>
695 <a id="openhref">
696 <xsl:attribute name="href"><xsl:value-of select="@type"/></xsl:attribute>
697 <xsl:value-of select="@type"/>
698 </a><br />
699 <div class="cwscontent">
700 <xsl:attribute name="style">display: <xsl:value-of select="@display"/>;</xsl:attribute>
701 <xsl:attribute name="id"><xsl:value-of select="concat('toggle-', @type)"/></xsl:attribute>
702 <xsl:for-each select="cache-param">
703 <strong><xsl:value-of select="@name"/>: </strong> <xsl:value-of select="@value"/><br />
704 </xsl:for-each>
705 </div>
706 </div>
707 </xsl:for-each>
708 </xsl:template>
709
710 <xsl:template name="ca-profiles">
711 <xsl:for-each select="//ca-profiles">
712 <fieldset>
713 <legend><strong>Profiles (<xsl:value-of select="count(profile)"/>)</strong></legend>
714 <xsl:for-each select="profile">
715 <xsl:sort select="@name"/>
716 <xsl:variable name="profile" select="@name"/>
717 <div class="cwsheader">
718
719 <table border="0" width="98%" cellspacing="0" cellpadding="0"><tr>
720 <td width="30%"><strong>CA-Profile: </strong>
721 <a id="openhref">
722 <xsl:attribute name="href">profile<xsl:value-of select="@name"/></xsl:attribute>
723 <xsl:value-of select="@name"/>
724 <xsl:choose>
725 <xsl:when test="@network-id"> (<xsl:value-of select="@network-id"/>)</xsl:when>
726 <xsl:otherwise> (ALL)</xsl:otherwise>
727 </xsl:choose>
728 </a><br /></td>
729 <td width="25%">
730 <xsl:if test="@ca-id"><strong>CA-Id: </strong><xsl:value-of select="@ca-id"/></xsl:if>
731 <xsl:if test="not(@network-id)">
732 <div style="position: relative; left: -70px">(multi-context connectors/sessions)</div>
733 </xsl:if>
734 </td>
735 <td width="15%"><strong>Sessions: </strong><xsl:value-of select="@sessions"/></td>
736 <td width="19%"><strong>
737 <xsl:choose>
738 <xsl:when test="@network-id">Local services: </xsl:when>
739 <xsl:otherwise>Services: </xsl:otherwise>
740 </xsl:choose>
741 </strong><xsl:value-of select="@mapped-services"/>
742 </td>
743 <td width="1%">&#160;</td>
744 <td width="20%" align="right">&#160;(<xsl:value-of select="sum(//connector[@profile=$profile]/@ecm-load)"/>)
745
746 </td>
747 </tr>
748 </table>
749
750 <div class="cwscontent">
751 <xsl:attribute name="style">display: <xsl:value-of select="@display"/>;</xsl:attribute>
752 <xsl:attribute name="id"><xsl:value-of select="concat('toggle-profile', @name)"/></xsl:attribute>
753 <xsl:if test="@network-id"><strong>Network-id: </strong> <xsl:value-of select="@network-id"/><br /></xsl:if>
754 <xsl:if test="@ca-id"><strong>Ca-id: </strong> <xsl:value-of select="@ca-id"/><br /></xsl:if>
755 <xsl:if test="@provider-idents"><strong>Provider-idents: </strong> <xsl:value-of select="@provider-idents"/><br /></xsl:if>
756 <xsl:if test="@provider-match"><strong>Require-provider-match: </strong> <xsl:value-of select="@provider-match"/>
757 <xsl:if test="@provider-match='true'"> (provider-ident in requests must exist on connector for forwards to proceed)</xsl:if>
758 <xsl:if test="@provider-match='false'"> (provider-ident in requests not considered when forwarding)</xsl:if>
759 <br />
760 </xsl:if>
761 <strong>Debug: </strong> <xsl:value-of select="@debug"/>
762 <xsl:if test="@debug='true'"> (backlog of 100 transactions kept for every session - memory intensive)</xsl:if>
763 <xsl:if test="@debug='false'"> (no transaction backlogs kept)</xsl:if>
764 <br />
765 <strong>Estimated capacity: </strong> <xsl:value-of select="@capacity"/><br />
766 <strong>Estimated load: </strong><xsl:value-of select="sum(//connector[@profile=$profile]/@ecm-load)"/><br />
767 <strong>
768 <xsl:choose>
769 <xsl:when test="@network-id">Locally mapped services: </xsl:when>
770 <xsl:otherwise>Services: </xsl:otherwise>
771 </xsl:choose>
772 </strong><xsl:value-of select="@mapped-services"/>
773 <xsl:if test="@parsed-services"> (<xsl:value-of select="@parsed-services"/> parsed from services file, with <xsl:value-of select="@parsed-conflicts"/> conflicts)</xsl:if>
774 <br />
775 <xsl:if test="@reset-services"><strong>Reset services: </strong><xsl:value-of select="@reset-services"/><br /></xsl:if>
776 <xsl:if test="@blocked-services"><strong>Blocked services: </strong><xsl:value-of select="@blocked-services"/><br /></xsl:if>
777 <xsl:if test="@allowed-services"><strong>Allowed services: </strong><xsl:value-of select="@allowed-services"/><br /></xsl:if>
778
779 <strong>Max-cw-wait: </strong> <xsl:value-of select="@max-cw-wait"/> ms
780 <xsl:if test="@congestion-limit"> (congestion-limit at <xsl:value-of select="@congestion-limit"/> ms)</xsl:if>
781 <br />
782 <strong>Max-cache-wait: </strong> <xsl:value-of select="@max-cache-wait"/> ms<br />
783
784 <xsl:if test="count(listen-port) > 0">
785 <br /><strong>Listen-ports: </strong>
786 <ul>
787 <xsl:for-each select="listen-port"><li>
788 <span>
789 <xsl:if test="@alive = 'false'">
790 <xsl:attribute name="style">text-decoration: line-through; font-weight: bold</xsl:attribute>
791 </xsl:if>
792 <xsl:value-of select="@name"/>&#160;
793 </span>
794 <xsl:value-of select="@properties"/>
795
796 </li></xsl:for-each>
797 </ul>
798 </xsl:if>
799
800 </div>
801 </div>
802 </xsl:for-each>
803 </fieldset><br />
804 </xsl:for-each>
805 </xsl:template>
806
807 <xsl:template name="proxy-plugins">
808 <xsl:for-each select="//proxy-plugins">
809 <xsl:if test="count(plugin) > 0">
810 <br /><fieldset>
811 <legend><strong>Plugins (<xsl:value-of select="count(plugin)"/>)</strong></legend>
812 <xsl:for-each select="plugin">
813 <xsl:sort select="@name"/>
814 <div class="cwsheader">
815
816 <table border="0" width="98%" cellspacing="0" cellpadding="0"><tr>
817 <td width="25%"><strong>Plugin: </strong>
818 <xsl:choose>
819 <xsl:when test="count(plugin-param) > 0">
820 <a id="openhref">
821 <xsl:attribute name="href">plugin<xsl:value-of select="@name"/></xsl:attribute>
822 <xsl:value-of select="@name"/>
823 </a>
824 </xsl:when>
825 <xsl:otherwise>
826 <xsl:value-of select="@name"/>
827 </xsl:otherwise>
828 </xsl:choose>
829 <br />
830 </td>
831 <td width="75%"><xsl:value-of select="@description"/></td>
832 </tr>
833 </table>
834
835 <div class="cwscontent">
836 <xsl:attribute name="style">display: <xsl:value-of select="@display"/>;</xsl:attribute>
837 <xsl:attribute name="id"><xsl:value-of select="concat('toggle-plugin', @name)"/></xsl:attribute>
838
839 <xsl:if test="count(plugin-param) > 0">
840 <xsl:for-each select="plugin-param">
841 <strong><xsl:value-of select="@name"/>: </strong> <xsl:value-of select="@value"/><br />
842 </xsl:for-each>
843 </xsl:if>
844 &#160;
845
846 </div>
847 </div>
848 </xsl:for-each>
849 </fieldset><br />
850 </xsl:if>
851 </xsl:for-each>
852 </xsl:template>
853
854 <xsl:template name="flag-legend">
855 <fieldset>
856 <legend><strong>Transaction Flags</strong></legend>
857 <table class="error-log">
858 <tbody>
859 <tr><td>
860 Normal traffic flags: <br />
861 <strong>F</strong> = Normal forward to CWS<br />
862 <strong>C</strong> = Cache hit (local)<br />
863 <strong>R</strong> = Cache hit (received from remote cache)<br />
864 <strong>I</strong> = Instant cache hit (no waiting at all in cache, both request and reply already available)<br />
865 <strong>L</strong> = Linked cache hit (CW from a different service was used, via sid linking)<br />
866 <strong>1</strong> = This was the first transaction performed by a new session.<br />
867 <strong>Z</strong> = SID changed (compared to previous transaction = user zap, can also indicate multiple tuners or users in one session if it occurs every time)<br />
868
869 <br />Service mapper flags: <br />
870 <strong>N</strong> = Cannot decode (service mapper says service not on any card, or service blocked)<br />
871 <strong>P</strong> = Service mapper didn't know status for this SID on one or more cards (may have triggered probing if accepted by connectors)<br />
872 <strong>2</strong> = Triggered broadcast to additional cards besides the selected one (broadcast-missing-sid or redundant-forwarding in use)<br />
873 <strong>+</strong> = Caused an addition to the service map (found service, after probing/successful decode)<br />
874 <strong>-</strong> = Caused a removal from the service map (lost service, after repeated failed decodes)<br />
875
876 <br />Flags indicating possible problems/recovery situations: <br />
877 <strong>B</strong> = Blocked by exceeded limits or by filters (plugins)<br />
878 <strong>M</strong> = Ca-id mismatch. The ecm reply didn't have the same ca-id as the request, indicates some clients are sending ecms to the wrong ports.<br />
879 <strong>E</strong> = Client got an empty reply (cannot-decode received from CWS, or from the proxy itself with situation <strong>N</strong>)<br />
880 <strong>Y</strong> = Forward retry performed (first chosen CWS disconnected during the transaction, but alternatives exist)<br />
881 <strong>A</strong> = Abort when forwarding (CWS connection was closed before forward, because of other request timeouts or by the network/server).<br />
882 <strong>T</strong> = Timeout when forwarding (no response from CWS within time limit, i.e max-cw-wait)<br />
883 <strong>O</strong> = Timeout while waiting in cache (waited for max-cache-wait, but no reply was reported to the cache).<br />
884 <strong>Q</strong> = Abort while waiting in cache (the forward the cache was waiting for failed, either locally or remotely).<br />
885 <strong>G</strong> = Congestion when forwarding (time was > max-cw-wait/2, but forward still performed)<br />
886 <strong>X</strong> = Cache hit after failed forward (situation <strong>Y</strong>, but reply became available in cache so no need for new forward)<br />
887
888 <br />Internal/debugging flags: <br />
889 <strong>S</strong> = Timeout in send queue (when trying to forward to connector, should normally not occur)<br />
890 <strong>W</strong> = Triggered cannot-decode-wait (would have been situation <strong>N</strong>, but waiting for remote cache paid off)<br />
891 <strong>H</strong> = Caused an internal failed rechecking of the cache, represents an attempt to recover from an immediately preceeding problem.<br />
892 <strong>U</strong> = Interrupt in the no-sid-delay sleep, a request without sid was delayed but disconnected during the delay.<br />
893 <strong>D</strong> = The user session disconnected before it could receive the reply (likely reached the client ecm timeout)<br />
894 </td></tr>
895 </tbody>
896 </table>
897 </fieldset><br /><br />
898 </xsl:template>
899
900 <xsl:template name="profile-filter">
901 <xsl:for-each select="//ca-profiles">
902 <xsl:if test="count(profile) > 1">
903 <strong>Profile filter: </strong>
904 <select name="profileFilter" id="profileFilter">
905 <option>
906 <xsl:attribute name="value">ALL</xsl:attribute>
907 ALL
908 </option>
909 <xsl:for-each select="profile">
910 <xsl:if test="@name != '*'">
911 <option>
912 <xsl:attribute name="value"><xsl:value-of select="@name"/></xsl:attribute>
913 <xsl:value-of select="@name"/>
914 </option>
915 </xsl:if>
916 </xsl:for-each>
917 </select>
918 <br /><br />
919 </xsl:if>
920 </xsl:for-each>
921 </xsl:template>
922
923 <xsl:template name="user-warning-entry">
924 <xsl:param name="indent"/>
925 <xsl:value-of select="$indent"/><xsl:text> </xsl:text><xsl:value-of select="@timestamp"/> -
926 <strong> <xsl:value-of select="@name"/> </strong>
927 <xsl:text> </xsl:text><xsl:value-of select="@session-id"/> -
928 <xsl:text> </xsl:text><xsl:value-of select="@service-name"/> -
929 <strong> <xsl:value-of select="@time"/> ms</strong> -
930 <strong> "<xsl:value-of select="@flags"/>" </strong>
931 <xsl:if test="@count"> - (<xsl:value-of select="@count"/> occurances)</xsl:if>
932 <br />
933 <xsl:if test="@time-cache and @time &gt; 5000">
934 <xsl:value-of select="$indent"/>&#160; - Time breakdown - Cache wait: <strong><xsl:value-of select="@time-cache"/> ms </strong>
935 Send queue: <strong><xsl:value-of select="@time-queue"/> ms </strong>
936 Server wait: <strong><xsl:value-of select="@time-cws"/> ms </strong>
937 <xsl:if test="@cws-name"> (<xsl:value-of select="@cws-name"/>) </xsl:if>
938 Client writeback: <strong><xsl:value-of select="@time-client"/> ms </strong>
939 <br />
940 </xsl:if>
941 </xsl:template>
942
943
944
945</xsl:stylesheet>
946
Note: See TracBrowser for help on using the repository browser.