improvements + page testing php scripts (use with php -S localhost:1337 in the folder)

pull/30/head
Ondřej Hruška 8 years ago
parent b1baffa3d5
commit e62c4ece90
  1. 4
      html/js/app.js
  2. 8
      html_orig/js/app.js
  3. 4
      html_orig/jssrc/wifi.js
  4. 15
      html_orig/term_test.php
  5. 13
      html_orig/wifi_test.php
  6. 1
      user/user_main.c

@ -1286,7 +1286,7 @@ $._loader = function(vis) {
/** Ask the CGI what APs are visible (async) */ /** Ask the CGI what APs are visible (async) */
function scanAPs() { function scanAPs() {
$.get('/wifi/scan', onScan); $.get('http://'+_root+'/wifi/scan', onScan);
} }
function rescan(time) { function rescan(time) {
@ -1340,7 +1340,7 @@ $._loader = function(vis) {
var abortTmeo; var abortTmeo;
function getStatus() { function getStatus() {
xhr.open("GET", "/wifi/connstatus"); xhr.open("GET", 'http://'+_root+"/wifi/connstatus");
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) {
clearTimeout(abortTmeo); clearTimeout(abortTmeo);

@ -894,6 +894,7 @@ $._loader = function(vis) {
var W, H; var W, H;
var cursor = {a: false, x: 0, y: 0, suppress: false, hidden: false}; var cursor = {a: false, x: 0, y: 0, suppress: false, hidden: false};
var screen = []; var screen = [];
var blinkIval;
/** Colors table */ /** Colors table */
var CLR = [// dark gray #2E3436 var CLR = [// dark gray #2E3436
@ -1071,7 +1072,8 @@ $._loader = function(vis) {
} }
/* Cursor blinking */ /* Cursor blinking */
setInterval(function() { clearInterval(blinkIval);
blinkIval = setInterval(function() {
cursor.a = !cursor.a; cursor.a = !cursor.a;
if (cursor.hidden) { if (cursor.hidden) {
cursor.a = false; cursor.a = false;
@ -1284,7 +1286,7 @@ $._loader = function(vis) {
/** Ask the CGI what APs are visible (async) */ /** Ask the CGI what APs are visible (async) */
function scanAPs() { function scanAPs() {
$.get('/wifi/scan', onScan); $.get('http://'+_root+'/wifi/scan', onScan);
} }
function rescan(time) { function rescan(time) {
@ -1338,7 +1340,7 @@ $._loader = function(vis) {
var abortTmeo; var abortTmeo;
function getStatus() { function getStatus() {
xhr.open("GET", "/wifi/connstatus"); xhr.open("GET", 'http://'+_root+"/wifi/connstatus");
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) {
clearTimeout(abortTmeo); clearTimeout(abortTmeo);

@ -75,7 +75,7 @@
/** Ask the CGI what APs are visible (async) */ /** Ask the CGI what APs are visible (async) */
function scanAPs() { function scanAPs() {
$.get('/wifi/scan', onScan); $.get('http://'+_root+'/wifi/scan', onScan);
} }
function rescan(time) { function rescan(time) {
@ -129,7 +129,7 @@
var abortTmeo; var abortTmeo;
function getStatus() { function getStatus() {
xhr.open("GET", "/wifi/connstatus"); xhr.open("GET", 'http://'+_root+"/wifi/connstatus");
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) {
clearTimeout(abortTmeo); clearTimeout(abortTmeo);

@ -0,0 +1,15 @@
<?php
$f = file_get_contents('term.html');
$f = str_replace('%screenData%',
'{
"w": 26, "h": 10,
"x": 0, "y": 0,
"cv": 1,
"screen": "70 t259"
}', $f);
$f = str_replace('window.location.host', '"192.168.0.15"', $f);
echo $f;

@ -0,0 +1,13 @@
<?php
$f = file_get_contents('wifi.html');
$f = str_replace('%StaSSID%', 'Chlivek', $f);
$f = str_replace('%StaIP%', '192.168.0.15', $f);
$f = str_replace('%WiFiModeNum%', '1', $f);
$f = str_replace('%WiFiMode%', 'Client', $f);
$f = str_replace('%WiFiChannel%', '1', $f);
$f = str_replace('window.location.host', '"192.168.0.15"', $f);
echo $f;

@ -18,6 +18,7 @@
#include <captdns.h> #include <captdns.h>
#include <espfs.h> #include <espfs.h>
#include <webpages-espfs.h> #include <webpages-espfs.h>
#include <cgiflash.h>
#include "serial.h" #include "serial.h"
#include "io.h" #include "io.h"
#include "screen.h" #include "screen.h"

Loading…
Cancel
Save