refactor(web): remove unused logging function from OpsDashboard
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m17s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 1m57s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 6s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m17s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 1m57s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 6s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
- 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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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 <OpsDashboardSkeleton />
|
||||
|
||||
Reference in New Issue
Block a user