82 lines
2.4 KiB
HTML
82 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Console VM {{ vm_id }} - Proxmox Manager</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
background: #1a1a2e;
|
|
overflow: hidden;
|
|
}
|
|
#console-container {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
position: relative;
|
|
}
|
|
iframe {
|
|
width: 100%;
|
|
height: 100%;
|
|
border: none;
|
|
}
|
|
.loading {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
text-align: center;
|
|
color: white;
|
|
}
|
|
.spinner {
|
|
border: 4px solid rgba(255, 255, 255, 0.1);
|
|
border-top: 4px solid #667eea;
|
|
border-radius: 50%;
|
|
width: 50px;
|
|
height: 50px;
|
|
animation: spin 1s linear infinite;
|
|
margin: 0 auto 1rem;
|
|
}
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="console-container">
|
|
<div class="loading">
|
|
<div class="spinner"></div>
|
|
<p>Caricamento console...</p>
|
|
</div>
|
|
<iframe id="console-iframe" style="display: none;"></iframe>
|
|
</div>
|
|
|
|
<script>
|
|
// Costruisci URL console Proxmox (usa URL pubblico via reverse proxy)
|
|
const consoleUrl = `{{ config.PROXMOX_PUBLIC_URL }}/?console={{ console_type }}&novnc=1&node={{ node }}&resize=scale&vmid={{ vm_id }}&port={{ port }}`;
|
|
|
|
const iframe = document.getElementById('console-iframe');
|
|
const loading = document.querySelector('.loading');
|
|
|
|
// Carica console nell'iframe
|
|
iframe.onload = function() {
|
|
loading.style.display = 'none';
|
|
iframe.style.display = 'block';
|
|
};
|
|
|
|
iframe.onerror = function() {
|
|
loading.innerHTML = '<p style="color: #ff6b6b;">Errore caricamento console. Riprova.</p>';
|
|
};
|
|
|
|
// Imposta src per caricare
|
|
iframe.src = consoleUrl;
|
|
</script>
|
|
</body>
|
|
</html>
|