|
@@ -1,9 +1,12 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
<html lang="en" xml:lang="en">
|
|
<html lang="en" xml:lang="en">
|
|
|
- <head>
|
|
|
|
|
- <link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
|
|
|
|
|
|
+ <head>
|
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
|
+ <title>WLAN Configuration</title>
|
|
|
|
|
+<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
|
|
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
|
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
|
|
<script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
|
|
<script type="text/javascript" src="firework.js?v=$COMMIT_HASH"></script>
|
|
|
- <script type="text/javascript" src="/common.js?v=$COMMIT_HASH">
|
|
|
|
|
|
|
+ <script type="text/javascript" src="/common.js?v=$COMMIT_HASH"></script>
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
|
<table>
|
|
<table>
|
|
@@ -19,26 +22,28 @@
|
|
|
<button class="button" type="button" onclick="wr();">Write wlan.ini</button>
|
|
<button class="button" type="button" onclick="wr();">Write wlan.ini</button>
|
|
|
<input id="newfile" type="file">
|
|
<input id="newfile" type="file">
|
|
|
<button class="button" style="width:300px" id="doUpdate" type="button" onclick="upload()">Upload Files</button>
|
|
<button class="button" style="width:300px" id="doUpdate" type="button" onclick="upload()">Upload Files</button>
|
|
|
|
|
+<p id="status"></p>
|
|
|
|
|
+<p id="progress"></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
-<script language="JavaScript">function wr(){
|
|
|
|
|
|
|
+<script type="text/javascript">
|
|
|
|
|
+function wr(){
|
|
|
api = "/config?"+"ssid"+document.getElementById("ssid").value+"&pwd="+document.getElementById("password").value;+"&hn="+document.getElementById("hostname").value;+"&ip="+document.getElementById("ip").value;+"&gw="+document.getElementById("gateway").value;+"&nm="+document.getElementById("netmask").value;+"&dns="+document.getElementById("dns").value;+"&rssi="+document.getElementById("threshold").value;
|
|
api = "/config?"+"ssid"+document.getElementById("ssid").value+"&pwd="+document.getElementById("password").value;+"&hn="+document.getElementById("hostname").value;+"&ip="+document.getElementById("ip").value;+"&gw="+document.getElementById("gateway").value;+"&nm="+document.getElementById("netmask").value;+"&dns="+document.getElementById("dns").value;+"&rssi="+document.getElementById("threshold").value;
|
|
|
fetch(api);}
|
|
fetch(api);}
|
|
|
|
|
|
|
|
|
|
|
|
|
// var xhttp = new XMLHttpRequest();
|
|
// var xhttp = new XMLHttpRequest();
|
|
|
// xhttp.onreadystatechange = function() {if (xhttp.readyState == 4) {if (xhttp.status == 200) {document.reload();}}};
|
|
// xhttp.onreadystatechange = function() {if (xhttp.readyState == 4) {if (xhttp.status == 200) {document.reload();}}};
|
|
|
-if (!file.name.includes("remote-setup")){
|
|
|
|
|
- if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
|
|
|
|
- return;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
function upload() {
|
|
function upload() {
|
|
|
var xhttp = new XMLHttpRequest();
|
|
var xhttp = new XMLHttpRequest();
|
|
|
xhttp.onreadystatechange = function() {
|
|
xhttp.onreadystatechange = function() {
|
|
|
if (xhttp.readyState == 4) {stopProgressTimer();if (xhttp.status == 200) {extract();} }};
|
|
if (xhttp.readyState == 4) {stopProgressTimer();if (xhttp.status == 200) {extract();} }};
|
|
|
var filePath = document.getElementById("newfile").value.split(/[\\\/]/).pop();
|
|
var filePath = document.getElementById("newfile").value.split(/[\\\/]/).pop();
|
|
|
var file = document.getElementById("newfile").files[0];
|
|
var file = document.getElementById("newfile").files[0];
|
|
|
|
|
+ if (!file) {
|
|
|
|
|
+ firework.launch("Please select a remote-setup ZIP file first.", "warning", 5000);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (!file.name.includes("remote-setup"))
|
|
if (!file.name.includes("remote-setup"))
|
|
|
{
|
|
{
|
|
|
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
|
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
|
@@ -85,7 +90,7 @@ if (!file.name.includes("remote-setup")){
|
|
|
|
|
|
|
|
var nameneu = document.getElementById("newfile").value;
|
|
var nameneu = document.getElementById("newfile").value;
|
|
|
filePath = nameneu.split(/[\\\/]/).pop();
|
|
filePath = nameneu.split(/[\\\/]/).pop();
|
|
|
- var _toDo = domainname + "/ota?task=update&file=" + filePath;
|
|
|
|
|
|
|
+ var _toDo = getDomainname() + "/ota?task=update&file=" + encodeURIComponent(filePath);
|
|
|
xhttp.open("GET", _toDo, true);
|
|
xhttp.open("GET", _toDo, true);
|
|
|
xhttp.send();
|
|
xhttp.send();
|
|
|
}
|
|
}
|