mise en place code panda sur html
This commit is contained in:
@@ -257,6 +257,11 @@
|
||||
<span class="a-label">💡 LED</span>
|
||||
<span class="a-sub">Contrôler la LED</span>
|
||||
<span class="a-arrow">›</span>
|
||||
</button>
|
||||
<button class="action-btn" onclick="callAlarm()">
|
||||
<span class="a-label">💡 Alarme</span>
|
||||
<span class="a-sub">Contrôler la alarme</span>
|
||||
<span class="a-arrow">›</span>
|
||||
</button>
|
||||
<button class="action-btn" onclick="showToast('Fonction à venir...')">
|
||||
<span class="a-label">⚙️ Paramètres</span>
|
||||
@@ -292,7 +297,8 @@
|
||||
updateClock();
|
||||
setInterval(updateClock, 1000);
|
||||
|
||||
async function callLed() {
|
||||
|
||||
async function callLed() {
|
||||
try {
|
||||
const res = await fetch('/led', {
|
||||
method: 'POST',
|
||||
@@ -302,6 +308,16 @@
|
||||
} catch {
|
||||
showToast("Erreur lors de l'appel LED.");
|
||||
}
|
||||
} async function callAlarm() {
|
||||
try {
|
||||
const res = await fetch('/alarme', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
showToast("alarme activée !");
|
||||
} catch {
|
||||
showToast("Erreur lors de l'appel alarme.");
|
||||
}
|
||||
}
|
||||
|
||||
function go_admin() {
|
||||
|
||||
Reference in New Issue
Block a user