Remove Best Practice Baseline KPI card and locked banner from Server Roles and client directory
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 2m21s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 2m21s
This commit is contained in:
+2
-25
@@ -431,21 +431,7 @@ class WebUIRenderer:
|
||||
bp_kpi_sub = f"{pass_cnt} passing • {warn_cnt} warnings • {fail_cnt} failures"
|
||||
bp_kpi_badge = f'<span class="badge badge-active" style="color:{score_color};">{score}% COMPLIANT</span>'
|
||||
else:
|
||||
bp_banner_html = """
|
||||
<div class="card" style="margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 14px 20px; border: 1px solid rgba(234, 179, 8, 0.3); background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));">
|
||||
<div style="display: flex; align-items: center; gap: 14px;">
|
||||
<span style="font-size: 26px;">🛡️</span>
|
||||
<div>
|
||||
<div style="font-weight: 700; font-size: 14px; color: #facc15;">Best Practice Analyzer & Role Baseline Engine</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted);">Requires 'best_practices' enterprise license capability</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<span class="badge" style="background:rgba(234, 179, 8, 0.15); color:#facc15; border:1px solid rgba(234, 179, 8, 0.3);">LOCKED</span>
|
||||
<button onclick="switchAdminSubtab('baseline')" class="btn btn-outline" style="border-color: #facc15; color: #facc15; font-size: 11px; padding: 6px 12px;">🛡️ Baseline Config</button>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
bp_banner_html = ""
|
||||
|
||||
baseline_admin_html = """
|
||||
<div class="card" style="border: 1px solid rgba(234, 179, 8, 0.4); background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9)); margin-bottom: 24px;">
|
||||
@@ -1725,9 +1711,8 @@ class WebUIRenderer:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab 2: Server Roles & Best Practice Baseline -->
|
||||
<!-- Tab 2: Server Roles & Client Directory -->
|
||||
<div class="tab-pane" id="tabPane-server-roles">
|
||||
<!-- Best Practice Analyzer Banner / Card -->
|
||||
{bp_banner_html}
|
||||
|
||||
<!-- OS Fleet Breakdown KPI Cards -->
|
||||
@@ -1764,14 +1749,6 @@ class WebUIRenderer:
|
||||
<div class="kpi-value" style="color: #38bdf8;">{linux_nodes}</div>
|
||||
<div class="kpi-sub">Linux hosts & containers</div>
|
||||
</div>
|
||||
<div class="card" style="margin-bottom:0;">
|
||||
<div class="card-header">
|
||||
<span class="card-title">Best Practice Baseline</span>
|
||||
{bp_kpi_badge}
|
||||
</div>
|
||||
<div class="kpi-value">{bp_kpi_value}</div>
|
||||
<div class="kpi-sub">{bp_kpi_sub}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Server Roles & Node Inventory Card -->
|
||||
|
||||
@@ -219,6 +219,11 @@ class TestServerRolesAndBestPractices(unittest.TestCase):
|
||||
self.assertIn("id=\"telemetryModal\"", html)
|
||||
self.assertIn("id=\"modalJsonContent\"", html)
|
||||
|
||||
# Server Roles & Client Directory tab should not contain locked/inactive Best Practice Baseline card or banner
|
||||
server_roles_pane = html.split('id="tabPane-server-roles"')[1].split('id="tabPane-')[0]
|
||||
self.assertNotIn("Best Practice Baseline", server_roles_pane)
|
||||
self.assertNotIn("Requires 'best_practices' license capability", server_roles_pane)
|
||||
|
||||
def test_api_client_info_endpoint(self):
|
||||
"""Verifies GET /api/client-info provides structured JSON inventory."""
|
||||
res = self.client.get("/api/client-info", headers=self.auth_headers)
|
||||
|
||||
Reference in New Issue
Block a user