Files
wevads-platform/scripts/weval-mind-ssh.php
2026-02-26 04:53:11 +01:00

102 lines
5.1 KiB
PHP
Executable File

<?php require_once __DIR__ . '/hamid-providers-config.php'; ?>
<?php header('Content-Type: text/html; charset=UTF-8'); ?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WEVAL MIND SSH - Secure Shell AI</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Fira Code', 'Consolas', monospace; background: #000; color: #0f0; height: 100vh; display: flex; flex-direction: column; }
.ssh-bar { background: linear-gradient(180deg, #444 0%, #222 100%); padding: 5px 15px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: #fff; }
.ssh-bar .conn { color: #0f0; }
.ssh-bar select { background: #333; color: #0f0; border: 1px solid #555; padding: 3px 8px; font-family: inherit; font-size: 11px; }
.ssh-bar .right { margin-left: auto; color: #888; }
.screen { flex: 1; padding: 15px; overflow-y: auto; background: #000; font-size: 13px; line-height: 1.6; }
.screen .line { margin-bottom: 3px; }
.screen .prompt { color: #0ff; }
.screen .response { color: #0f0; }
.screen .info { color: #ff0; }
.screen .err { color: #f00; }
.screen .dim { color: #666; }
.cmd-line { display: flex; padding: 10px 15px; background: #111; border-top: 1px solid #333; }
.cmd-line span { color: #0ff; margin-right: 8px; }
.cmd-line input { flex: 1; background: transparent; border: none; color: #0f0; font-family: inherit; font-size: 13px; outline: none; }
.blink { animation: blink 0.7s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.matrix { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.03; z-index: -1; }
</style>
</head>
<body>
<div class="ssh-bar">
<span class="conn">● Connected</span>
<span>hamid@89.167.40.150</span>
<?php echo hamid_providers_dropdown("cerebras", "provider", ""); ?>
<span class="right">SSH-2.0-WEVAL MIND_AI | Encrypted</span>
</div>
<div class="screen" id="screen">
<div class="line info">╔══════════════════════════════════════════════════════════════╗</div>
<div class="line info">║ WEVAL MIND SSH - Secure AI Shell v2.0 ║</div>
<div class="line info">║ Connection: Encrypted AES-256 | Auth: Verified ║</div>
<div class="line info">╚══════════════════════════════════════════════════════════════╝</div>
<div class="line dim">Last login: <?= date('D M j H:i:s Y') ?> from 127.0.0.1</div>
<div class="line"></div>
<div class="line response">Welcome to WEVAL MIND Secure Shell.</div>
<div class="line response">Type your queries. Use 'exit' to disconnect.</div>
<div class="line"></div>
</div>
<div class="cmd-line">
<span>hamid@ai:~$</span>
<input type="text" id="cmd" autofocus autocomplete="off">
<span class="blink">█</span>
</div>
<script>
const screen = document.getElementById('screen');
const cmd = document.getElementById('cmd');
let session = 'ssh_' + Date.now();
cmd.addEventListener('keypress', e => { if (e.key === 'Enter') run(); });
function log(text, cls='response') {
const div = document.createElement('div');
div.className = 'line ' + cls;
div.textContent = text;
screen.appendChild(div);
screen.scrollTop = screen.scrollHeight;
}
function run() {
const q = cmd.value.trim();
if (!q) return;
log('hamid@ai:~$ ' + q, 'prompt');
cmd.value = '';
if (q === 'exit') { log('Connection closed.', 'info'); cmd.disabled = true; return; }
if (q === 'whoami') { log('hamid (AI Superintelligence)', 'response'); return; }
if (q === 'uname -a') { log('WEVAL MIND-AI 2.0 x86_64 GNU/Linux', 'response'); return; }
log('Processing...', 'dim');
fetch('/hamid-api.php', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ message: q, provider: document.getElementById('provider').value, session_id: session })
})
.then(r => r.json())
.then(data => {
screen.lastChild.remove();
if (data.error) { log('ERROR: ' + data.error, 'err'); }
else {
data.response.split('\n').forEach(line => log(line));
log(`[${data.provider}|${data.duration}ms|KB:${data.kb_count}]`, 'dim');
}
})
.catch(e => log('Connection error: ' + e.message, 'err'));
}
</script>
</body>
</html>