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">
6 <img src=
"/images/{./os/type}.png" alt=
"{./os/type}" style=
"float: left;"/>
8 <xsl:when test=
"@id > 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>
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')" />
19 <xsl:when test=
"count(document($snapshots)/snapshots/*) > 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>
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,'_')}" />
32 <xsl:template match=
"domain">
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>
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>
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>
49 <xsl:template match=
"/">
50 <html xmlns=
"http://www.w3.org/1999/xhtml">
52 <title>VPS; Do you need an other argument to migrate?
</title>
53 <link rel=
"stylesheet" type=
"text/css" href=
"/css/default.css" />
56 <img src=
"/images/vps.png" alt=
"VPS" />
57 <xsl:apply-templates />