()
| 78 | /* In jede Seite */ |
| 79 | |
| 80 | function pageProbe() { |
| 81 | try { localStorage.setItem('cbm.workspace.setup', 'done'); } catch { /* ohne Speicher geht es auch */ } |
| 82 | const mountCursor = () => { |
| 83 | if (document.getElementById('probe-cursor')) return; |
| 84 | const dot = document.createElement('div'); |
| 85 | dot.id = 'probe-cursor'; |
| 86 | dot.style.cssText = 'position:fixed;left:-100px;top:-100px;width:22px;height:22px;margin:-11px 0 0 -11px;border:2px solid #ff3b6b;' |
| 87 | + 'border-radius:50%;box-shadow:0 0 0 2px rgba(0,0,0,.6);pointer-events:none;z-index:2147483647;'; |
| 88 | document.documentElement.appendChild(dot); |
| 89 | document.addEventListener('mousemove', (event) => { dot.style.left = `${event.clientX}px`; dot.style.top = `${event.clientY}px`; }, true); |
| 90 | }; |
| 91 | if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', mountCursor); else mountCursor(); |
| 92 | window.__probeErrors = []; |
| 93 | window.addEventListener('error', (event) => window.__probeErrors.push(String(event.message))); |
| 94 | window.__probeCanvasSeq = 0; |
| 95 | window.__probeCanvasId = () => { |
| 96 | const canvas = document.querySelector('.atlas-galaxy canvas'); |
| 97 | if (!canvas) return null; |
| 98 | if (!canvas.dataset.probeId) canvas.dataset.probeId = String(++window.__probeCanvasSeq); |
| 99 | return canvas.dataset.probeId; |
| 100 | }; |
| 101 | // Alles, was an den Modell-Worker geht, auch ueber spaeter angelegte Worker. |
| 102 | window.__probeWorker = []; |
| 103 | const NativeWorker = window.Worker; |
| 104 | window.Worker = class ProbeWorker extends NativeWorker { |
| 105 | constructor(url, options) { |
| 106 | super(url, options); |
| 107 | this.__probeSrc = String(url); |
| 108 | } |
| 109 | postMessage(message, transfer) { |
| 110 | try { |
| 111 | if (message && typeof message === 'object' && Array.isArray(message.messages)) { |
| 112 | window.__probeWorker.push({ t: performance.now(), kind: message.kind, profile: message.options?.generationProfile ?? message.generationProfile ?? '', messages: message.messages }); |
| 113 | } |
| 114 | } catch { /* nur Beobachtung */ } |
| 115 | return super.postMessage(message, transfer); |
| 116 | } |
| 117 | }; |
| 118 | window.__probeTimeline = []; |
| 119 | setInterval(() => { |
| 120 | const fit = globalThis.__atlasGalaxyFit?.measure?.(); |
| 121 | const galaxy = globalThis.__atlasGalaxy; |
| 122 | window.__probeTimeline.push({ |
| 123 | t: Math.round(performance.now()), canvas: window.__probeCanvasId?.() ?? null, |
| 124 | camera: fit ? fit.camera.position.map((v) => Number(v.toFixed(2))) : null, |
| 125 | fits: galaxy?.fits ?? null, nodes: galaxy?.nodes ?? null, |
| 126 | }); |
| 127 | if (window.__probeTimeline.length > 8000) window.__probeTimeline.splice(0, 2000); |
| 128 | }, 100); |
| 129 | } |
| 130 | |
| 131 | /* ------------------------------------------------------------------ */ |
| 132 | /* Ergebnis */ |
nothing calls this directly
no test coverage detected