1+ {% extends "bootstrap_base.html" %}
2+ {% load i18n humanize %}
3+
4+ {% block page_title %}{% trans "Compliance Control Center" %}{% endblock %}
5+
6+ {% block content %}
7+ < div class ="d-flex align-items-baseline gap-3 mb-3 ">
8+ < h1 class ="h3 mb-0 "> {% trans "Compliance Control Center" %}</ h1 >
9+ < span class ="text-body-secondary "> {{ total_products }} {% trans "active product" %}{{ total_products|pluralize }}</ span >
10+ </ div >
11+
12+ < div class ="row g-3 mb-3 ">
13+ < div class ="col-6 col-md-3 ">
14+ < div class ="bg-body-secondary rounded-3 p-3 ">
15+ < div class ="small text-body-secondary mb-1 "> {% trans "Products" %}</ div >
16+ < div class ="fs-4 fw-medium lh-sm {% if products_ok == total_products %}text-success{% else %}text-warning-orange{% endif %} ">
17+ {{ products_ok }} / {{ total_products }}
18+ </ div >
19+ < div class ="text-body-tertiary fs-xs mt-1 ">
20+ {% trans "active products with no issues" %}
21+ </ div >
22+ </ div >
23+ </ div >
24+ < div class ="col-6 col-md-3 ">
25+ < div class ="bg-body-secondary rounded-3 p-3 ">
26+ < div class ="small text-body-secondary mb-1 "> {% trans "License issues" %}</ div >
27+ < div class ="fs-4 fw-medium lh-sm {% if products_with_license_issues %}text-danger{% else %}text-success{% endif %} ">
28+ {{ products_with_license_issues }}
29+ </ div >
30+ < div class ="text-body-tertiary fs-xs mt-1 ">
31+ {% if products_with_license_issues %}
32+ {% trans "products with policy violations" %}
33+ {% else %}
34+ {% trans "All products within policy" %}
35+ {% endif %}
36+ </ div >
37+ </ div >
38+ </ div >
39+ < div class ="col-6 col-md-3 ">
40+ < div class ="bg-body-secondary rounded-3 p-3 ">
41+ < div class ="small text-body-secondary mb-1 "> {% trans "Security compliance" %}</ div >
42+ < div class ="fs-4 fw-medium lh-sm {% if security_compliance_pct == 100 %}text-success{% elif security_compliance_pct >= 90 %}text-warning-orange{% else %}text-danger{% endif %} ">
43+ {{ security_compliance_pct }}%
44+ </ div >
45+ < div class ="text-body-tertiary fs-xs mt-1 ">
46+ {% if products_security_ok == total_products %}
47+ {% trans "No critical or high vulnerabilities" %}
48+ {% else %}
49+ {{ products_security_ok }} {% trans "of" %} {{ total_products }} {% trans "products without critical/high" %}
50+ {% endif %}
51+ </ div >
52+ </ div >
53+ </ div >
54+ < div class ="col-6 col-md-3 ">
55+ < div class ="bg-body-secondary rounded-3 p-3 ">
56+ < div class ="small text-body-secondary mb-1 "> {% trans "Vulnerabilities" %}</ div >
57+ < div class ="fs-4 fw-medium lh-sm {% if products_with_critical %}text-danger{% elif products_with_vulnerabilities %}text-warning-orange{% else %}text-success{% endif %} ">
58+ {{ products_with_vulnerabilities }}
59+ </ div >
60+ < div class ="text-body-tertiary fs-xs mt-1 ">
61+ {% if products_with_critical %}
62+ {{ products_with_critical }} {% trans "with critical vulnerabilities" %}
63+ {% elif products_with_vulnerabilities %}
64+ {% trans "products with vulnerabilities" %}
65+ {% else %}
66+ {% trans "No known vulnerabilities" %}
67+ {% endif %}
68+ </ div >
69+ </ div >
70+ </ div >
71+ </ div >
72+
73+ < div class ="border rounded-3 p-3 ">
74+ < table class ="table table-sm mb-0 ">
75+ < thead >
76+ < tr >
77+ < th class ="fw-medium "> {% trans "Product" %}</ th >
78+ < th class ="fw-medium text-end "> {% trans "Packages" %}</ th >
79+ < th class ="fw-medium text-end "> {% trans "License compliance" %}</ th >
80+ < th class ="fw-medium text-end "> {% trans "Security compliance" %}</ th >
81+ < th class ="fw-medium text-end "> {% trans "Vulnerabilities" %}</ th >
82+ </ tr >
83+ </ thead >
84+ < tbody >
85+ {% for product in object_list %}
86+ {% with product_url=product.get_absolute_url %}
87+ < tr >
88+ < td >
89+ < a href ="{{ product_url }}#compliance ">
90+ {{ product }}
91+ </ a >
92+ </ td >
93+ < td class ="text-end ">
94+ < a href ="{{ product_url }}#inventory ">
95+ {{ product.package_count|intcomma }}
96+ </ a >
97+ </ td >
98+ < td class ="text-end ">
99+ {% if product.license_error_count %}
100+ < span class ="badge bg-danger-subtle text-danger-emphasis ">
101+ {{ product.license_error_count }} {% trans "error" %}{{ product.license_error_count|pluralize }}
102+ </ span >
103+ {% endif %}
104+ {% if product.license_warning_count %}
105+ < span class ="badge bg-warning-subtle text-warning-emphasis ms-1 ">
106+ {{ product.license_warning_count }} {% trans "warning" %}{{ product.license_warning_count|pluralize }}
107+ </ span >
108+ {% endif %}
109+ {% if not product.license_error_count and not product.license_warning_count %}
110+ < span class ="badge bg-success-subtle text-success-emphasis "> {% trans "OK" %}</ span >
111+ {% endif %}
112+ </ td >
113+ < td class ="text-end ">
114+ {% if product.max_risk_level == "critical" %}
115+ < span class ="badge bg-danger-subtle text-danger-emphasis "> {% trans "Critical" %}</ span >
116+ {% elif product.max_risk_level == "high" %}
117+ < span class ="badge bg-warning-orange-subtle text-warning-orange "> {% trans "High" %}</ span >
118+ {% elif product.max_risk_level == "medium" %}
119+ < span class ="badge bg-warning-subtle text-warning-emphasis "> {% trans "Medium" %}</ span >
120+ {% elif product.max_risk_level == "low" %}
121+ < span class ="badge bg-info-subtle text-info-emphasis "> {% trans "Low" %}</ span >
122+ {% else %}
123+ < span class ="badge bg-success-subtle text-success-emphasis "> {% trans "OK" %}</ span >
124+ {% endif %}
125+ </ td >
126+ < td class ="text-end ">
127+ {% if product.critical_count %}
128+ < span class ="badge bg-danger-subtle text-danger-emphasis "> {{ product.critical_count }} {% trans "critical" %}</ span >
129+ {% endif %}
130+ {% if product.high_count %}
131+ < span class ="badge bg-warning-orange-subtle text-warning-orange ms-1 "> {{ product.high_count }} {% trans "high" %}</ span >
132+ {% endif %}
133+ {% if not product.critical_count and not product.high_count %}
134+ < span class ="text-body-secondary small "> {{ product.vulnerability_count }}</ span >
135+ {% endif %}
136+ </ td >
137+ </ tr >
138+ {% endwith %}
139+ {% empty %}
140+ < tr >
141+ < td colspan ="5 " class ="text-center text-body-tertiary py-4 ">
142+ {% trans "No active products" %}
143+ </ td >
144+ </ tr >
145+ {% endfor %}
146+ </ tbody >
147+ </ table >
148+ </ div >
149+ {% endblock %}
0 commit comments