Second problem;
[handlervirt.git] / default.xsl
blob84e6f0e8bf8708ab124c6533ea86078bd548b4d8
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output method="html" indent="yes"/>
4 <xsl:template match="/domain">
5 <br />
6 <img src="/images/{./os/type}.png" alt="{./os/type}" style="float: left;"/>
7 <xsl:choose>
8 <xsl:when test="@id &gt; 0">
9 <a href="/virt/{translate(./name,'_', '/')}/virDomainShutdown" style="background-image: url('/images/power.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Shutdown</a>
10 <a href="/virt/{translate(./name,'_', '/')}/virDomainReboot" style="background-image: url('/images/reboot.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Reboot</a>
11 </xsl:when>
12 <xsl:otherwise>
13 <a href="/virt/{translate(./name,'_', '/')}/virDomainCreate" style="background-image: url('/images/power.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Create</a>
14 </xsl:otherwise>
15 </xsl:choose>
17 <h1 style="clear: both;" ><xsl:value-of select="translate(./name,'_', ' ')"/></h1>
18 <img src="/virt/{translate(./name,'_', '/')}/virGraphLoad" alt="Load of {substring-after(./name,'_')}" />
19 <img src="/virt/{translate(./name,'_', '/')}/virGraphInterface" alt="Traffic of {substring-after(./name,'_')}" />
21 </xsl:template>
23 <xsl:template match="domain">
24 <xsl:choose>
25 <xsl:when test="@status = 'running'">
26 <xsl:variable name="color" select="'background-color: #0f0;'" />
27 <a href="/virt/{translate(./name,'_', '/')}" style="float: left; margin: 0.2em; font-size: 1em; display: block; width: 7em; height: 7em; text-align: center; border: 1px black solid; vertical-align: middle; {$color} text-decoration: none;"><xsl:value-of select="substring-before(./name,'_')"/><br /><xsl:value-of select="substring-after(./name,'_')"/></a>
28 </xsl:when>
29 <xsl:when test="@status = 'running'">
30 <xsl:variable name="color" select="'background-color: #000;'" />
31 <a href="/virt/{translate(./name,'_', '/')}" style="float: left; margin: 0.2em; font-size: 1em; display: block; width: 7em; height: 7em; text-align: center; border: 1px black solid; vertical-align: middle; {$color} text-decoration: none;"><xsl:value-of select="substring-before(./name,'_')"/><br /><xsl:value-of select="substring-after(./name,'_')"/></a>
32 </xsl:when>
33 <xsl:otherwise>
34 <xsl:variable name="color" select="'background-color: #fef;'" />
35 <a href="/virt/{translate(./name,'_', '/')}" style="float: left; margin: 0.2em; font-size: 1em; display: block; width: 7em; height: 7em; text-align: center; border: 1px black solid; vertical-align: middle; {$color} text-decoration: none;"><xsl:value-of select="substring-before(./name,'_')"/><br /><xsl:value-of select="substring-after(./name,'_')"/></a>
36 </xsl:otherwise>
37 </xsl:choose>
38 </xsl:template>
40 <xsl:template match="/">
41 <html xmlns="http://www.w3.org/1999/xhtml">
42 <head>
43 <title>VPS; Do you need an other argument to migrate?</title>
44 <link rel="stylesheet" type="text/css" href="/css/default.css" />
45 </head>
46 <body>
47 <img src="/images/vps.png" alt="VPS" />
48 <xsl:apply-templates />
49 </body>
50 </html>
51 </xsl:template>
52 </xsl:stylesheet>