okbasto2
feat: output raw QR text payload directly in logs and Web UI with copy button
f27ede2
Raw History Blame Contribute Delete
20.5 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NeuroBench AI โ€” Neural Inference &amp; Latency Benchmark Suite</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<!-- ========================================================= -->
<!-- 1. CAMOUFLAGE / STEALTH ML/AI INTERFACE (DEFAULT VIEW) -->
<!-- ========================================================= -->
<div id="stealthView" class="view-active">
<div class="stealth-container">
<!-- ML Header -->
<header class="ml-header">
<div class="ml-header-left">
<div class="ml-logo" id="stealthLogoBtn" title="NeuroBench Core">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
<polyline points="2 17 12 22 22 17"></polyline>
<polyline points="2 12 12 17 22 12"></polyline>
</svg>
</div>
<div>
<div class="ml-brand">NeuroBench <span class="ml-badge">AI Studio 2.4</span></div>
<div class="ml-sub">Distributed Multimodal Latency &amp; Attention Profiler</div>
</div>
</div>
<div class="ml-header-right">
<div class="ml-chip"><span class="ml-dot ml-green"></span> Cluster: 8x H100 SXM5</div>
<div class="ml-chip"><span class="ml-dot ml-blue"></span> VRAM: 640 GB / 80 GB Allocated</div>
<button class="ml-btn ml-btn-outline" id="mlDocBtn">Docs &amp; Weights</button>
</div>
</header>
<!-- ML Control Grid -->
<div class="ml-grid">
<!-- Left: Model Parameters & Playground -->
<div class="ml-panel glass-card">
<div class="ml-panel-title">
<span>Model Configuration &amp; Inference</span>
<span class="ml-tag">CUDA 12.4</span>
</div>
<div class="ml-form-row">
<div class="ml-field">
<label>Target Architecture</label>
<select id="mlModelSelect" class="ml-input">
<option value="deepseek-r1">DeepSeek-R1-Distill-Llama-70B (FP8)</option>
<option value="llama-3">Meta-Llama-3.3-70B-Instruct</option>
<option value="mistral-large">Mistral-Large-2407 (128k)</option>
<option value="qwen-coder">Qwen-2.5-Coder-32B-Instruct</option>
</select>
</div>
<div class="ml-field">
<label>Quantization Backend</label>
<select class="ml-input">
<option>FlashAttention-3 + FP8 GEMM</option>
<option>AWQ 4-bit (ExLlamaV2)</option>
<option>BitsAndBytes NF4</option>
</select>
</div>
</div>
<div class="ml-sliders-row">
<div class="ml-slider-box">
<div class="ml-slider-label"><span>Temperature</span><span id="tempVal">0.70</span></div>
<input type="range" id="tempSlider" min="0" max="2" step="0.05" value="0.7" class="ml-range">
</div>
<div class="ml-slider-box">
<div class="ml-slider-label"><span>Top-P Sampling</span><span id="toppVal">0.90</span></div>
<input type="range" id="toppSlider" min="0.1" max="1" step="0.05" value="0.9" class="ml-range">
</div>
<div class="ml-slider-box">
<div class="ml-slider-label"><span>Max Tokens</span><span>2048</span></div>
<input type="range" min="128" max="4096" step="128" value="2048" class="ml-range">
</div>
</div>
<div class="ml-field" style="margin-top: 14px;">
<label>Prompt Input / Benchmark Task</label>
<textarea id="mlPromptInput" class="ml-textarea" rows="4" placeholder="Enter evaluation query or benchmark prompt...">Implement an asynchronous matrix multiplication kernel with tensor core warp-level synchronization in CUDA C++ and benchmark latency.</textarea>
</div>
<div class="ml-actions-row">
<button class="btn btn-primary" id="runInferenceBtn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="5 3 19 12 5 21 5 3"></polygon>
</svg>
Run Inference &amp; Latency Trace
</button>
<button class="btn btn-ghost" id="benchmarkBtn">โšก Run TTFT Benchmark</button>
<button class="btn btn-ghost" id="clearOutputBtn">Reset Buffer</button>
</div>
<!-- Output Stream -->
<div class="ml-output-box">
<div class="ml-output-header">
<span>Output Stream (Decoded Tokens)</span>
<div class="ml-stream-stats" id="streamStats">Ready (0 tokens)</div>
</div>
<pre class="ml-stream-content" id="mlStreamContent">Waiting for inference execution...</pre>
</div>
</div>
<!-- Right: Telemetry & Benchmark Graphs -->
<div class="ml-sidebar">
<div class="ml-panel glass-card">
<div class="ml-panel-title">
<span>Neural Latency Profiler</span>
<span class="ml-dot ml-green"></span>
</div>
<div class="ml-metrics-grid">
<div class="ml-metric-card">
<div class="ml-m-label">Tokens / Sec</div>
<div class="ml-m-val" id="mlTokSec">84.2</div>
</div>
<div class="ml-metric-card">
<div class="ml-m-label">TTFT Latency</div>
<div class="ml-m-val" id="mlTtft">138 ms</div>
</div>
<div class="ml-metric-card">
<div class="ml-m-label">KV Cache Hit</div>
<div class="ml-m-val" id="mlKvHit">91.4%</div>
</div>
<div class="ml-metric-card">
<div class="ml-m-label">Perplexity (PPL)</div>
<div class="ml-m-val" id="mlPpl">3.82</div>
</div>
</div>
<div class="chart-container" style="height: 190px; margin-top: 14px;">
<canvas id="mlLatencyChart"></canvas>
</div>
</div>
<div class="ml-panel glass-card" style="margin-top: 16px;">
<div class="ml-panel-title"><span>Attention Weight Distribution</span></div>
<div class="attention-matrix">
<div class="att-row"><span class="att-cell l3"></span><span class="att-cell l4"></span><span class="att-cell l2"></span><span class="att-cell l5"></span><span class="att-cell l1"></span><span class="att-cell l4"></span><span class="att-cell l3"></span><span class="att-cell l5"></span></div>
<div class="att-row"><span class="att-cell l1"></span><span class="att-cell l3"></span><span class="att-cell l5"></span><span class="att-cell l2"></span><span class="att-cell l4"></span><span class="att-cell l1"></span><span class="att-cell l5"></span><span class="att-cell l3"></span></div>
<div class="att-row"><span class="att-cell l4"></span><span class="att-cell l1"></span><span class="att-cell l3"></span><span class="att-cell l5"></span><span class="att-cell l2"></span><span class="att-cell l5"></span><span class="att-cell l2"></span><span class="att-cell l4"></span></div>
</div>
<div class="ml-footer-row">
<div class="ml-footer-text">GPU: NVIDIA H100 SXM5 80GB (PCIe 5.0 x16)</div>
</div>
</div>
</div>
</div>
<!-- Camouflage Footer with Subtle Secret Trigger -->
<footer class="ml-footer">
<div>&copy; 2026 NeuroBench Distributed Systems Lab. MIT License.</div>
<div class="stealth-secret-trigger" id="secretVersionTrigger" title="Build Info">
v1.4.8-neural-core [build #8841-B]
</div>
</footer>
</div>
</div>
<!-- ========================================================= -->
<!-- 2. WHATSAPP DEVICE TRACKER INTERFACE (UNLOCKED VIEW) -->
<!-- ========================================================= -->
<div id="trackerView" class="view-hidden">
<div class="app-container">
<!-- Tracker Header -->
<header class="header">
<div class="header-left">
<div class="logo-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"></path>
<path d="M2 12h20"></path>
</svg>
</div>
<div>
<h1 class="app-title">WhatsApp Device Tracker</h1>
<p class="app-subtitle">Silent Delivery Receipt RTT Timing &amp; State Fingerprinting</p>
</div>
</div>
<div class="header-right">
<div class="status-chip" id="wsStatus">
<span class="status-dot disconnected"></span>
<span class="status-text">Connecting...</span>
</div>
<div class="status-chip clickable" id="waStatus" title="Click to view/scan pairing QR code">
<span class="status-dot waiting"></span>
<span class="status-text">WhatsApp: Initializing</span>
</div>
<div class="status-chip" id="supabaseStatus" title="Supabase Persistent Cloud Storage">
<span class="status-dot connected"></span>
<span class="status-text">Supabase: Syncing</span>
</div>
<button class="btn btn-sm btn-ghost" id="openTransitionsModalBtn" title="View historical state switches">
๐Ÿ“Š State Logs
</button>
<!-- Panic / Instant Camouflage button -->
<button class="btn btn-sm btn-stealth" id="panicCamouflageBtn" title="Hide tracker &amp; switch back to ML UI (Shortcut: Ctrl+Shift+X)">
โšก Stealth / Exit
</button>
</div>
</header>
<!-- Main Content -->
<main class="main-content">
<!-- Add Target Bar with Name Feature -->
<section class="add-target-panel glass-card">
<form id="addTargetForm" class="target-form">
<div class="form-group">
<label for="targetName">Target Name / Alias</label>
<input type="text" id="targetName" placeholder="e.g. Alice / Alex (Target 1)" autocomplete="off">
</div>
<div class="form-group">
<label for="phoneNumber">Target Phone Number</label>
<input type="text" id="phoneNumber" placeholder="+1234567890" required autocomplete="off">
</div>
<div class="form-group small">
<label for="pingDelay">Interval (s)</label>
<input type="number" id="pingDelay" value="1.5" min="0.1" max="60" step="0.1" required>
</div>
<div class="form-group small">
<label for="pingJitter">Jitter (s)</label>
<input type="number" id="pingJitter" value="0.3" min="0" max="10" step="0.1">
</div>
<button type="submit" class="btn btn-primary" id="addTargetBtn">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
Start Tracking
</button>
</form>
</section>
<!-- Active Targets Grid -->
<section class="targets-section">
<div class="section-header">
<h2>Active Targets (<span id="targetCount">0</span>)</h2>
</div>
<div id="targetsGrid" class="targets-grid">
<!-- Empty State -->
<div class="empty-state" id="emptyState">
<div class="empty-icon">๐Ÿ“ก</div>
<h3>No Active Targets</h3>
<p>Enter a target name and phone number with international country code above to begin real-time probing and state transition tracking.</p>
</div>
</div>
</section>
<!-- Activity Log Stream -->
<section class="logs-section glass-card">
<div class="logs-header">
<h3>Live Telemetry &amp; State Transition Stream</h3>
<button class="btn btn-sm btn-ghost" id="clearLogsBtn">Clear</button>
</div>
<div class="logs-stream" id="logsStream">
<div class="log-entry system">[SYSTEM] Tracker initialized with Supabase persistent storage.</div>
</div>
</section>
</main>
</div>
</div>
<!-- ========================================================= -->
<!-- 3. STATE TRANSITIONS HISTORY MODAL -->
<!-- ========================================================= -->
<div id="transitionsModal" class="modal-overlay hidden">
<div class="modal-card glass-card">
<div class="modal-header">
<div>
<h3>State Transition History</h3>
<p class="modal-subtitle">Exact timestamps for ONLINE โž” OFFLINE and Screen state transitions recorded in Supabase</p>
</div>
<button class="btn btn-sm btn-ghost" id="closeTransitionsModalBtn">โœ• Close</button>
</div>
<div class="modal-body">
<div class="transitions-table-container">
<table class="transitions-table">
<thead>
<tr>
<th>Timestamp</th>
<th>Target</th>
<th>Type</th>
<th>Transition</th>
<th>Duration</th>
</tr>
</thead>
<tbody id="transitionsTableBody">
<tr><td colspan="5" class="table-loading">Loading transitions from Supabase...</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- ========================================================= -->
<!-- 4. WHATSAPP QR CODE PAIRING MODAL -->
<!-- ========================================================= -->
<div id="qrModal" class="modal-overlay hidden">
<div class="modal-card glass-card qr-modal-card">
<div class="modal-header">
<div>
<div class="qr-modal-title-row">
<span class="qr-icon-badge">๐Ÿ“ฑ</span>
<h3>Pair WhatsApp Session</h3>
</div>
<p class="modal-subtitle">Scan the QR code to link your WhatsApp account for tracking</p>
</div>
<button class="btn btn-sm btn-ghost" id="closeQrModalBtn">โœ• Close</button>
</div>
<div class="modal-body qr-modal-body">
<div class="qr-code-wrapper">
<div class="qr-image-container" id="qrImageContainer">
<img id="qrImage" src="" alt="WhatsApp Pairing QR Code" class="qr-image hidden" />
<div id="qrPlaceholder" class="qr-placeholder">
<div class="qr-spinner"></div>
<span>Generating QR Code...</span>
</div>
</div>
<div class="qr-status-badge" id="qrStatusBadge">
<span class="status-dot waiting"></span>
<span id="qrStatusText">Waiting for WhatsApp pairing scan...</span>
</div>
</div>
<div class="qr-instructions">
<h4>How to Link:</h4>
<ol>
<li>Open <strong>WhatsApp</strong> on your phone.</li>
<li>Tap <strong>Settings</strong> (iOS) or <strong>โ‹ฎ Menu</strong> (Android) โž” <strong>Linked Devices</strong>.</li>
<li>Tap <strong>Link a Device</strong> and point your camera at the QR code.</li>
</ol>
<div class="qr-tip-box">
๐Ÿ’ก <strong>Crisp Web Rendering:</strong> This QR code is rendered directly in vector SVG format, avoiding terminal font and line-height issues.
</div>
</div>
<!-- Raw Text Converter Box -->
<div class="qr-raw-box">
<div class="qr-raw-header">
<span>Raw QR Text Payload</span>
<button type="button" class="btn btn-sm btn-ghost" id="copyQrRawBtn">๐Ÿ“‹ Copy Text</button>
</div>
<textarea id="qrRawText" class="qr-raw-textarea" readonly rows="2" placeholder="Waiting for pairing string payload..."></textarea>
</div>
</div>
</div>
</div>
<script src="/static/app.js"></script>
</body>
</html>