diff --git a/admin/stats.xsl b/admin/stats.xsl
index aff4d1e4..f4e8225a 100644
--- a/admin/stats.xsl
+++ b/admin/stats.xsl
@@ -5,6 +5,8 @@
+
+
Server status
@@ -42,6 +44,7 @@
@@ -72,6 +75,7 @@
+
Mountpoint
@@ -142,5 +146,6 @@
+
diff --git a/src/admin.c b/src/admin.c
index 60a65364..216211f7 100644
--- a/src/admin.c
+++ b/src/admin.c
@@ -462,6 +462,8 @@ void admin_send_response(xmlDocPtr doc,
char *fullpath_xslt_template;
size_t fullpath_xslt_template_len;
ice_config_t *config = config_get_config();
+ const char *showall;
+ const char *mount;
fullpath_xslt_template_len = strlen(config->adminroot_dir) + strlen(xslt_template) + strlen(PATH_SEPARATOR) + 1;
fullpath_xslt_template = malloc(fullpath_xslt_template_len);
@@ -470,7 +472,17 @@ void admin_send_response(xmlDocPtr doc,
config_release_config();
ICECAST_LOG_DEBUG("Sending XSLT (%s)", fullpath_xslt_template);
- xslt_transform(doc, fullpath_xslt_template, client, 200, NULL);
+
+ COMMAND_OPTIONAL(client, "showall", showall);
+ COMMAND_OPTIONAL(client, "mount", mount);
+
+ if (showall && util_str_to_bool(showall)) {
+ const char *params[] = {"param-has-mount", mount ? "'true'" : NULL, "param-showall", "'true'", NULL};
+ xslt_transform(doc, fullpath_xslt_template, client, 200, NULL, params);
+ } else {
+ const char *params[] = {"param-has-mount", mount ? "'true'" : NULL, "param-showall", NULL, NULL};
+ xslt_transform(doc, fullpath_xslt_template, client, 200, NULL, params);
+ }
free(fullpath_xslt_template);
}
}
diff --git a/src/client.c b/src/client.c
index 65e0d43c..82f2946b 100644
--- a/src/client.c
+++ b/src/client.c
@@ -642,7 +642,7 @@ void client_send_reportxml(client_t *client, reportxml_t *report, document_domai
ICECAST_LOG_DEBUG("Sending XSLT (%s)", fullpath_xslt_template);
fastevent_emit(FASTEVENT_TYPE_CLIENT_SEND_RESPONSE, FASTEVENT_FLAG_MODIFICATION_ALLOWED, FASTEVENT_DATATYPE_CLIENT, client);
- xslt_transform(doc, fullpath_xslt_template, client, status, location);
+ xslt_transform(doc, fullpath_xslt_template, client, status, location, NULL);
free(fullpath_xslt_template);
}
diff --git a/src/stats.c b/src/stats.c
index 0e349f5d..365a406a 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -1053,7 +1053,7 @@ void stats_transform_xslt(client_t *client)
doc = stats_get_xml(0, mount, client);
- xslt_transform(doc, xslpath, client, 200, NULL);
+ xslt_transform(doc, xslpath, client, 200, NULL, NULL);
xmlFreeDoc(doc);
free(xslpath);
diff --git a/src/xslt.c b/src/xslt.c
index 963c30f7..37e849df 100644
--- a/src/xslt.c
+++ b/src/xslt.c
@@ -320,7 +320,7 @@ static inline void _send_error(client_t *client, icecast_error_id_t id, int old_
client_send_error_by_id(client, id);
}
-void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client, int status, const char *location)
+void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client, int status, const char *location, const char **params)
{
xmlDocPtr res;
xsltStylesheetPtr cur;
@@ -344,7 +344,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client, in
return;
}
- res = xsltApplyStylesheet(cur, doc, NULL);
+ res = xsltApplyStylesheet(cur, doc, params);
if (res != NULL) {
if (xsltSaveResultToString(&string, &len, res, cur) < 0)
problem = 1;
diff --git a/src/xslt.h b/src/xslt.h
index 8a22d550..09501d1c 100644
--- a/src/xslt.h
+++ b/src/xslt.h
@@ -17,7 +17,7 @@
#include "icecasttypes.h"
-void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client, int status, const char *location);
+void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client, int status, const char *location, const char **params);
void xslt_initialize(void);
void xslt_shutdown(void);
void xslt_clear_cache(void);