SIGTERM again
[handlervirt.git] / default.xsl
blobc7b42889bdbfbf6a6a5b3907a674b3376a302e91
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 <a href="/virt/{translate(./name,'_', '/')}/virDomainSave" style="background-image: url('/images/restore.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Snapshot</a>
12 <a href="/virt/{translate(./name,'_', '/')}/virDomainMigrate" style="background-image: url('/images/migrate.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Migrate</a>
13 </xsl:when>
14 <xsl:otherwise>
15 <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>
17 <xsl:variable name="snapshots" select="concat('/virt/', translate(./name,'_', '/'), '/virDomainGetXMLSnapshots')" />
18 <xsl:choose>
19 <xsl:when test= "count(document($snapshots)/snapshots/*) &gt; 0">
20 <a href="/virt/{translate(./name,'_', '/')}/virDomainRestore" style="background-image: url('/images/restore.png'); background-repeat: no-repeat; display: block; width: 45px; height: 47px; font-size: 0; float: left;">Snapshot</a>
21 </xsl:when>
22 </xsl:choose>
23 </xsl:otherwise>
24 </xsl:choose>
26 <h1 style="clear: both;" ><xsl:value-of select="translate(./name,'_', ' ')"/></h1>
27 <img src="/virt/{translate(./name,'_', '/')}/virGraphLoad" alt="Load of {substring-after(./name,'_')}" />
28 <img src="/virt/{translate(./name,'_', '/')}/virGraphInterface" alt="Traffic of {substring-after(./name,'_')}" />
30 </xsl:template>
32 <xsl:template match="domain">
33 <xsl:choose>
34 <xsl:when test="@status = 'running'">
35 <xsl:variable name="color" select="'background-color: #0f0;'" />
36 <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>
37 </xsl:when>
38 <xsl:when test="@status = 'running'">
39 <xsl:variable name="color" select="'background-color: #000;'" />
40 <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>
41 </xsl:when>
42 <xsl:otherwise>
43 <xsl:variable name="color" select="'background-color: #fef;'" />
44 <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>
45 </xsl:otherwise>
46 </xsl:choose>
47 </xsl:template>
49 <xsl:template match="/">
50 <html xmlns="http://www.w3.org/1999/xhtml">
51 <head>
52 <title>VPS; Do you need an other argument to migrate?</title>
53 <link rel="stylesheet" type="text/css" href="/css/default.css" />
54 </head>
55 <body>
56 <img src="/images/vps.png" alt="VPS" />
57 <xsl:apply-templates />
58 </body>
59 </html>
60 </xsl:template>
61 </xsl:stylesheet>