-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
57 lines (51 loc) · 2.84 KB
/
Copy patheditor.html
File metadata and controls
57 lines (51 loc) · 2.84 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"><title>Workspace Editor</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>body{background:#0f172a; color:#e2e8f0;}</style>
</head>
<body>
<div class="container py-5">
<div class="card bg-dark border-secondary p-4 mx-auto" style="max-width: 750px shadow;">
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="text-info m-0">💻 Core Analysis Desk</h4>
<span class="badge bg-secondary">User: {{ user.name }}</span>
</div>
<textarea id="targetBox" class="form-control bg-black text-info border-secondary mb-4 p-3 font-monospace" rows="12" placeholder="// Drop script components here for testing diagnostics..."></textarea>
<div class="d-flex gap-3">
<a href="/guest/history" class="btn btn-outline-secondary px-4">← Back to History</a>
<button id="scanButton" class="btn btn-info text-white flex-grow-1 fw-bold">Run Diagnostics Processing Array</button>
</div>
</div>
</div>
<script>
document.getElementById('scanButton').addEventListener('click', async () => {
const code = document.getElementById('targetBox').value;
if(!code.trim()) return alert("Error: Core matrix targets cannot receive null text.");
const btn = document.getElementById('scanButton');
btn.disabled = true;
btn.innerText = "Processing security validation registers...";
try {
const response = await fetch('/scan', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code: code })
});
const data = await response.json();
// Track state within persistence registers
sessionStorage.setItem("currentReport", data.ai_security_report);
sessionStorage.setItem("currentAlert", data.regex_secret_alert ? "FAIL" : "PASS");
sessionStorage.setItem("currentScore", data.security_score);
sessionStorage.setItem("currentRuntime", data.runtime_ms || "142");
sessionStorage.setItem("currentMemory", data.memory_mb || "24.8");
window.location.href = "/dashboard";
} catch(e) {
alert("Operation throttled or connection failure tracking pipeline elements.");
btn.disabled = false;
btn.innerText = "Run Diagnostics Processing Array";
}
});
</script>
</body>
</html>