forked from xiph/Icecast-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.xsl
156 lines (145 loc) · 4.43 KB
/
stats.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
<xsl:output method="html" doctype-system="about:legacy-compat" encoding="UTF-8" />
<!-- Import include files -->
<xsl:include href="includes/page.xsl"/>
<xsl:include href="includes/mountnav.xsl"/>
<xsl:variable name="title">Stats</xsl:variable>
<!-- Auth template -->
<xsl:template name="authlist">
<ul>
<xsl:for-each select="authentication/role">
<li>Role
<xsl:if test="@name">
<xsl:value-of select="@name" />
</xsl:if>
of type <xsl:value-of select="@type" />
<xsl:if test="@management-url">
<xsl:choose>
<xsl:when test="@can-adduser='true' or @can-deleteuser='true'">
(<a href="{@management-url}">Manage</a>)
</xsl:when>
<xsl:when test="@can-listuser='true'">
(<a href="{@management-url}">List</a>)
</xsl:when>
</xsl:choose>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template name="content">
<div class="section">
<h2>Administration</h2>
<!-- Global stats table -->
<div class="article">
<h3>Global server stats</h3>
<!-- Global subnav -->
<div class="nav">
<ul>
<li><a href="reloadconfig.xsl">Reload Configuration</a></li>
</ul>
</div>
<table class="table-block">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="/icestats/*[not(self::source) and not(self::authentication)]">
<tr>
<td><xsl:value-of select="name()" /></td>
<td><xsl:value-of select="text()" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<!-- Global Auth -->
<xsl:if test="authentication">
<h4>Authentication</h4>
<xsl:call-template name="authlist" />
</xsl:if>
</div>
<!-- Mount stats -->
<xsl:for-each select="source">
<div class="article">
<h3>Mountpoint <xsl:value-of select="@mount" /></h3>
<!-- Mount nav -->
<xsl:call-template name="mountnav" />
<h4>Play stream</h4>
<xsl:choose>
<xsl:when test="authenticator">
<a class="play" href="/auth.xsl">Auth</a>
</xsl:when>
<xsl:otherwise>
<a class="play" href="{@mount}.m3u">► <span>M3U</span></a>
<xsl:text> </xsl:text>
<a class="play" href="{@mount}.xspf">► <span>XSPF</span></a>
<xsl:text> </xsl:text>
<a class="play" href="{@mount}.vclt">► <span>VCLT</span></a>
</xsl:otherwise>
</xsl:choose>
<h4>Further information</h4>
<table class="table-block">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="*[not(self::metadata) and not(self::authentication) and not(self::authenticator) and not(self::listener)]">
<tr>
<td><xsl:value-of select="name()" /></td>
<td><xsl:value-of select="text()" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
<!-- Extra metadata -->
<xsl:if test="metadata/*">
<h4>Extra Metadata</h4>
<table class="table-block">
<tbody>
<xsl:for-each select="metadata/*">
<tr>
<td><xsl:value-of select="name()" /></td>
<td><xsl:value-of select="text()" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:if>
<!-- Extra playlist -->
<xsl:if test="playlist/*">
<h4>Playlist</h4>
<table class="table-block">
<tbody>
<tr>
<th>Album</th>
<th>Track</th>
<th>Creator</th>
<th>Title</th>
</tr>
<xsl:for-each select="playlist/trackList/track">
<tr>
<td><xsl:value-of select="album" /></td>
<td><xsl:value-of select="trackNum" /></td>
<td><xsl:value-of select="creator" /></td>
<td><xsl:value-of select="title" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:if>
<!-- Mount Authentication -->
<xsl:if test="authentication">
<h4>Mount Authentication</h4>
<xsl:call-template name="authlist" />
</xsl:if>
</div>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>