|
2 | 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
3 | 3 | <xsl:template name="render-service-inventory"> |
4 | 4 | <hr class="my-4"/> |
5 | | - <h2 id="serviceinventory" class="fs-4 mt-5 mb-3 bg-light p-3 rounded"><span class="section-heading-title">Service Summary</span><small class="section-heading-subtitle">See which services are most common, where they appear, and how broadly they are distributed across hosts.</small></h2> |
| 5 | + <h2 id="serviceinventory" class="fs-4 mt-5 mb-3 bg-light p-3 rounded"><span class="section-heading-title">Service Summary</span><small class="section-heading-subtitle">Compare service variants by exact detected product and version while preserving host coverage and exposed ports.</small></h2> |
6 | 6 | <xsl:choose> |
7 | 7 | <xsl:when test="count(//host/ports/port[state/@state='open' and service/@name]) > 0"> |
8 | 8 | <div class="table-responsive"> |
9 | | - <table id="service-inventory" class="table table-striped table-hover table-bordered dataTable align-middle" role="grid"> |
| 9 | + <table id="service-inventory" class="table table-striped table-hover table-bordered align-middle dataTable" role="grid"> |
10 | 10 | <thead class="table-light"> |
11 | 11 | <tr> |
12 | | - <th scope="col">Service Name</th> |
13 | | - <th scope="col">Ports</th> |
14 | | - <th scope="col">Count</th> |
15 | | - <th scope="col">Hosts</th> |
| 12 | + <th scope="col" class="service-inventory-name-column">Service Name</th> |
| 13 | + <th scope="col" class="service-inventory-count-column">Host Count</th> |
| 14 | + <th scope="col">Host Details</th> |
16 | 15 | </tr> |
17 | 16 | </thead> |
18 | | - <tbody> |
19 | | - <xsl:for-each select="//host/ports/port[state/@state='open' and service/@name] |
20 | | - [generate-id() = generate-id( |
21 | | - key('serviceGroup', |
22 | | - concat( |
23 | | - substring('ssl/', 1, (service/@tunnel = 'ssl') * string-length('ssl/')), |
24 | | - service/@name, |
25 | | - '-', |
26 | | - @protocol |
27 | | - ) |
28 | | - )[1] |
29 | | - )]"> |
30 | | - <xsl:variable name="key" select="concat( |
31 | | - substring('ssl/', 1, (service/@tunnel = 'ssl') * string-length('ssl/')), |
32 | | - service/@name, |
33 | | - '-', |
34 | | - @protocol |
35 | | - )" /> |
36 | | - <tr> |
37 | | - <td> |
38 | | - <xsl:value-of select="concat( |
39 | | - substring('ssl/', 1, (service/@tunnel = 'ssl') * string-length('ssl/')), |
40 | | - service/@name |
41 | | - )"/> |
42 | | - </td> |
43 | | - <td class="port-list"> |
44 | | - <xsl:attribute name="data-ports"> |
45 | | - <xsl:for-each select="key('serviceGroup', $key)"> |
46 | | - <xsl:sort select="@portid" data-type="number"/> |
47 | | - <xsl:value-of select="@portid"/> |
48 | | - <xsl:if test="position() != last()">,</xsl:if> |
49 | | - </xsl:for-each> |
50 | | - </xsl:attribute> |
51 | | - <span class="display-ports">Loading...</span> |
52 | | - </td> |
53 | | - <td> |
54 | | - <xsl:value-of select="count(key('serviceGroup', $key))"/> |
55 | | - </td> |
56 | | - <td class="host-list"> |
57 | | - <xsl:attribute name="data-hosts"> |
58 | | - <xsl:for-each select="key('serviceGroup', $key)"> |
59 | | - <xsl:variable name="ip" select="ancestor::host/address[not(@addrtype='mac')]/@addr"/> |
60 | | - <xsl:if test="not(preceding::host/address[not(@addrtype='mac')]/@addr = $ip)"> |
61 | | - <xsl:if test="position() != 1">,</xsl:if> |
62 | | - <xsl:value-of select="$ip"/> |
63 | | - </xsl:if> |
64 | | - </xsl:for-each> |
65 | | - </xsl:attribute> |
66 | | - <span class="display-hosts">Loading...</span> |
67 | | - </td> |
68 | | - </tr> |
69 | | - </xsl:for-each> |
70 | | - </tbody> |
| 17 | + <tbody id="serviceInventoryTableBody"/> |
71 | 18 | </table> |
72 | 19 | </div> |
| 20 | + <div id="serviceInventoryData" class="d-none"> |
| 21 | + <xsl:for-each select="//host/ports/port[state/@state='open' and service/@name]"> |
| 22 | + <xsl:variable name="effective-hostname"> |
| 23 | + <xsl:call-template name="resolve-effective-hostname"/> |
| 24 | + </xsl:variable> |
| 25 | + <span class="service-inventory-entry"> |
| 26 | + <xsl:attribute name="data-service"> |
| 27 | + <xsl:call-template name="render-service-name"/> |
| 28 | + </xsl:attribute> |
| 29 | + <xsl:attribute name="data-product"> |
| 30 | + <xsl:value-of select="service/@product"/> |
| 31 | + </xsl:attribute> |
| 32 | + <xsl:attribute name="data-version"> |
| 33 | + <xsl:value-of select="service/@version"/> |
| 34 | + </xsl:attribute> |
| 35 | + <xsl:attribute name="data-address"> |
| 36 | + <xsl:value-of select="ancestor::host[1]/address[not(@addrtype='mac')][1]/@addr"/> |
| 37 | + </xsl:attribute> |
| 38 | + <xsl:attribute name="data-hostname"> |
| 39 | + <xsl:value-of select="$effective-hostname"/> |
| 40 | + </xsl:attribute> |
| 41 | + <xsl:attribute name="data-port"> |
| 42 | + <xsl:value-of select="@portid"/> |
| 43 | + </xsl:attribute> |
| 44 | + <xsl:attribute name="data-protocol"> |
| 45 | + <xsl:value-of select="@protocol"/> |
| 46 | + </xsl:attribute> |
| 47 | + </span> |
| 48 | + </xsl:for-each> |
| 49 | + </div> |
73 | 50 | <xsl:call-template name="render-service-matrix-data"/> |
74 | 51 | <xsl:call-template name="render-host-port-matrix-card"/> |
75 | 52 | <xsl:call-template name="render-service-port-heatmap-card"/> |
|
0 commit comments