1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Interface Wi-Fi</title>
<meta name="author" content="J">
<meta name="description" content="Interface de programation de l'interface Wi-Fi.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="shortcut icon" href="./game.ico" type="image/x-icon" /> -->
<link rel="stylesheet" href="milligram.css">
<link rel="stylesheet" href="style.css">
</head>
<body id="body" onload="start()">
<header>
</header>
<div class="container">
<div class="row">
<div class="column">
<!-- <form method="GET" action="/api"> -->
<label for="SSID">Reseaux Wi-Fi</label>
<select id="SSID" name="ssid"></select>
<label for="PSK">Mot de Passe Wi-Fi</label>
<input type="text" id="PSK" name="psk" value="">
<button onClick="envoie();" class="button-primary" >Envoyer</button>
<label for="rSSID">SSID</label>
<input type="text" id="rSSID" name="rssid" value="" readonly="readonly">
<label for="rPSK">PSK</label>
<input type="text" id="rPSK" name="rPSK" value="" readonly="readonly">
<button onClick="start();" class="button-primary">Rafraichir</button>
<button onclick="window.location.href='/configWF.html';">Configuration Manuel</button>
<button onclick="window.location.href='/ConfigAff.html';">Retour Wi-Fi</button>
</div>
</div>
</div>
</body>
<script type="text/javascript">
function start() {
var Str = "api?ssid=0&psk=0&renvoie=0";
SendHTTPRequest2(Str);
}
function SendHTTPRequest2(str) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("SSID").innerHTML = this.responseText;
}
}
xmlhttp.open("GET", str);
xmlhttp.send(null);
}
function envoie() {
var SSID = document.getElementById("SSID").value;
var PSK = document.getElementById("PSK").value;
var Str = "api?ssid="+SSID;
var data = Str+"&psk="+PSK;
SendHTTPRequest3(data);
}
function SendHTTPRequest3(str) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
Rep = this.responseText.split("\t");
document.getElementById("rSSID").value = Rep[0];
document.getElementById("rPSK").value = Rep[1];
}
}
xmlhttp.open("GET", str);
xmlhttp.send(null);
}
</script> |
Partager