<!DOCTYPE html>
<html>
<head>
<title>Security Analyzer WASM Demo</title>
<script type="module">
import init, { WasmSecurityAnalyzer } from '../pkg/spawn_access_control.js';
async function run() {
await init();
const analyzer = new WasmSecurityAnalyzer();
console.log('Version:', analyzer.get_version());
const options = {
enable_pattern_detection: true,
enable_time_series: true,
min_confidence: 0.8,
time_window: 24
};
try {
const testData = await fetch('test-data.json').then(r => r.json());
const result = analyzer.analyze(JSON.stringify(testData), JSON.stringify(options));
displayResults(result);
} catch (error) {
console.error('Analysis failed:', error);
document.getElementById('error').textContent = error.toString();
}
}
function displayResults(result) {
const parsed = JSON.parse(result);
document.getElementById('results').innerHTML = `
<h3>Analysis Results</h3>
<pre>${JSON.stringify(parsed, null, 2)}</pre>
`;
}
window.addEventListener('load', run);
</script>
</head>
<body>
<h1>Security Analyzer WASM Demo</h1>
<div id="error" style="color: red;"></div>
<div id="results"></div>
</body>
</html>