From dd167a4fecaf3be2ccc7f65c9e3028b737d0464a Mon Sep 17 00:00:00 2001 From: Denozordec Date: Fri, 17 Jul 2026 01:59:48 +0700 Subject: [PATCH] refactor(web): remove unused logging function from OpsDashboard - Eliminated the logLayout function from OpsDashboard to streamline the code and improve maintainability. - Adjusted dependencies in the useEffect hook to reflect the removal of the logging functionality. Co-authored-by: Cursor --- .../src/components/reui-kit/ops-dashboard.tsx | 64 +------------------ 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/apps/web/src/components/reui-kit/ops-dashboard.tsx b/apps/web/src/components/reui-kit/ops-dashboard.tsx index a219df1..66328c0 100644 --- a/apps/web/src/components/reui-kit/ops-dashboard.tsx +++ b/apps/web/src/components/reui-kit/ops-dashboard.tsx @@ -62,69 +62,7 @@ export function OpsDashboard({ }, 'A', ) - // #region agent log - const logLayout = (runId: string) => { - const kpi = el.querySelector('[aria-label="Ключевые метрики"]') - const analytics = el.querySelector('[aria-label="Аналитика"]') - const kpiFrame = kpi?.querySelector('[data-slot=frame]') - const kpiGrid = kpiFrame?.firstElementChild - const charts = analytics - ? [...analytics.querySelectorAll('[data-slot=frame]')].map((f) => { - const panel = f.querySelector('[data-slot=frame-panel]') - const chart = f.querySelector('[data-slot=chart]') - const inner = chart?.querySelector( - '.recharts-responsive-container > div', - ) as HTMLElement | null - const surface = f.querySelector( - '.recharts-surface', - ) as SVGElement | null - return { - frameH: (f as HTMLElement).clientHeight, - panelH: (panel as HTMLElement | null)?.clientHeight ?? 0, - chartW: (chart as HTMLElement | null)?.clientWidth ?? 0, - chartH: (chart as HTMLElement | null)?.clientHeight ?? 0, - innerW: inner?.clientWidth ?? 0, - innerH: inner?.clientHeight ?? 0, - hasSvg: Boolean(surface), - svgW: surface?.clientWidth ?? 0, - svgH: surface?.clientHeight ?? 0, - } - }) - : [] - fetch('http://127.0.0.1:7580/ingest/5c1b60ca-3f59-41ce-8435-d25bcc12c3cf', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-Debug-Session-Id': '0f5088', - }, - body: JSON.stringify({ - sessionId: '0f5088', - runId, - location: 'ops-dashboard.tsx:layout', - message: 'dashboard layout metrics', - hypothesisId: 'C', - data: { - kpiPanelDirect: - kpiGrid != null && - [...kpiGrid.children].every( - (c) => c.getAttribute('data-slot') === 'frame-panel', - ), - kpiFirstChildTag: kpiGrid?.firstElementChild?.tagName ?? null, - analyticsAutoRows: analytics - ? getComputedStyle(analytics).gridAutoRows - : null, - charts, - }, - timestamp: Date.now(), - }), - }).catch(() => {}) - } - logLayout('post-fix-2') - requestAnimationFrame(() => - requestAnimationFrame(() => logLayout('post-fix-2-raf')), - ) - // #endregion - }, [isLoading, kpiCards]) + }, [isLoading]) if (isLoading) { return