<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>CyberWASM Security & Blog Genie</title>
<style>
body { background: #0d1117; color: #58a6ff; font-family: monospace; padding: 20px; }
#terminal { background: #161b22; border: 1px: solid #30363d; padding: 15px; height: 400px; overflow-y: scroll; border-radius: 6px; }
input { background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; width: 100%; padding: 10px; font-family: monospace; margin-top: 10px; }
</style>
</head>
<body>
<h2>CyberWASM Security Core + Blog Genie 🧞</h2>
<div id="terminal"></div>
<input type="text" id="commandInput" placeholder="Wpisz komendę (np. help, ia, ask gl, status)..." autofocus>
<script>
let Module = {
onRuntimeInitialized: function() {
logToTerminal("Inicjalizacja środowiska WebAssembly zakończona pomyślnie.");
// Automatyczne pobranie IP klienta (opcjonalnie)
fetch('https://api.ipify.org?format=json')
.then(res => res.json())
.then(data => {
let result = Module.ccall('process_client_ip', 'string', ['string'], [data.ip]);
logToTerminal("> " + result);
}).catch(() => logToTerminal("> [IP] Tryb offline / lokalny"));
}
};
function logToTerminal(text) {
const term = document.getElementById('terminal');
term.innerHTML += `<div>${text}</div>`;
term.scrollTop = term.scrollHeight;
}
document.getElementById('commandInput').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
let cmd = this.value;
logToTerminal("> " + cmd);
this.value = '';
// Wywołanie funkcji C++ przez ccall!
try {
let response = Module.ccall('execute_shell_command', 'string', ['string'], [cmd]);
logToTerminal(response);
} catch (err) {
logToTerminal("Błąd wykonania w C++: " + err);
}
}
});
</script>
<!-- Skrypt wygenerowany przez Emscripten -->
<script src="index.js"></script>
</body>
</html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>CyberWASM Security & Blog Genie</title>
<style>
body { background: #0d1117; color: #58a6ff; font-family: monospace; padding: 20px; }
#terminal { background: #161b22; border: 1px: solid #30363d; padding: 15px; height: 400px; overflow-y: scroll; border-radius: 6px; }
input { background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; width: 100%; padding: 10px; font-family: monospace; margin-top: 10px; }
</style>
</head>
<body>
<h2>CyberWASM Security Core + Blog Genie 🧞</h2>
<div id="terminal"></div>
<input type="text" id="commandInput" placeholder="Wpisz komendę (np. help, ia, ask gl, status)..." autofocus>
<script>
let Module = {
onRuntimeInitialized: function() {
logToTerminal("Inicjalizacja środowiska WebAssembly zakończona pomyślnie.");
// Automatyczne pobranie IP klienta (opcjonalnie)
fetch('https://api.ipify.org?format=json')
.then(res => res.json())
.then(data => {
let result = Module.ccall('process_client_ip', 'string', ['string'], [data.ip]);
logToTerminal("> " + result);
}).catch(() => logToTerminal("> [IP] Tryb offline / lokalny"));
}
};
function logToTerminal(text) {
const term = document.getElementById('terminal');
term.innerHTML += `<div>${text}</div>`;
term.scrollTop = term.scrollHeight;
}
document.getElementById('commandInput').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
let cmd = this.value;
logToTerminal("> " + cmd);
this.value = '';
// Wywołanie funkcji C++ przez ccall!
try {
let response = Module.ccall('execute_shell_command', 'string', ['string'], [cmd]);
logToTerminal(response);
} catch (err) {
logToTerminal("Błąd wykonania w C++: " + err);
}
}
});
</script>
<!-- Skrypt wygenerowany przez Emscripten -->
<script src="index.js"></script>
</body>
</html>
No comments:
Post a Comment