stats.xsl 4.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
<xsl:template match = "/icestats" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Icecast Streaming Media Server</title>
	<link rel="stylesheet" type="text/css" href="/style.css" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
</head>
<body>
	<h1>Icecast2 Admin</h1>
	<!--index header menu -->
	<div id="menu">
		<ul>
			<li><a href="stats.xsl">Admin Home</a></li>
			<li><a href="listmounts.xsl">Mountpoint List</a></li>
			<li><a href="/status.xsl">Public Home</a></li>
		</ul>
	</div>
	<!--end index header menu -->
	<!--global server stats-->
	<div class="roundbox">
		<h3>Global Server Stats</h3>
24
25
26
		<ul class="nav">
			<li><a href="reloadconfig.xsl">Reload Server Config</a></li>
		</ul>
27
28
29
30
31
32
33
34
35
36
37
38
39
40
		<table class="yellowkeys">
			<tbody>
				<xsl:for-each select="/icestats">
					<xsl:for-each select="*">
						<xsl:if test = "name()!='source'"> 
							<tr>
							   <td><xsl:value-of select="name()" /></td>
							   <td><xsl:value-of select="." /></td>
							</tr>
						</xsl:if>
					</xsl:for-each>
				</xsl:for-each>
			</tbody>
		</table>
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
		<xsl:if test="authentication">
			<table>
				<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">
								<a href="{@management-url}">Manage Authentication</a>
							</xsl:if>
						</li>
					</xsl:for-each>
				</ul>
			</table>
		</xsl:if>
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
	</div>
	<!--end global server stats-->

	<!--mount point stats-->
	<xsl:for-each select="source">
		<xsl:if test = "listeners!=''"> 
			<div class="roundbox">
				<div class="mounthead">
					<h3 class="mount">Mountpoint <xsl:value-of select="@mount" /></h3>
					<div class="right">
						<xsl:choose>
							<xsl:when test="authenticator">
								<a class="auth" href="/auth.xsl">Login</a>
							</xsl:when>
							<xsl:otherwise>
								<ul class="mountlist">
									<li><a class="play" href="{@mount}.m3u">M3U</a></li>
									<li><a class="play" href="{@mount}.xspf">XSPF</a></li>
									<li><a class="play" href="{@mount}.vclt">VCLT</a></li>
								</ul>
							</xsl:otherwise>
						</xsl:choose>
					</div>
				</div>
				<div class="mountcont">
					<ul class="nav">
						<li><a href="listclients.xsl?mount={@mount}">List Clients</a></li>
						<li><a href="moveclients.xsl?mount={@mount}">Move Listeners</a></li>
						<li><a href="updatemetadata.xsl?mount={@mount}">Update Metadata</a></li>
						<xsl:if test="authenticator">
							<li><a href="manageauth.xsl?mount={@mount}">Manage Authentication</a></li>
						</xsl:if>
						<li><a href="killsource.xsl?mount={@mount}">Kill Source</a></li>
					</ul>
93
94
95
96
97
98
99
					<xsl:if test="server_type and ((server_type = 'application/ogg') or (server_type = 'audio/ogg'))">
						<div class="audioplayer">
							<audio controls="controls" preload="none">
								<source src="{@mount}" type="{server_type}" />
							</audio>
						</div>
					</xsl:if>
100
101
102
					<table class="yellowkeys">
						<tbody>
							<xsl:for-each select="*">
103
104
105
106
107
108
109
110
								<xsl:if test="name() != 'metadata' and name() != 'authentication'">
									<tr>
										<td><xsl:value-of select="name()" /></td>
										<td><xsl:value-of select="." /></td>
									</tr>
								</xsl:if>
							</xsl:for-each>
							<xsl:if test="metadata">
111
								<tr>
112
									<th colspan="2">Extra metadata</th>
113
								</tr>
114
115
116
117
118
119
120
								<xsl:for-each select="metadata/*">
									<tr>
										<td><xsl:value-of select="name()" /></td>
										<td><xsl:value-of select="." /></td>
									</tr>
								</xsl:for-each>
							</xsl:if>
121
122
						</tbody>
					</table>
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
					<xsl:if test="authentication">
						<table>
							<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">
											<a href="{@management-url}">Manage Authentication</a>
										</xsl:if>
									</li>
								</xsl:for-each>
							</ul>
						</table>
					</xsl:if>
141
142
143
144
145
146
147
148
149
150
151
152
				</div>
			</div>
		</xsl:if>
	</xsl:for-each>
	<!--end mount point stats-->
	<div id="footer">
		Support icecast development at <a href="http://www.icecast.org">www.icecast.org</a>
	</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>