input value and title change when only @ip

This commit is contained in:
Adrien MALINGREY 2023-04-09 01:51:14 +02:00
parent e6b9a7a6be
commit 32423db827

View File

@ -63,7 +63,14 @@
<xsl:choose> <xsl:choose>
<xsl:when test="$scannedHost/status/@state='up'"> <xsl:when test="$scannedHost/status/@state='up'">
<div class="ui fluid mini action input success"> <div class="ui fluid mini action input success">
<input type="text" value="{substring-before($scannedHost/hostnames/hostname/@name, '.')}" title="{$scannedHost/hostnames/hostname/@name} ({$scannedHost/address/@addr})" readonly="" /> <xsl:choose>
<xsl:when test="$scannedHost/hostnames/hostname/@name">
<input type="text" value="{substring-before($scannedHost/hostnames/hostname/@name, '.')}" title="{$scannedHost/hostnames/hostname/@name} ({$scannedHost/address/@addr})" readonly="" />
</xsl:when>
<xsl:otherwise>
<input type="text" value="{$scannedHost/address/@addr}" readonly="" />
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="service"> <xsl:apply-templates select="service">
<xsl:with-param name="scannedHost" select="$scannedHost" /> <xsl:with-param name="scannedHost" select="$scannedHost" />
<xsl:with-param name="scannedHostAddress" select="$scannedHostAddress" /> <xsl:with-param name="scannedHostAddress" select="$scannedHostAddress" />
@ -72,18 +79,14 @@
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<div class="ui fluid mini input error"> <div class="ui fluid mini input error">
<input type="text" title="{@address}" readonly=""> <xsl:choose>
<xsl:attribute name="value"> <xsl:when test="contains('0123456789', substring(@address,1,1))">
<xsl:choose> <input type="text" value="{@address}" readonly=""/>
<xsl:when test="contains('0123456789', substring(@address,1,1))"> </xsl:when>
<xsl:value-of select="@address"/> <xsl:otherwise>
</xsl:when> <input type="text" value="{substring-before(@address, '.')}" title="{@address}" readonly=""/>
<xsl:otherwise> </xsl:otherwise>
<xsl:value-of select="substring-before(@address, '.')"/> </xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</input>
</div> </div>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>