share size xsl
This commit is contained in:
parent
d6207258ac
commit
2f3bb6c4f3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
configs/
|
configs/
|
||||||
scans/
|
scans/
|
||||||
site/
|
site/
|
||||||
|
nse/script_args.ini
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
smbuser =
|
smbuser = ADMFUSION
|
||||||
smbpassword =
|
smbpassword = Foe46d$dhj@
|
||||||
|
42
results.xsl
42
results.xsl
@ -33,6 +33,21 @@
|
|||||||
height: 16px;
|
height: 16px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.share-size.primary {
|
||||||
|
--bg: #1678c2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-size.item {
|
||||||
|
--bg: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-size {
|
||||||
|
--free-ratio: calc(var(--free) / var(--total));
|
||||||
|
--used-percent: calc(100% - 100%*var(--free-ratio));
|
||||||
|
--color: hsl(calc(120*var(--free-ratio)) 100% 50%);
|
||||||
|
background: linear-gradient(to right, var(--color) var(--used-percent), var(--bg) var(--used-percent), var(--bg)) !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<meta http-equiv="refresh" content="60"/>
|
<meta http-equiv="refresh" content="60"/>
|
||||||
</head>
|
</head>
|
||||||
@ -156,13 +171,14 @@
|
|||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="($scannedPort/service/@name='microsoft-ds' or $scannedPort/service/@name='netbios-ssn' or $scannedPort/service/@name='smb') and $scannedHost/hostscript/script[@id='smb-enum-shares']/table[not(contains(@key, '$'))]">
|
<xsl:when test="($scannedPort/service/@name='microsoft-ds' or $scannedPort/service/@name='netbios-ssn' or $scannedPort/service/@name='smb') and $scannedHost/hostscript/script[@id='smb-shares-size']">
|
||||||
<div class="ui {$state} dropdown mini button" title="{$title}">
|
<div class="ui {$state} dropdown mini button share-size" title="{$title}" style="--free:{$scannedHost/hostscript/script[@id='smb-shares-size']/table/elem[@key='FreeSize']}; --total:{$scannedHost/hostscript/script[@id='smb-shares-size']/table/elem[@key='TotalSize']}">
|
||||||
<div class="text"><xsl:value-of select="@name"/></div>
|
<xsl:value-of select="$serviceName"/>
|
||||||
<i class="dropdown icon"></i>
|
<i class="dropdown icon"></i>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<xsl:apply-templates select="$scannedHost/hostscript/script[@id='smb-enum-shares']/table[not(contains(@key, '$'))]">
|
<!-- xsl:apply-templates select="$scannedHost/hostscript/script[@id='smb-shares-size']/table[not(contains(@key, '$'))]" -->
|
||||||
<xsl:with-param name="scannedHost" select="$scannedHost"/>
|
<xsl:apply-templates select="$scannedHost/hostscript/script[@id='smb-shares-size']/table">
|
||||||
|
<xsl:with-param name="scannedHostAddress" select="$scannedHostAddress"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -187,21 +203,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<xsl:template match="table">
|
<xsl:template match="table">
|
||||||
<xsl:param name="scannedHost"/>
|
<xsl:param name="scannedHostAddress"/>
|
||||||
<xsl:variable name="path">
|
<a class="item share-size" href="file://///{$scannedHostAddress}/{@key}" target="_blank" rel="noopener noreferrer" style="--free:{elem[@key='FreeSize']}; --total:{elem[@key='TotalSize']}">
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$scannedHost/hostnames/hostname/@name and contains(@key, $scannedHost/address/@addr)">
|
|
||||||
<xsl:text>\\</xsl:text>
|
|
||||||
<xsl:value-of select="$scannedHost/hostnames/hostname/@name"/>
|
|
||||||
<xsl:value-of select="substring-after(@key, $scannedHost/address/@addr)"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="@key"/>
|
<xsl:value-of select="@key"/>
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
<a class="item" href="file:///{$path}" target="_blank" rel="noopener noreferrer">
|
|
||||||
<xsl:value-of select="elem[@key='Comment']"/>
|
|
||||||
</a>
|
</a>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user