-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
173 lines (150 loc) · 7 KB
/
Copy pathdashboard.html
File metadata and controls
173 lines (150 loc) · 7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html>
<head>
<title>Network-Pinpointer Dashboard</title>
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
<style>
body { margin: 0; padding: 20px; background-color: #111; color: #eee; font-family: 'Segoe UI', sans-serif; }
.header { text-align: center; margin-bottom: 40px; }
h1 { color: #4facfe; margin: 0; }
.subtitle { color: #888; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { background: #222; border-radius: 8px; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.full-width { grid-column: span 2; }
.stats-row { display: flex; justify-content: space-around; margin-bottom: 20px; }
.stat-box { text-align: center; }
.stat-val { font-size: 28px; font-weight: bold; color: #00f260; }
.stat-label { font-size: 14px; color: #aaa; }
h2 { color: #ddd; font-size: 18px; margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #333; }
th { color: #888; font-weight: normal; }
tr:hover { background: #2a2a2a; }
.tag { padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.tag-high { background: #ff0055; color: white; }
.tag-med { background: #ffaa00; color: black; }
.tag-low { background: #00f260; color: black; }
</style>
</head>
<body>
<div class="header">
<h1>Network Semantic Dashboard</h1>
<div class="subtitle">Real-time Semantic Intelligence Overview</div>
</div>
<div class="grid">
<!-- Global Stats -->
<div class="card full-width">
<div class="stats-row">
<div class="stat-box">
<div class="stat-val" id="total-targets">0</div>
<div class="stat-label">Total Targets</div>
</div>
<div class="stat-box">
<div class="stat-val" id="avg-harmony">0%</div>
<div class="stat-label">Avg Harmony</div>
</div>
<div class="stat-box">
<div class="stat-val" id="total-mass">0</div>
<div class="stat-label">Total Semantic Mass</div>
</div>
<div class="stat-box">
<div class="stat-val" id="risk-score">Low</div>
<div class="stat-label">Overall Risk</div>
</div>
</div>
</div>
<!-- Cluster Map -->
<div class="card">
<h2>Semantic Clusters (LJPW)</h2>
<div id="cluster-map" style="height: 400px;"></div>
</div>
<!-- Mass Distribution -->
<div class="card">
<h2>Mass Distribution</h2>
<div id="mass-dist" style="height: 400px;"></div>
</div>
<!-- Top Targets -->
<div class="card full-width">
<h2>Top Targets by Semantic Mass</h2>
<table id="targets-table">
<thead>
<tr>
<th>Target</th>
<th>Mass</th>
<th>Dominant Dimension</th>
<th>Harmony</th>
<th>Security Posture</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<script>
const data = [{"target": "1.1.1.1", "l": 0.3857142857142857, "j": 0.07142857142857142, "p": 0.27142857142857146, "w": 0.27142857142857146, "mass": 4.802608334828188, "harmony": 0.24151063128809813, "dominant": "Love", "posture": "POTENTIALLY_VULNERABLE"}, {"target": "8.8.8.8", "l": 0.3857142857142857, "j": 0.07142857142857142, "p": 0.27142857142857146, "w": 0.27142857142857146, "mass": 4.802608334828188, "harmony": 0.24151063128809813, "dominant": "Love", "posture": "POTENTIALLY_VULNERABLE"}, {"target": "google.com", "l": 0.4476190476190476, "j": 0.09523809523809523, "p": 0.22857142857142856, "w": 0.22857142857142856, "mass": 4.630291484626412, "harmony": 0.23942079595640875, "dominant": "Love", "posture": "POTENTIALLY_VULNERABLE"}];
// 1. Populate Stats
document.getElementById('total-targets').textContent = data.length;
const avgHarmony = data.reduce((a, b) => a + b.harmony, 0) / data.length || 0;
document.getElementById('avg-harmony').textContent = (avgHarmony * 100).toFixed(0) + '%';
const totalMass = data.reduce((a, b) => a + b.mass, 0);
document.getElementById('total-mass').textContent = totalMass.toFixed(1);
// 2. Cluster Map
const traceCluster = {
x: data.map(d => d.l),
y: data.map(d => d.j),
z: data.map(d => d.p),
mode: 'markers',
type: 'scatter3d',
text: data.map(d => d.target),
marker: {
size: data.map(d => 5 + Math.log(d.mass + 1) * 5),
color: data.map(d => d.w),
colorscale: 'Viridis',
opacity: 0.8
}
};
const layoutCluster = {
margin: {l: 0, r: 0, b: 0, t: 0},
paper_bgcolor: '#222',
scene: {
xaxis: { title: 'Love' },
yaxis: { title: 'Justice' },
zaxis: { title: 'Power' }
}
};
Plotly.newPlot('cluster-map', [traceCluster], layoutCluster);
// 3. Mass Distribution
const traceMass = {
x: data.map(d => d.mass),
type: 'histogram',
marker: { color: '#4facfe' }
};
const layoutMass = {
margin: {l: 40, r: 20, b: 40, t: 20},
paper_bgcolor: '#222',
plot_bgcolor: '#222',
font: { color: '#eee' },
xaxis: { title: 'Mass' },
yaxis: { title: 'Count' }
};
Plotly.newPlot('mass-dist', [traceMass], layoutMass);
// 4. Top Targets Table
const sortedData = [...data].sort((a, b) => b.mass - a.mass).slice(0, 10);
const tbody = document.querySelector('#targets-table tbody');
sortedData.forEach(d => {
const tr = document.createElement('tr');
let postureClass = 'tag-low';
if (d.posture.includes('VULNERABLE')) postureClass = 'tag-high';
else if (d.posture.includes('MODERATE')) postureClass = 'tag-med';
tr.innerHTML = `
<td>${d.target}</td>
<td>${d.mass.toFixed(1)}</td>
<td>${d.dominant}</td>
<td>${(d.harmony * 100).toFixed(0)}%</td>
<td><span class="tag ${postureClass}">${d.posture}</span></td>
`;
tbody.appendChild(tr);
});
</script>
</body>
</html>