<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
	<xsl:param name="message"/>
	<xsl:param name="pageTitle">Host</xsl:param>
	<xsl:include href="namedtemplates.xsl"/>
	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="$web_title"/>
				</title>
				<xsl:if test="configuration/user_data/auto_logout_time != 0">
					<xsl:element name="meta">
						<xsl:attribute name="http-equiv">refresh</xsl:attribute>
						<xsl:attribute name="content"><xsl:value-of select="(configuration/user_data/auto_logout_time * 60)+ 5"/>;URL=system.py</xsl:attribute>
					</xsl:element>
				</xsl:if>
				<xsl:call-template name="common_imports"/>
			</head>
			<body onload="window.defaultStatus=''; StartFloat();">
				<div id="container">
					<xsl:call-template name="initPage">
						<xsl:with-param name="pageName">host.py</xsl:with-param>
						<xsl:with-param name="message" select="$message"/>
					</xsl:call-template>
					<div id="displayresults">
						<form action="host.py" method="post" name="applyform">
							<input type="hidden" name="action" value="apply"/>
							<h1 class="display">Host</h1>
							<xsl:apply-templates/>
						</form>
					</div>
				</div>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="user_data">
		<div class="row">
			<div class="generalcell">
				<b>Unit Name:</b>
			</div>
			<div class="largegeneralcell">
				<xsl:element name="input">
					<xsl:attribute name="type">text</xsl:attribute>
					<xsl:attribute name="name">unit_name</xsl:attribute>
					<xsl:attribute name="value"><xsl:value-of select="unit_name"/></xsl:attribute>
					<xsl:attribute name="size">25</xsl:attribute>
				</xsl:element>
			</div>
		</div>
	</xsl:template>
	<xsl:template match="system/interface">
		<div class="row">
			<div class="generalcell">
				<b>MAC Address (<xsl:value-of select="@device"/>):</b>
			</div>
			<div class="largegeneralcell">
				<xsl:value-of select="mac_addr"/>
			</div>
		</div>
	</xsl:template>
	<xsl:template match="network/interface">
		<div class="row">
			<div class="generalcell">
				<b>IP Address (<xsl:value-of select="@device"/>):</b>
			</div>
			<div class="largegeneralcell">
				<xsl:element name="input">
					<xsl:attribute name="type">text</xsl:attribute>
					<xsl:attribute name="name">xpath:/configuration/network/interface[@device='<xsl:value-of select="@device"/>']/inet_addr</xsl:attribute>
					<xsl:attribute name="value"><xsl:value-of select="inet_addr"/></xsl:attribute>
					<xsl:attribute name="size">25</xsl:attribute>
				</xsl:element>
			</div>
		</div>
		<div class="row">
			<div class="generalcell">
				<b>Subnet Mask (<xsl:value-of select="@device"/>):</b>
			</div>
			<div class="largegeneralcell">
				<xsl:element name="input">
					<xsl:attribute name="type">text</xsl:attribute>
					<xsl:attribute name="name">xpath:/configuration/network/interface[@device='<xsl:value-of select="@device"/>']/mask</xsl:attribute>
					<xsl:attribute name="value"><xsl:value-of select="mask"/></xsl:attribute>
					<xsl:attribute name="size">25</xsl:attribute>
				</xsl:element>
			</div>
		</div>
		<xsl:if test="@device = 'eth0' and gateway">
			<div class="row">
				<div class="generalcell">
					<b>Default Gateway:</b>
				</div>
				<div class="largegeneralcell">
					<xsl:element name="input">
						<xsl:attribute name="type">text</xsl:attribute>
						<xsl:attribute name="name">xpath:/configuration/network/gateway?create=1</xsl:attribute>
						<xsl:attribute name="value"><xsl:value-of select="gateway"/></xsl:attribute>
						<xsl:attribute name="size">25</xsl:attribute>
					</xsl:element>
				</div>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template match="network/gateway">
		<div class="row">
			<div class="generalcell">
				<b>Default Gateway:</b>
			</div>
			<div class="largegeneralcell">
				<xsl:element name="input">
					<xsl:attribute name="type">text</xsl:attribute>
					<xsl:attribute name="name">xpath:/configuration/network/gateway?create=1</xsl:attribute>
					<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
					<xsl:attribute name="size">25</xsl:attribute>
				</xsl:element>
			</div>
		</div>
	</xsl:template>
	<xsl:template match="network/ip_logging">
		<div class="row">
			<div class="generalcell">
				<b>System Logging:</b>
			</div>
			<div class="largegeneralcell">
				<xsl:choose>
					<xsl:when test="enable_logging='Yes'">
						<select name="enable_logging" style="width:215px">
							<option value="Yes">Yes</option>
							<option value="No">No</option>
						</select>
					</xsl:when>
					<xsl:otherwise>
						<select name="enable_logging" style="width:215px">
							<option value="No">No</option>
							<option value="Yes">Yes</option>
						</select>
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</div>
	</xsl:template>
	<xsl:template match="text()">
	</xsl:template>
</xsl:stylesheet>
