0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-11-16 10:47:55 +01:00

Remove old www files.

This commit is contained in:
Wouter R 2013-07-27 02:44:12 +02:00
parent 5746d244d7
commit 827affd4e4
7 changed files with 0 additions and 238 deletions

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/admin/wifibox.html" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" href="/admin/wifibox.html">Doodle 3D - Wireless Network Configuration</a>
</body>
</html>

View File

@ -1,7 +0,0 @@
<head>
<title>temp admin index</title>
</head>
<html><body>
<a href="updater.html">Updates</a><br />
<a href="wifibox.html">Wireless network management</a><br />
</body></html>

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
body {
width: 80%;
background-color: #ffe;
}
.catgroup {
border: 1px solid black;
padding: 0.5em;
margin-bottom: 10px;
background-color: white;
-moz-border-radius: 5px;
border-radius: 5px;
}
.cattitle {
display: block;
margin-left: 3em;
margin-bottom: 10px;
font-weight: bold;
}
table.known_nets {
width: 100%;
}
table.known_nets th, table.known_nets td {
width: 33%;
}
.result_success {
font-weight: bold;
color: black;
}
.result_error {
font-weight: normal;
color: red;
}
.hidden {
display: none;
}

View File

@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<title>Wireless configuration</title>
<script type="text/javascript" src="/admin/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/admin/wifibox.js"></script>
<link href="/admin/wifibox.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="catgroup hidden">
<div id="op_result"></div>
</div>
<div class="catgroup">
<span class="cattitle">WiFi mode</span>
<div id="wlan_state"></div>
</div>
<div class="catgroup">
<span class="cattitle">Available networks</span>
<form>
<select id="wlan_networks">
<option value="" disabled selected>Scanning for networks...</option>
</select>
<input id="wlan_passphrase" placeholder="passphrase" value="" type="password" />
<input id="wlan_btn_connect" disabled type="button" value="Connect" />
</form>
</div>
<div class="catgroup">
<span class="cattitle">Known networks</span>
<div id="wlan_known_container"></div>
</div>
</body>
</html>

View File

@ -1,137 +0,0 @@
animSpeed = 200;
cgiBase = "../cgi-bin/wfcf";
function setResultNeutral(text) {
c = $("#op_result"); p = c.parent();
c.removeClass("result_success").removeClass("result_error").html(text);
if (text == "") p.hide(animSpeed);
else p.show(animSpeed);
}
/*
* Sets div#op_result content to text, assigns appropiate class based on isError and display: block or, with empty text, display:none.
*/
function setResult(text, isError) {
container = $("#op_result");
parent = container.parent();
if (isError) container.removeClass("result_success").addClass("result_error");
else container.removeClass("result_error").addClass("result_success");
if (isError) title = "<i>Error</i><br />\n";
else title = "<i>Success</i><br />\n";
container.html(title + text);
if (text == "") parent.hide(animSpeed);
else parent.show(animSpeed);
}
//Returns an array with key 'status' (OK/WARN/ERR), 'msg' (can be empty) and 'status' (remainder of data)
function parseResponse(response) {
var r = {};
var lines = response.split("\n");
var st = lines[0].trim().split(',');
lines = lines.slice(1);
r['status'] = st[0];
r['msg'] = st.slice(1).join(",");
r['payload'] = lines.join("\n");
return r;
}
function parseNetLine(line) {
var r = {};
line = line.trim().split(",");
r.ssid = line[0];
r.bssid = line[1];
r.channel = line[2];
r.mode = line[3];
r.encryption = line[4];
return r;
}
function fetchNetworkState() {
$.get(cgiBase + "?op=getstate", function(data) {
data = parseResponse(data);
if (data.status == "ERR") setResult(data.msg, true);
var net = parseNetLine(data.payload);
var modeText = "Unknown device mode ('" + net.mode + "')";
if (net.mode == "ap") {
$("#wlan_state").text("Access point mode");
} else if (net.mode == "sta") {
$("#wlan_state").text("Client mode (SSID: " + net.ssid + "; BSSID: " + net.bssid + "; channel: " + net.channel + ")");
}
});
}
function fetchAvailableNetworks() {
$.get(cgiBase + "?op=getavl", function(data) {
data = parseResponse(data);
if (data.status == "ERR") setResult(data.msg, true);
// else setResult(data.msg, false);
data = data.payload.split("\n");
var options = $("#wlan_networks");
options.empty();
$.each(data, function(index,value) {
if (value != "") {
var netinf = parseNetLine(value);
var ssid = netinf.ssid;
options.append($("<option />").val(ssid).text(ssid + " - " + netinf.mode + " mode" + "(encryption: " + netinf.encryption + ")"));
}
});
$("#wlan_btn_connect").prop('disabled', false);
});
}
function fetchKnownNetworks() {
$.get(cgiBase + "?op=getknown", function(data) {
data = parseResponse(data);
if (data.status == "ERR") setResult(data.msg, true);
data = data.payload.split("\n");
var container = $("#wlan_known_container");
container.empty();
container.append("<table class=\"known_nets\"><tr><th>SSID</th><th>BSSID</th><th>channel</th></tr></table>");
var tbl = container.find("table");
$.each(data, function(index,value) {
if (value != "") {
net = parseNetLine(value);
console.log(net);
tbl.append("<tr><td>" + net.ssid + "</td><td>" + net.bssid + "</td><td>" + net.channel + "</td></tr>");
}
});
});
}
function connectBtnHandler() {
setResultNeutral("Associating with network...");
ssid = $("#wlan_networks").find(":selected").text();
phrase = $("#wlan_passphrase").val();
if (ssid == "") {
alert("Please select a network");
return;
}
$.get(cgiBase + "?op=assoc&ssid=" + ssid + "&phrase=" + phrase, function(data) {
data = parseResponse(data);
if (data.status == "ERR") {
setResult(data.msg, true);
} else {
if (data.msg != "") setResult(data.msg, false);
else setResult("Associated! (or are we?)", false);
}
fetchKnownNetworks();
});
return;
}
$(document).ready(function() {
fetchNetworkState();
fetchAvailableNetworks();
fetchKnownNetworks();
$("#wlan_btn_connect").click(connectBtnHandler);
});