Initial commit

This commit is contained in:
gabatxo1312 2026-08-03 17:55:45 +02:00
commit 5b7c26cec8
5 changed files with 822 additions and 0 deletions

35
public/index.html Normal file
View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Contrôle PC de bureau</title>
</head>
<body style="font-family: sans-serif; text-align:center; margin-top:100px;">
<h1>Contrôle du PC de bureau</h1>
<button onclick="action('wake')" style="font-size:24px; padding:20px 40px; margin:10px;">
🔌 Allumer
</button>
<button onclick="confirmShutdown()" style="font-size:24px; padding:20px 40px; margin:10px; background:#c00; color:white;">
⏻ Éteindre
</button>
<p id="status"></p>
<script>
function action(type) {
fetch('/' + type, { method: 'POST' })
.then(r => r.json())
.then(d => document.getElementById('status').innerText = d.message)
.catch(err => document.getElementById('status').innerText = 'Erreur: ' + err);
}
function confirmShutdown() {
if (confirm("T'es sûr de vouloir éteindre le PC ?")) {
action('shutdown');
}
}
</script>
</body>
</html>