fix options with -

This commit is contained in:
Adrien MALINGREY 2024-10-17 00:45:59 +02:00
parent df5c7e8497
commit 9683dd2283
4 changed files with 31 additions and 17 deletions

View File

@ -105,12 +105,16 @@ Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254"/>
</form> </form>
</nav> </nav>
<main class="ui main wide container"> <main class="ui wide container">
<div class="ui header container">
<h1 class="ui header"><xsl:value-of select="$targets"/></h1> <h1 class="ui header"><xsl:value-of select="$targets"/></h1>
</div>
<div class="ui doubling stackable five column compact grid">
<div class="ui centered link cards"> <div class="ui centered link cards">
<xsl:apply-templates select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]"/> <xsl:apply-templates select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]"/>
</div> </div>
</div>
</main> </main>
<footer class="ui footer segment"> <footer class="ui footer segment">
@ -227,12 +231,12 @@ function hostScanning(link) {
<xsl:text>ui empty circular label </xsl:text> <xsl:text>ui empty circular label </xsl:text>
<xsl:choose> <xsl:choose>
<xsl:when test="$currentHost/status/@state='up'">green</xsl:when> <xsl:when test="$currentHost/status/@state='up'">green</xsl:when>
<xsl:otherwise>red</xsl:otherwise> <xsl:otherwise>red disabled</xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
</div> </div>
</xsl:when> </xsl:when>
<xsl:otherwise><div class="ui red circular label"></div></xsl:otherwise> <xsl:otherwise><div class="ui red disabled circular label"></div></xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:choose> <xsl:choose>
@ -246,7 +250,10 @@ function hostScanning(link) {
</div> </div>
<div class="meta"> <div class="meta">
<xsl:if test="substring-after(hostnames/hostname/@name, '.')"> <xsl:if test="substring-after(hostnames/hostname/@name, '.')">
<div><xsl:value-of select="substring-after(hostnames/hostname/@name, '.')"/></div> <div>
<xsl:text>.</xsl:text>
<xsl:value-of select="substring-after(hostnames/hostname/@name, '.')"/>
</div>
</xsl:if> </xsl:if>
<div><xsl:value-of select="address/@addr"/></div> <div><xsl:value-of select="address/@addr"/></div>
<xsl:if test="address[@addrtype='mac']/@vendor"> <xsl:if test="address[@addrtype='mac']/@vendor">
@ -380,14 +387,14 @@ function hostScanning(link) {
<xsl:choose> <xsl:choose>
<xsl:when test="contains($argAndValue, ' ')"> <xsl:when test="contains($argAndValue, ' ')">
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring(substring-before($argAndValue, ' '), 2)"/> <xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/> <xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring($argAndValue, 2)"/> <xsl:with-param name="name" select="$argAndValue"/>
<xsl:with-param name="value" select="on"/> <xsl:with-param name="value" select="on"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
@ -428,6 +435,7 @@ function hostScanning(link) {
<xsl:param name="asURL" select="false()"/> <xsl:param name="asURL" select="false()"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$asURL"> <xsl:when test="$asURL">
<xsl:text>-</xsl:text>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
<xsl:text>=</xsl:text> <xsl:text>=</xsl:text>
<xsl:choose> <xsl:choose>
@ -437,7 +445,7 @@ function hostScanning(link) {
<xsl:text>&amp;</xsl:text> <xsl:text>&amp;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<input type="hidden" name="{$name}"> <input type="hidden" name="-{$name}">
<xsl:attribute name="value"> <xsl:attribute name="value">
<xsl:choose> <xsl:choose>
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when> <xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>

View File

@ -407,14 +407,14 @@ function hostScanning(link) {
<xsl:choose> <xsl:choose>
<xsl:when test="contains($argAndValue, ' ')"> <xsl:when test="contains($argAndValue, ' ')">
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring(substring-before($argAndValue, ' '), 2)"/> <xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/> <xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring($argAndValue, 2)"/> <xsl:with-param name="name" select="$argAndValue"/>
<xsl:with-param name="value" select="on"/> <xsl:with-param name="value" select="on"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
@ -455,6 +455,7 @@ function hostScanning(link) {
<xsl:param name="asURL" select="false()"/> <xsl:param name="asURL" select="false()"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$asURL"> <xsl:when test="$asURL">
<xsl:text>-</xsl:text>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
<xsl:text>=</xsl:text> <xsl:text>=</xsl:text>
<xsl:choose> <xsl:choose>
@ -464,7 +465,7 @@ function hostScanning(link) {
<xsl:text>&amp;</xsl:text> <xsl:text>&amp;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<input type="hidden" name="{$name}"> <input type="hidden" name="-{$name}">
<xsl:attribute name="value"> <xsl:attribute name="value">
<xsl:choose> <xsl:choose>
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when> <xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>

View File

@ -77,6 +77,10 @@
<xsl:text>can</xsl:text> <xsl:text>can</xsl:text>
</a> </a>
<form id="lanScanForm" class="right menu" onsubmit="targetsInputDiv.classList.add('loading')"> <form id="lanScanForm" class="right menu" onsubmit="targetsInputDiv.classList.add('loading')">
<xsl:call-template name="optionsList">
<xsl:with-param name="argList" select="substring-before(substring-after(@args, ' -'), ' -oX')"/>
<xsl:with-param name="asURL" select="false()"/>
</xsl:call-template>
<div class="ui category search item"> <div class="ui category search item">
<div id="targetsInputDiv" class="ui icon input"> <div id="targetsInputDiv" class="ui icon input">
<input class="prompt" type="text" id="targetsInput" name="targets" oninput="hiddenInput.value=this.value" <input class="prompt" type="text" id="targetsInput" name="targets" oninput="hiddenInput.value=this.value"
@ -373,14 +377,14 @@ function hostScanning(link) {
<xsl:choose> <xsl:choose>
<xsl:when test="contains($argAndValue, ' ')"> <xsl:when test="contains($argAndValue, ' ')">
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring(substring-before($argAndValue, ' '), 2)"/> <xsl:with-param name="name" select="substring-before($argAndValue, ' ')"/>
<xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/> <xsl:with-param name="value" select="substring-after($argAndValue, ' ')"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:call-template name="input"> <xsl:call-template name="input">
<xsl:with-param name="name" select="substring($argAndValue, 2)"/> <xsl:with-param name="name" select="$argAndValue"/>
<xsl:with-param name="value" select="on"/> <xsl:with-param name="value" select="on"/>
<xsl:with-param name="asURL" select="$asURL"/> <xsl:with-param name="asURL" select="$asURL"/>
</xsl:call-template> </xsl:call-template>
@ -421,6 +425,7 @@ function hostScanning(link) {
<xsl:param name="asURL" select="false()"/> <xsl:param name="asURL" select="false()"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$asURL"> <xsl:when test="$asURL">
<xsl:text>-</xsl:text>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
<xsl:text>=</xsl:text> <xsl:text>=</xsl:text>
<xsl:choose> <xsl:choose>
@ -430,7 +435,7 @@ function hostScanning(link) {
<xsl:text>&amp;</xsl:text> <xsl:text>&amp;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<input type="hidden" name="{$name}"> <input type="hidden" name="-{$name}">
<xsl:attribute name="value"> <xsl:attribute name="value">
<xsl:choose> <xsl:choose>
<xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when> <xsl:when test="$value"><xsl:value-of select="$value"/></xsl:when>

View File

@ -3,7 +3,7 @@ svg {
fill: currentColor; fill: currentColor;
} }
.main.container { main {
padding-top: 7em; padding-top: 7em;
min-height: calc(100vh - 4.4285em - 2px); min-height: calc(100vh - 4.4285em - 2px);
} }