mirror of
https://github.com/mblanke/ThreatHunt.git
synced 2026-03-01 05:50:21 -05:00
- Implemented PlaybookManager for creating and managing investigation playbooks with templates. - Added SavedSearches component for managing bookmarked queries and recurring scans. - Introduced TimelineView for visualizing forensic event timelines with zoomable charts. - Enhanced backend processing with auto-queued jobs for dataset uploads and improved database concurrency. - Updated frontend components for better user experience and performance optimizations. - Documented changes in update log for future reference.
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
from pathlib import Path
|
|
p=Path(r'd:/Projects/Dev/ThreatHunt/frontend/src/components/NetworkMap.tsx')
|
|
t=p.read_text(encoding='utf-8')
|
|
repls={
|
|
"const LARGE_HUNT_SUBGRAPH_HOSTS = 350;":"const LARGE_HUNT_SUBGRAPH_HOSTS = 220;",
|
|
"const LARGE_HUNT_SUBGRAPH_EDGES = 2500;":"const LARGE_HUNT_SUBGRAPH_EDGES = 1200;",
|
|
"const RENDER_SIMPLIFY_NODE_THRESHOLD = 220;":"const RENDER_SIMPLIFY_NODE_THRESHOLD = 120;",
|
|
"const RENDER_SIMPLIFY_EDGE_THRESHOLD = 1200;":"const RENDER_SIMPLIFY_EDGE_THRESHOLD = 500;",
|
|
"const EDGE_DRAW_TARGET = 1000;":"const EDGE_DRAW_TARGET = 600;"
|
|
}
|
|
for a,b in repls.items():
|
|
if a not in t:
|
|
raise SystemExit(f'missing constant: {a}')
|
|
t=t.replace(a,b)
|
|
|
|
old=''' // Then label hit (so clicking text works too)
|
|
for (const n of graph.nodes) {
|
|
if (isPointOnNodeLabel(n, wx, wy, vp)) return n;
|
|
}
|
|
'''
|
|
new=''' // Then label hit (so clicking text works too on manageable graph sizes)
|
|
if (graph.nodes.length <= 220) {
|
|
for (const n of graph.nodes) {
|
|
if (isPointOnNodeLabel(n, wx, wy, vp)) return n;
|
|
}
|
|
}
|
|
'''
|
|
if old not in t:
|
|
raise SystemExit('label hit block not found')
|
|
t=t.replace(old,new)
|
|
|
|
old2='simulate(g, w / 2, h / 2, 60);'
|
|
if t.count(old2) < 2:
|
|
raise SystemExit('expected two simulate calls')
|
|
t=t.replace(old2,'simulate(g, w / 2, h / 2, 20);',1)
|
|
t=t.replace(old2,'simulate(g, w / 2, h / 2, 30);',1)
|
|
|
|
p.write_text(t,encoding='utf-8')
|
|
print('tightened network map rendering + load limits')
|