mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Feature: Added buttons "Copy to clipboard", and "Open ticket" on version page
This commit is contained in:
parent
979c336b5b
commit
bb98f34069
@ -93,7 +93,7 @@
|
|||||||
<section class="box">
|
<section class="box">
|
||||||
<h3 class="box_title">Summary for reporting</h3>
|
<h3 class="box_title">Summary for reporting</h3>
|
||||||
<xsl:for-each select="resource[@type='result']">
|
<xsl:for-each select="resource[@type='result']">
|
||||||
<pre>
|
<pre id="summary">
|
||||||
<xsl:for-each select="value[@type!='structure']"><xsl:value-of select="@member" />: <xsl:value-of select="@value" /><xsl:text>
|
<xsl:for-each select="value[@type!='structure']"><xsl:value-of select="@member" />: <xsl:value-of select="@value" /><xsl:text>
|
||||||
</xsl:text></xsl:for-each>
|
</xsl:text></xsl:for-each>
|
||||||
<xsl:for-each select="value[@member='uname' and @state='set']/value">uname: <xsl:value-of select="@member" />: <xsl:value-of select="@value" /><xsl:text>
|
<xsl:for-each select="value[@member='uname' and @state='set']/value">uname: <xsl:value-of select="@member" />: <xsl:value-of select="@value" /><xsl:text>
|
||||||
@ -106,7 +106,31 @@
|
|||||||
</xsl:text></xsl:for-each>
|
</xsl:text></xsl:for-each>
|
||||||
</pre>
|
</pre>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
<ul class="boxnav">
|
||||||
|
<li><a href="javascript:copy();">Copy to clipboard</a></li>
|
||||||
|
<li><a href="javascript:openTicket();">Open ticket</a></li>
|
||||||
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
<script>
|
||||||
|
function getText() {
|
||||||
|
const node = document.getElementById("summary");
|
||||||
|
return node.textContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function copy() {
|
||||||
|
const text = getText();
|
||||||
|
alert("Copied to clipboard: " + text);
|
||||||
|
navigator.clipboard.writeText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openTicket() {
|
||||||
|
const baseurl = "http://gitlab.xiph.org/xiph/icecast-server/-/issues/new?issue[description]=";
|
||||||
|
const basetext = "# Problem\r\n<describe your problem here>\r\n\r\n# Version Summary\r\n";
|
||||||
|
const text = getText();
|
||||||
|
|
||||||
|
window.location.href = baseurl + encodeURIComponent(basetext + "```\r\n" + text + "```");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user