| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 |
<title>LooseCannon Analytics Dashboard</title> |
| 7 |
<link rel="stylesheet" href="styles.css"> |
| 8 |
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="dashboard"> |
| 12 |
<!-- Header --> |
| 13 |
<header class="dashboard-header"> |
| 14 |
<div class="header-content"> |
| 15 |
<h1>LooseCannon Command Center</h1> |
| 16 |
<div class="server-status"> |
| 17 |
<span class="status-indicator" id="serverStatus"></span> |
| 18 |
<span>Server: <span id="serverUrl">localhost:8765</span></span> |
| 19 |
</div> |
| 20 |
</div> |
| 21 |
</header> |
| 22 |
|
| 23 |
<!-- Main Grid --> |
| 24 |
<main class="dashboard-main"> |
| 25 |
<!-- Stats Cards --> |
| 26 |
<section class="stats-grid"> |
| 27 |
<div class="stat-card"> |
| 28 |
<div class="stat-value" id="totalMessages">0</div> |
| 29 |
<div class="stat-label">Messages Processed</div> |
| 30 |
<div class="stat-trend" id="messageTrend">+0%</div> |
| 31 |
</div> |
| 32 |
|
| 33 |
<div class="stat-card danger"> |
| 34 |
<div class="stat-value" id="scammersDetected">0</div> |
| 35 |
<div class="stat-label">Scammers Detected</div> |
| 36 |
<div class="stat-trend" id="scammerTrend">+0%</div> |
| 37 |
</div> |
| 38 |
|
| 39 |
<div class="stat-card success"> |
| 40 |
<div class="stat-value" id="activeSessions">0</div> |
| 41 |
<div class="stat-label">Active Sessions</div> |
| 42 |
<div class="stat-indicator"> |
| 43 |
<span class="pulse"></span> |
| 44 |
Live |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
|
| 48 |
<div class="stat-card info"> |
| 49 |
<div class="stat-value" id="responseTime">0ms</div> |
| 50 |
<div class="stat-label">Avg Response Time</div> |
| 51 |
<div class="stat-trend" id="responseTrend">↓ 0%</div> |
| 52 |
</div> |
| 53 |
</section> |
| 54 |
|
| 55 |
<!-- Real-time Activity Feed --> |
| 56 |
<section class="activity-section"> |
| 57 |
<h2>Live Activity</h2> |
| 58 |
<div class="activity-feed" id="activityFeed"> |
| 59 |
<div class="activity-item"> |
| 60 |
<span class="activity-time">Waiting for activity...</span> |
| 61 |
<span class="activity-message">System ready</span> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
</section> |
| 65 |
|
| 66 |
<!-- Charts Section --> |
| 67 |
<section class="charts-section"> |
| 68 |
<div class="chart-container"> |
| 69 |
<h3>Message Volume (24h)</h3> |
| 70 |
<canvas id="volumeChart"></canvas> |
| 71 |
</div> |
| 72 |
|
| 73 |
<div class="chart-container"> |
| 74 |
<h3>Scammer Detection Rate</h3> |
| 75 |
<canvas id="detectionChart"></canvas> |
| 76 |
</div> |
| 77 |
|
| 78 |
<div class="chart-container"> |
| 79 |
<h3>Platform Distribution</h3> |
| 80 |
<canvas id="platformChart"></canvas> |
| 81 |
</div> |
| 82 |
|
| 83 |
<div class="chart-container"> |
| 84 |
<h3>Response Times</h3> |
| 85 |
<canvas id="responseChart"></canvas> |
| 86 |
</div> |
| 87 |
</section> |
| 88 |
|
| 89 |
<!-- Active Conversations --> |
| 90 |
<section class="conversations-section"> |
| 91 |
<h2>Active Conversations</h2> |
| 92 |
<div class="conversations-grid" id="conversationsGrid"> |
| 93 |
<div class="conversation-card"> |
| 94 |
<div class="conversation-header"> |
| 95 |
<span class="platform-badge whatsapp">WhatsApp</span> |
| 96 |
<span class="conversation-id">No active conversations</span> |
| 97 |
</div> |
| 98 |
<div class="conversation-stats"> |
| 99 |
<span>Messages: 0</span> |
| 100 |
<span>Score: 0.0</span> |
| 101 |
<span>Duration: 0m</span> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
</section> |
| 106 |
|
| 107 |
<!-- Screenshot Evidence --> |
| 108 |
<section class="evidence-section"> |
| 109 |
<h2>Recent Evidence</h2> |
| 110 |
<div class="evidence-grid" id="evidenceGrid"> |
| 111 |
<div class="evidence-placeholder"> |
| 112 |
No screenshots captured yet |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
</section> |
| 116 |
|
| 117 |
<!-- Pattern Learning --> |
| 118 |
<section class="patterns-section"> |
| 119 |
<h2>Learned Patterns</h2> |
| 120 |
<div class="patterns-container"> |
| 121 |
<div class="pattern-stats"> |
| 122 |
<div class="pattern-stat"> |
| 123 |
<span class="pattern-value" id="totalPatterns">0</span> |
| 124 |
<span class="pattern-label">Patterns Identified</span> |
| 125 |
</div> |
| 126 |
<div class="pattern-stat"> |
| 127 |
<span class="pattern-value" id="patternAccuracy">0%</span> |
| 128 |
<span class="pattern-label">Detection Accuracy</span> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
<div class="patterns-list" id="patternsList"> |
| 132 |
<div class="pattern-item"> |
| 133 |
<span class="pattern-type">No patterns learned yet</span> |
| 134 |
<span class="pattern-count">0 occurrences</span> |
| 135 |
</div> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
</section> |
| 139 |
|
| 140 |
<!-- Controls --> |
| 141 |
<section class="controls-section"> |
| 142 |
<h2>System Controls</h2> |
| 143 |
<div class="controls-grid"> |
| 144 |
<button class="control-btn primary" id="exportBtn"> |
| 145 |
Export Data |
| 146 |
</button> |
| 147 |
<button class="control-btn danger" id="emergencyStop"> |
| 148 |
Emergency Stop All |
| 149 |
</button> |
| 150 |
<button class="control-btn" id="clearDataBtn"> |
| 151 |
Clear Old Data |
| 152 |
</button> |
| 153 |
<button class="control-btn" id="syncBtn"> |
| 154 |
Sync Patterns |
| 155 |
</button> |
| 156 |
<button class="control-btn success" id="personalityBtn"> |
| 157 |
Personality Builder |
| 158 |
</button> |
| 159 |
<button class="control-btn info" id="replayBtn"> |
| 160 |
Conversation Replay |
| 161 |
</button> |
| 162 |
</div> |
| 163 |
</section> |
| 164 |
</main> |
| 165 |
|
| 166 |
<!-- Footer --> |
| 167 |
<footer class="dashboard-footer"> |
| 168 |
<div class="footer-content"> |
| 169 |
<span>LooseCannon v0.3.0</span> |
| 170 |
<span>Uptime: <span id="uptime">0h 0m</span></span> |
| 171 |
<span>Last Updated: <span id="lastUpdated">Never</span></span> |
| 172 |
</div> |
| 173 |
</footer> |
| 174 |
</div> |
| 175 |
|
| 176 |
<!-- Personality Builder Modal --> |
| 177 |
<div class="modal" id="personalityModal"> |
| 178 |
<div class="modal-content"> |
| 179 |
<div class="modal-header"> |
| 180 |
<h2>Personality Builder</h2> |
| 181 |
<button class="modal-close" id="modalClose">×</button> |
| 182 |
</div> |
| 183 |
<div class="modal-body"> |
| 184 |
<form id="personalityForm"> |
| 185 |
<div class="form-group"> |
| 186 |
<label>Personality Name</label> |
| 187 |
<input type="text" id="personalityName" placeholder="e.g., Overly Helpful"> |
| 188 |
</div> |
| 189 |
<div class="form-group"> |
| 190 |
<label>System Prompt</label> |
| 191 |
<textarea id="systemPrompt" rows="6" placeholder="Describe the personality traits and behavior..."></textarea> |
| 192 |
</div> |
| 193 |
<div class="form-group"> |
| 194 |
<label>Temperature (0.1 - 1.0)</label> |
| 195 |
<input type="range" id="temperature" min="0.1" max="1" step="0.1" value="0.8"> |
| 196 |
<span id="tempValue">0.8</span> |
| 197 |
</div> |
| 198 |
<div class="form-group"> |
| 199 |
<label>Example Responses</label> |
| 200 |
<textarea id="examples" rows="4" placeholder="One example per line..."></textarea> |
| 201 |
</div> |
| 202 |
<div class="form-buttons"> |
| 203 |
<button type="button" class="btn secondary" id="testPersonality">Test</button> |
| 204 |
<button type="submit" class="btn primary">Save Personality</button> |
| 205 |
</div> |
| 206 |
</form> |
| 207 |
<div class="test-output" id="testOutput"></div> |
| 208 |
</div> |
| 209 |
</div> |
| 210 |
</div> |
| 211 |
|
| 212 |
<!-- Conversation Replay Modal --> |
| 213 |
<div class="modal" id="replayModal"> |
| 214 |
<div class="modal-content"> |
| 215 |
<div class="modal-header"> |
| 216 |
<h2>Conversation Replay</h2> |
| 217 |
<button class="modal-close" id="replayClose">×</button> |
| 218 |
</div> |
| 219 |
<div class="modal-body"> |
| 220 |
<select id="conversationSelect"> |
| 221 |
<option>Select a conversation...</option> |
| 222 |
</select> |
| 223 |
<div class="replay-container" id="replayContainer"> |
| 224 |
<div class="replay-controls"> |
| 225 |
<button id="playBtn">▶ Play</button> |
| 226 |
<button id="pauseBtn">⏸ Pause</button> |
| 227 |
<button id="speedBtn">Speed: 1x</button> |
| 228 |
<input type="range" id="replayProgress" min="0" max="100" value="0"> |
| 229 |
</div> |
| 230 |
<div class="replay-messages" id="replayMessages"></div> |
| 231 |
<div class="replay-stats" id="replayStats"> |
| 232 |
<span>Messages: 0</span> |
| 233 |
<span>Duration: 0m</span> |
| 234 |
<span>Scammer Score: 0.0</span> |
| 235 |
</div> |
| 236 |
</div> |
| 237 |
</div> |
| 238 |
</div> |
| 239 |
</div> |
| 240 |
|
| 241 |
<script src="dashboard.js" type="module"></script> |
| 242 |
</body> |
| 243 |
</html> |