-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreport.html
More file actions
192 lines (170 loc) · 10.3 KB
/
report.html
File metadata and controls
192 lines (170 loc) · 10.3 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Probe Audit Report</title>
<meta name="description" content="AI Agent API audit report by Probe — compliance, security, and performance analysis.">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%231D9E75'/%3E%3C/svg%3E">
<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&display=swap" rel="stylesheet">
<style>
:root {
--bg-primary: #FAFAFA; --bg-secondary: #FFFFFF; --bg-tertiary: #F5F5F5;
--text-primary: #171717; --text-secondary: #525252; --text-tertiary: #A3A3A3;
--border: #E5E5E5; --border-medium: #D4D4D4;
--green: #1D9E75; --green-light: #E1F5EE; --green-dark: #085041;
--warn: #E5A100; --err: #E53935;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-primary: #0A0A0A; --bg-secondary: #141414; --bg-tertiary: #1C1C1C;
--text-primary: #EDEDED; --text-secondary: #A3A3A3; --text-tertiary: #666;
--border: #262626; --border-medium: #333;
--green-light: #0C2E22;
}
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.5; }
.mono { font-family: 'JetBrains Mono', monospace; }
nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 0.5px solid var(--border); }
.logo { font-weight: 700; font-size: 16px; text-decoration: none; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.logo::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.container { max-width: 720px; margin: 40px auto; padding: 0 20px; }
.loading { text-align: center; padding: 80px 0; color: var(--text-tertiary); }
.error { text-align: center; padding: 80px 0; color: var(--err); }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.report-domain { font-size: 14px; color: var(--text-secondary); }
.report-grade { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 6px; border: 1px solid; }
.summary-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-stat { font-size: 13px; color: var(--text-secondary); padding: 4px 0; }
.card { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.check-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.check-row:last-child { border-bottom: none; }
.check-name { display: flex; align-items: center; gap: 8px; }
.check-val { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-secondary); text-align: right; }
.dot-pass { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
.dot-warn { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: inline-block; }
.dot-fail { width: 6px; height: 6px; border-radius: 50%; background: var(--err); display: inline-block; }
.score-row { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.score-num { font-size: 28px; font-weight: 600; }
.score-bar-wrap { flex: 1; }
.score-bar-track { height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.score-label { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.findings { margin-top: 24px; }
.finding-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px; margin-bottom: 8px; }
.finding-critical { background: #FDE8E8; color: #B91C1C; }
.finding-warning { background: #FFF3CD; color: #92400E; }
.finding-card { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; }
.finding-card strong { font-size: 13px; }
.finding-card p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.action-btn { padding: 10px 20px; border-radius: 8px; border: 0.5px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font-size: 13px; text-decoration: none; cursor: pointer; font-weight: 500; }
.action-btn:hover { border-color: var(--green); color: var(--green); }
.action-btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.action-btn-primary:hover { background: var(--green-dark); color: #fff; }
.badge-code { margin-top: 24px; background: var(--bg-tertiary); border-radius: 8px; padding: 16px; }
.badge-code label { font-size: 12px; color: var(--text-tertiary); display: block; margin-bottom: 8px; }
.badge-code code { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); word-break: break-all; }
.meta { margin-top: 24px; font-size: 12px; color: var(--text-tertiary); text-align: center; }
@media (prefers-color-scheme: dark) {
.finding-critical { background: #3B1010; color: #F87171; }
.finding-warning { background: #3B2E10; color: #FBBF24; }
}
</style>
</head>
<body>
<nav>
<a href="/" class="logo">Probe</a>
<a href="/#pricing" style="font-size:13px;color:var(--text-secondary);text-decoration:none;">Pricing</a>
</nav>
<div class="container" id="content">
<div class="loading" id="loadingState">Loading report...</div>
</div>
<script>
const reportId = window.location.pathname.split('/report/')[1]?.split('/')[0]?.split('?')[0];
if (!reportId) {
document.getElementById('loadingState').innerHTML = '<div class="error">No report ID provided. <a href="/">Run an audit</a></div>';
} else {
loadReport(reportId);
}
async function loadReport(id) {
try {
const res = await fetch(`/api/report/${id}`);
if (!res.ok) throw new Error('Not found');
const r = await res.json();
renderReport(r);
} catch (e) {
document.getElementById('loadingState').innerHTML = `<div class="error">Report not found. <a href="/" style="color:var(--green)">Run a new audit</a></div>`;
}
}
function dotClass(s) {
return s === 'pass' ? 'dot-pass' : s === 'warn' ? 'dot-warn' : 'dot-fail';
}
function renderReport(r) {
const domain = new URL(r.url).hostname;
const sc = r.score >= 75 ? 'var(--green)' : r.score >= 50 ? 'var(--warn)' : 'var(--err)';
document.title = `Probe Report — ${domain} — ${r.grade} ${r.score}/100`;
let checks = r.checks.map(c => `
<div class="check-row">
<span class="check-name"><span class="${dotClass(c.status)}"></span> ${c.name}</span>
<span class="check-val">${c.value}${c.latency ? ' · ' + c.latency + 'ms' : ''}</span>
</div>`).join('');
let findings = '';
if (r.findings && r.findings.length) {
const crit = r.findings.filter(f => f.severity === 'critical');
const warn = r.findings.filter(f => f.severity === 'warning');
findings = '<div class="findings">';
if (crit.length) {
findings += `<span class="finding-badge finding-critical">Critical — ${crit.length}</span>`;
crit.forEach(f => { findings += `<div class="finding-card"><strong>${f.title}</strong><p>${f.description}</p></div>`; });
}
if (warn.length) {
findings += `<span class="finding-badge finding-warning">Warning — ${warn.length}</span>`;
warn.forEach(f => { findings += `<div class="finding-card"><strong>${f.title}</strong><p>${f.description}</p></div>`; });
}
findings += '</div>';
}
const shareUrl = `https://getprobe.xyz/report/${r.id}`;
const badgeUrl = `https://getprobe.xyz/api/badge/${domain}`;
const tweetText = encodeURIComponent(`My API scored ${r.score}/100 on @probecomplianc ✅ ${shareUrl}`);
document.getElementById('content').innerHTML = `
<div class="report-header">
<span class="report-domain mono">${domain}</span>
<span class="report-grade" style="color:${sc};border-color:${sc};background:${sc}11">${r.grade} · ${r.score}/100</span>
</div>
<div class="summary-row">
<span class="summary-stat">${r.summary.pass} passed</span>
<span class="summary-stat">${r.summary.warn} warnings</span>
<span class="summary-stat">${r.summary.fail} failed</span>
<span class="summary-stat mono" style="font-size:11px;color:var(--text-tertiary)">${r.id}</span>
</div>
<div class="card">
${checks}
<div class="score-row">
<span class="score-num" style="color:${sc}">${r.score}</span>
<div class="score-bar-wrap">
<div class="score-bar-track">
<div class="score-bar-fill" style="width:${r.score}%;background:${sc}"></div>
</div>
<div class="score-label">${r.label}</div>
</div>
</div>
</div>
${findings}
<div class="actions">
<a class="action-btn action-btn-primary" href="https://twitter.com/intent/tweet?text=${tweetText}" target="_blank">Share on X</a>
<a class="action-btn" href="/" >Run new audit</a>
<button class="action-btn" onclick="navigator.clipboard.writeText('${shareUrl}');this.textContent='Copied!'">Copy link</button>
</div>
<div class="badge-code">
<label>Add badge to your README:</label>
<code>[](${shareUrl})</code>
</div>
<div class="meta">${new Date(r.timestamp).toLocaleString()} · <a href="https://getprobe.xyz" style="color:var(--green)">getprobe.xyz</a></div>`;
}
</script>
</body>
</html>