fix(portal): align deployed role smoke and screenshot

This commit is contained in:
igor04091968
2026-06-06 15:28:29 +03:00
parent 05e9af02db
commit 53997ad861
4 changed files with 24 additions and 26 deletions
+16 -25
View File
@@ -261,27 +261,6 @@ function setViewMode(mode) {
setTab("operator"); setTab("operator");
return; return;
} }
if (state.operatorData && state.reports) {
const content = document.getElementById("content");
if (content) {
content.innerHTML = renderOperator(state.operatorData, state.reports, { cases: state.cases });
}
setLoadStatus("READY", "Данные готовы", 100);
consumePendingScroll();
if (mode === "security" && !state.cases) {
loadJson("/cases")
.then(cases => {
state.cases = cases;
if (currentViewMode() === "security" && state.tab === "operator" && content) {
content.innerHTML = renderOperator(state.operatorData, state.reports, { cases: state.cases });
}
})
.catch(() => {
state.cases = { ok: false, cases: [] };
});
}
return;
}
refresh({ stage: VIEW_MODES[mode].stage }); refresh({ stage: VIEW_MODES[mode].stage });
} }
@@ -479,7 +458,11 @@ function hasTabData(tab, payload) {
const report = payload.report || {}; const report = payload.report || {};
return (Array.isArray(report.kpis) && report.kpis.length > 0) return (Array.isArray(report.kpis) && report.kpis.length > 0)
|| (Array.isArray(report.executive_points) && report.executive_points.length > 0) || (Array.isArray(report.executive_points) && report.executive_points.length > 0)
|| (Array.isArray(payload.data?.workforce) && payload.data.workforce.length > 0); || (Array.isArray(payload.data?.workforce) && payload.data.workforce.length > 0)
|| Boolean(report.workforce && Object.keys(report.workforce).length > 0)
|| Boolean(report.security_events_summary)
|| (Array.isArray(report.risk_incident_candidates) && report.risk_incident_candidates.length > 0)
|| (Array.isArray(report.forensics?.investigations) && report.forensics.investigations.length > 0);
} }
if (tab === "employees") { if (tab === "employees") {
return Array.isArray(payload.data?.workforce) && payload.data.workforce.length > 0; return Array.isArray(payload.data?.workforce) && payload.data.workforce.length > 0;
@@ -2313,6 +2296,14 @@ function renderSecurityEventsSummary(summary, options = {}) {
const title = options.compact const title = options.compact
? "События безопасности" ? "События безопасности"
: "События безопасности за 24 часа"; : "События безопасности за 24 часа";
const compactStateText = disabled && options.compact
? "Детализация скрыта для роли"
: stateText;
const compactModeText = disabled && options.compact
? "Без ИБ-детализации"
: disabled
? localModeText
: "Агрегированная сводка";
const subtitle = disabled const subtitle = disabled
? `${stateText}. ${localModeText}.` ? `${stateText}. ${localModeText}.`
: fallback : fallback
@@ -2328,14 +2319,14 @@ function renderSecurityEventsSummary(summary, options = {}) {
<div class="section-head"> <div class="section-head">
<div> <div>
<h3 ${tooltip("Краткая управленческая сводка доступности событий безопасности за последние 24 часа.")}>${ui(title)}</h3> <h3 ${tooltip("Краткая управленческая сводка доступности событий безопасности за последние 24 часа.")}>${ui(title)}</h3>
<p class="muted">${ui(stateText)}</p> <p class="muted">${ui(compactStateText)}</p>
</div> </div>
<span class="badge ${statusClass(status)}">${ui(status)}</span> <span class="badge ${statusClass(status)}">${ui(status)}</span>
</div> </div>
<div class="quality-grid"> <div class="quality-grid">
<div><span class="muted">Состояние</span><strong>${ui(stateText)}</strong></div> <div><span class="muted">Состояние</span><strong>${ui(compactStateText)}</strong></div>
<div><span class="muted">Событий за 24 часа</span><strong>${ui(s.events_24h ?? 0)}</strong></div> <div><span class="muted">Событий за 24 часа</span><strong>${ui(s.events_24h ?? 0)}</strong></div>
<div><span class="muted">Режим</span><strong>${ui(disabled ? localModeText : "Агрегированная сводка")}</strong></div> <div><span class="muted">Режим</span><strong>${ui(compactModeText)}</strong></div>
</div> </div>
</section> </section>
`; `;
+1
View File
@@ -200,6 +200,7 @@
method: GET method: GET
status_code: 200 status_code: 200
return_content: true return_content: true
timeout: 90
register: detmir_portal_reports register: detmir_portal_reports
failed_when: > failed_when: >
detmir_portal_reports.status != 200 detmir_portal_reports.status != 200
Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

After

Width:  |  Height:  |  Size: 212 KiB

+7 -1
View File
@@ -261,11 +261,17 @@ async function main() {
&& (await page.locator('[data-view-mode="admin"]').count()) === 1, && (await page.locator('[data-view-mode="admin"]').count()) === 1,
}); });
const expectedSecurityText = expectedSecurityEventsText(securityMode); const expectedSecurityText = expectedSecurityEventsText(securityMode);
const executiveSecurityTextOk = securityMode === "available"
? containsText(readyBodyText, "События безопасности")
&& containsText(readyBodyText, "Событий за 24 часа")
&& !containsText(readyBodyText, "События безопасности временно недоступны")
&& !containsText(readyBodyText, "Источник событий безопасности отключён")
: containsText(readyBodyText, expectedSecurityText);
checks.push({ checks.push({
name: "security_events_executive_text", name: "security_events_executive_text",
ok: ok:
!expectedSecurityText !expectedSecurityText
|| (containsText(readyBodyText, expectedSecurityText) || (executiveSecurityTextOk
&& !containsText(readyBodyText, "SECURITY_EVENTS_BACKEND") && !containsText(readyBodyText, "SECURITY_EVENTS_BACKEND")
&& !containsText(readyBodyText, "CLICKHOUSE_*") && !containsText(readyBodyText, "CLICKHOUSE_*")
&& !containsText(readyBodyText, "ClickHouse")), && !containsText(readyBodyText, "ClickHouse")),