1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Ask for confirmation before killing a source

This commit is contained in:
Philipp Schafft 2020-10-09 14:43:06 +00:00
parent 196a6170cc
commit 7b7d73dee2
4 changed files with 61 additions and 3 deletions

View File

@ -0,0 +1,36 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xt="http://www.jclark.com/xt" extension-element-prefixes="xt" exclude-result-prefixes="xt">
<!-- Import include files -->
<xsl:include href="includes/page.xsl"/>
<xsl:template name="confirm">
<xsl:param name="text" />
<xsl:param name="action-cancel" />
<xsl:param name="action-confirm" />
<xsl:param name="params-cancel" />
<xsl:param name="params-confirm" />
<h2><xsl:value-of select="$title" /></h2>
<section class="box">
<h3 class="box_title">Please confirm</h3>
<p><xsl:copy-of select="$text" /></p>
<ul class="boxnav">
<li>
<form method="get" action="{$action-cancel}">
<xsl:for-each select="xt:node-set($params-cancel)/*">
<input type="hidden" name="{@member}" value="{@value}" />
</xsl:for-each>
<input type="submit" value="Cancel" />
</form>
</li>
<li>
<form method="post" action="{$action-confirm}">
<xsl:for-each select="xt:node-set($params-confirm)/*">
<input type="hidden" name="{@member}" value="{@value}" />
</xsl:for-each>
<input class="critical" type="submit" value="Confirm" />
</form>
</li>
</ul>
</section>
</xsl:template>
</xsl:stylesheet>

View File

@ -8,7 +8,7 @@
<li><a href="/admin/moveclients.xsl?mount={$mount}">Move listeners</a></li>
<li><a href="/admin/updatemetadata.xsl?mount={$mount}">Metadata</a></li>
<li><a href="/admin/fallbacks.xsl?mount={$mount}&amp;omode=strict">Set fallback</a></li>
<li class="critical"><a href="/admin/killsource.xsl?mount={$mount}">Kill source</a></li>
<li class="critical"><a href="/admin/ui/confirmkillsource.xsl?mount={$mount}">Kill source</a></li>
</ul>
</div>
</xsl:template>

View File

@ -0,0 +1,22 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xt="http://www.jclark.com/xt" extension-element-prefixes="xt" exclude-result-prefixes="xt">
<!-- Import include files -->
<xsl:include href="includes/confirm.xsl"/>
<xsl:variable name="title">Confirm killing source</xsl:variable>
<xsl:template name="content">
<xsl:for-each select="/report/incident">
<xsl:variable name="get-parameters" select="resource[@type='parameter']/value[@member='get-parameters']" />
<xsl:variable name="mount" select="$get-parameters/value[@member='mount']" />
<xsl:call-template name="confirm">
<xsl:with-param name="text">Please confirm killing the source connection <code><xsl:value-of select="$mount/@value" /></code>. This will disconnect all listeners.</xsl:with-param>
<xsl:with-param name="action-cancel">/admin/listmounts.xsl</xsl:with-param>
<xsl:with-param name="action-confirm">/admin/killsource.xsl</xsl:with-param>
<xsl:with-param name="params-cancel">
<xsl:copy-of select="$mount" />
</xsl:with-param>
<xsl:with-param name="params-confirm">
<xsl:copy-of select="$mount" />
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@ -141,7 +141,7 @@ ul.boxnav > li {
margin-left: 1em;
}
ul.boxnav > li > a {
ul.boxnav > li > a, ul.boxnav > li input[type='submit'] {
background-color: #4f8cb0;
border: none;
color: white;
@ -152,7 +152,7 @@ ul.boxnav > li > a {
display: inline-block;
}
ul.boxnav > li.critical > a, a.critical {
ul.boxnav > li.critical > a, a.critical, input[type='submit'].critical {
background-color: #ff704d !important;
}