Added content from old ESPTerm repo @ b8ed46cbea0b88730a2a6bad8375790158110910
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<nav id="menu">
|
||||
<div id="brand" tabindex=0><?= tr('appname'.(ESP_DEMO?'_demo':'')) ?></div>
|
||||
<a href="<?= e(url('term')) ?>" class="icn-back"><?= tr('menu.term') ?></a>
|
||||
<?php
|
||||
// generate the menu
|
||||
foreach ($_pages as $k => $page) {
|
||||
if (strpos($page->bodyclass, 'cfg') === false) continue;
|
||||
|
||||
$sel = ($_GET['page'] == $k) ? 'selected' : '';
|
||||
$text = $page->label;
|
||||
$url = e(url($k));
|
||||
echo "<a href=\"$url\" class=\"$page->icon $sel\">$text</a>";
|
||||
}
|
||||
?>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
function menuOpen() { $('#menu').toggleClass('expanded') }
|
||||
$('#brand').on('click', menuOpen).on('keypress', cr(menuOpen));
|
||||
</script>
|
||||
@@ -0,0 +1,36 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title><?= $_GET['PAGE_TITLE'] ?></title>
|
||||
<link href="/css/app.css" rel="stylesheet">
|
||||
<script src="/js/app.js"></script>
|
||||
<script>
|
||||
var _root = <?= JS_WEB_ROOT ?>;
|
||||
var _demo = <?= (int)ESP_DEMO ?>;
|
||||
<?php if($_GET['page']=='term'): ?>var _demo_screen = <?= ESP_DEMO ? DEMO_SCREEN : 0 ?>;<?php endif; ?>
|
||||
<?php if($_GET['page']=='cfg_wifi'): ?>var _demo_aps = <?= ESP_DEMO ? json_encode(DEMO_APS) : '' ?>;<?php endif; ?>
|
||||
</script>
|
||||
</head>
|
||||
<body class="<?= $_GET['BODYCLASS'] ?>">
|
||||
<div id="outer">
|
||||
<?php
|
||||
$cfg = false;
|
||||
if (strpos($_GET['BODYCLASS'], 'cfg') !== false) {
|
||||
$cfg = true;
|
||||
require __DIR__ . '/_cfg_menu.php';
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<img src="/img/loader.gif" alt="Loading…" id="loader">
|
||||
<?php if ($cfg): ?>
|
||||
<h1><?= tr('menu.' . $_GET['page']) ?></h1>
|
||||
|
||||
<div class="Box errors hidden">
|
||||
<span class="lead"><?= tr('form_errors') ?></span> <span class="list"></span>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
<?php if ($_GET['BODYCLASS'] !== 'page-term'): ?>
|
||||
<div class="botpad"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="NotifyMsg hidden" id="notif"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<div class="Box">
|
||||
<img src="/img/cvut.svg" id="logo" class="mq-tablet-min">
|
||||
<h2>ESP8266 Remote Terminal</h2>
|
||||
|
||||
<img src="/img/cvut.svg" id="logo2" class="mq-phone">
|
||||
|
||||
<p>
|
||||
© Ondřej Hruška, 2016-2017
|
||||
<<a href="mailto:ondra@ondrovo.com">ondra@ondrovo.com</a>>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="http://measure.feld.cvut.cz/" target="blank">Katedra měření, FEL ČVUT</a><br>
|
||||
Department of Measurement, FEE CTU
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="Box">
|
||||
<h2>Version</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>ESPTerm</th>
|
||||
<td>v%vers_fw%, built %date% at %time%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>libesphttpd</th>
|
||||
<td>v%vers_httpd%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ESP IoT SDK</th>
|
||||
<td>v%vers_sdk%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="Box">
|
||||
<h2>Issues</h2>
|
||||
<p>
|
||||
Please report any issues to the <a href="%githubrepo%/issues">bugtracker</a> or send them by e-mail (see above).
|
||||
</p>
|
||||
<p>
|
||||
Firmware updates can be downloaded from the <a href="%githubrepo%/releases">releases page</a> and flashed
|
||||
with <a href="https://github.com/espressif/esptool">esptool.py</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="Box">
|
||||
<h2>Contributing</h2>
|
||||
<p>
|
||||
<i class="icn-github"></i> You're welcome to submit your improvements and ideas to our <a href="%githubrepo%">GitHub repository</a>!
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="icn-donate"></i> If you'd like to donate, please try <a href="https://paypal.me/mightypork">PayPal</a> or
|
||||
<a href="https://liberapay.com/MightyPork/">LiberaPay</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="Box">
|
||||
<h2>Thanks</h2>
|
||||
<p>
|
||||
The webserver is based on a <a href="https://github.com/MightyPork/libesphttpd">fork</a> of the
|
||||
<a href="https://github.com/Spritetm/esphttpd">esphttpd</a> library by Jeroen Domburg (Sprite_tm).
|
||||
</p>
|
||||
<p>
|
||||
Using (modified) JS library <a href="https://github.com/kylebarrow/chibi">chibi.js</a> by
|
||||
Kyle Barrow as a lightweight jQuery alternative.
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
$ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
|
||||
?>
|
||||
|
||||
<form class="Box str mobcol" action="<?= e(url('network_set')) ?>" method="GET" id="form-2">
|
||||
<h2 tabindex=0><?= tr('net.sta') ?></h2>
|
||||
|
||||
<div class="Row explain">
|
||||
<?= tr('net.explain_sta') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox x-static-toggle" >
|
||||
<label><?= tr('net.sta_dhcp_enable') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="sta_dhcp_enable" name="sta_dhcp_enable" value="%sta_dhcp_enable%">
|
||||
</div>
|
||||
|
||||
<div class="Row x-static">
|
||||
<label for="sta_addr_ip"><?= tr('net.sta_addr_ip') ?></label>
|
||||
<input type="text" name="sta_addr_ip" id="sta_addr_ip" value="%h:sta_addr_ip%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row x-static">
|
||||
<label for="sta_addr_mask"><?= tr('net.sta_addr_mask') ?></label>
|
||||
<input type="text" name="sta_addr_mask" id="sta_addr_mask" value="%h:sta_addr_mask%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row x-static">
|
||||
<label for="sta_addr_gw"><?= tr('net.sta_addr_gw') ?></label>
|
||||
<input type="text" name="sta_addr_gw" id="sta_addr_gw" value="%h:sta_addr_gw%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-2').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="Box str mobcol" action="<?= e(url('network_set')) ?>" method="GET" id="form-1">
|
||||
<h2 tabindex=0><?= tr('net.ap') ?></h2>
|
||||
|
||||
<div class="Row explain">
|
||||
<?= tr('net.explain_ap') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="ap_addr_mask"><?= tr('net.ap_addr_mask') ?></label>
|
||||
<input type="text" name="ap_addr_mask" id="ap_addr_mask" value="%h:ap_addr_mask%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="ap_addr_ip"><?= tr('net.ap_addr_ip') ?></label>
|
||||
<input type="text" name="ap_addr_ip" id="ap_addr_ip" value="%h:ap_addr_ip%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="ap_dhcp_start"><?= tr('net.ap_dhcp_start') ?></label>
|
||||
<input type="text" name="ap_dhcp_start" id="ap_dhcp_start" value="%h:ap_dhcp_start%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="ap_dhcp_end"><?= tr('net.ap_dhcp_end') ?></label>
|
||||
<input type="text" name="ap_dhcp_end" id="ap_dhcp_end" value="%h:ap_dhcp_end%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="ap_dhcp_time"><?= tr('net.ap_dhcp_time') ?><span class="mq-phone"> (min)</span></label>
|
||||
<input type="number" step=1 min=1 max=2880 name="ap_dhcp_time" id="ap_dhcp_time" value="%ap_dhcp_time%" required>
|
||||
<span class="mq-no-phone"> min</span>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="Box mobcol">
|
||||
<h2><?= tr('net.details') ?></h2>
|
||||
|
||||
<div class="Row">
|
||||
<label><?= tr('net.sta_mac') ?></label><input type="text" readonly value="%sta_mac%">
|
||||
</div>
|
||||
<div class="Row">
|
||||
<label><?= tr('net.ap_mac') ?></label><input type="text" readonly value="%ap_mac%">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function updateStaticDisp() {
|
||||
var sttc = !parseInt($('#sta_dhcp_enable').val());
|
||||
$('.x-static').toggleClass('hidden', !sttc);
|
||||
}
|
||||
$('.x-static-toggle').on('click', function() {
|
||||
setTimeout(function() {
|
||||
updateStaticDisp();
|
||||
}, 0)
|
||||
});
|
||||
updateStaticDisp();
|
||||
</script>
|
||||
@@ -0,0 +1,90 @@
|
||||
<div class="Box str mobcol">
|
||||
<h2 tabindex=0><?= tr('system.save_restore') ?></h2>
|
||||
|
||||
<div class="Row explain nomargintop">
|
||||
<?= tr('system.explain_persist') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons2">
|
||||
<a class="button icn-restore"
|
||||
onclick="return confirm('<?= tr('system.confirm_restore') ?>');"
|
||||
href="<?= e(url('restore_defaults')) ?>">
|
||||
<?= tr('system.restore_defaults') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons2">
|
||||
<a onclick="writeDefaults(); return false;" href="#"><?= tr('system.write_defaults') ?></a>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons2">
|
||||
<a onclick="return confirm('<?= tr('system.confirm_restore_hard') ?>');"
|
||||
href="<?= e(url('restore_hard')) ?>">
|
||||
<?= tr('system.restore_hard') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form class="Box str mobcol" action="<?= e(url('system_set')) ?>" method="GET" id="form-1">
|
||||
<h2 tabindex=0><?= tr('system.uart') ?></h2>
|
||||
|
||||
<div class="Row explain">
|
||||
<?= tr('system.explain_uart') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="uart_baud"><?= tr('uart.baud') ?><span class="mq-phone"> (bps)</span></label>
|
||||
<select name="uart_baud" id="uart_baud" class="short">
|
||||
<?php foreach([
|
||||
300, 600, 1200, 2400, 4800, 9600, 19200, 38400,
|
||||
57600, 74880, 115200, 230400, 460800, 921600, 1843200, 3686400,
|
||||
] as $b):
|
||||
?><option value="<?=$b?>"><?= number_format($b, 0, ',', '.') ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<span class="mq-no-phone"> bps</span>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="uart_parity"><?= tr('uart.parity') ?></label>
|
||||
<select name="uart_parity" id="uart_parity" class="short">
|
||||
<?php foreach([
|
||||
2 => tr('uart.parity.none'),
|
||||
1 => tr('uart.parity.odd'),
|
||||
0 => tr('uart.parity.even'),
|
||||
] as $k => $label):
|
||||
?><option value="<?=$k?>"><?=$label?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="uart_stopbits"><?= tr('uart.stop_bits') ?></label>
|
||||
<select name="uart_stopbits" id="uart_stopbits" class="short">
|
||||
<?php foreach([
|
||||
1 => tr('uart.stop_bits.one'),
|
||||
2 => tr('uart.stop_bits.one_and_half'),
|
||||
3 => tr('uart.stop_bits.two'),
|
||||
] as $k => $label):
|
||||
?><option value="<?=$k?>"><?=$label?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function writeDefaults() {
|
||||
var pw = prompt('<?= tr('system.confirm_store_defaults') ?>');
|
||||
if (!pw) return;
|
||||
location.href = <?=json_encode(url('write_defaults')) ?> + '?pw=' + pw;
|
||||
}
|
||||
|
||||
$('#uart_baud').val(%uart_baud%);
|
||||
$('#uart_parity').val(%uart_parity%);
|
||||
$('#uart_stopbits').val(%uart_stopbits%);
|
||||
</script>
|
||||
@@ -0,0 +1,203 @@
|
||||
<div class="Box">
|
||||
<a href="<?= e(url('reset_screen')) ?>"><?= tr('term.reset_screen') ?></a>
|
||||
</div>
|
||||
|
||||
<form class="Box mobopen str" action="<?= e(url('term_set')) ?>" method="GET" id='form-1'>
|
||||
<h2><?= tr('term.defaults') ?></h2>
|
||||
|
||||
<div class="Row explain">
|
||||
<?= tr('term.explain_initials') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="theme"><?= tr("term.theme") ?></label>
|
||||
<select name="theme" id="theme" class="short" onchange="showColor()">
|
||||
<option value="0">Tango</option>
|
||||
<option value="1">Linux</option>
|
||||
<option value="2">XTerm</option>
|
||||
<option value="3">Rxvt</option>
|
||||
<option value="4">Ambience</option>
|
||||
<option value="5">Solarized</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Row color-preview">
|
||||
<div class="colorprev">
|
||||
<span data-fg=0 class="bg0 fg0">30</span><!--
|
||||
--><span data-fg=1 class="bg0 fg1">31</span><!--
|
||||
--><span data-fg=2 class="bg0 fg2">32</span><!--
|
||||
--><span data-fg=3 class="bg0 fg3">33</span><!--
|
||||
--><span data-fg=4 class="bg0 fg4">34</span><!--
|
||||
--><span data-fg=5 class="bg0 fg5">35</span><!--
|
||||
--><span data-fg=6 class="bg0 fg6">36</span><!--
|
||||
--><span data-fg=7 class="bg0 fg7">37</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span data-fg=8 class="bg0 fg8">90</span><!--
|
||||
--><span data-fg=9 class="bg0 fg9">91</span><!--
|
||||
--><span data-fg=10 class="bg0 fg10">92</span><!--
|
||||
--><span data-fg=11 class="bg0 fg11">93</span><!--
|
||||
--><span data-fg=12 class="bg0 fg12">94</span><!--
|
||||
--><span data-fg=13 class="bg0 fg13">95</span><!--
|
||||
--><span data-fg=14 class="bg0 fg14">96</span><!--
|
||||
--><span data-fg=15 class="bg0 fg15">97</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span data-bg=0 class="bg0 fg15">40</span><!--
|
||||
--><span data-bg=1 class="bg1 fg15">41</span><!--
|
||||
--><span data-bg=2 class="bg2 fg15">42</span><!--
|
||||
--><span data-bg=3 class="bg3 fg0">43</span><!--
|
||||
--><span data-bg=4 class="bg4 fg15">44</span><!--
|
||||
--><span data-bg=5 class="bg5 fg15">45</span><!--
|
||||
--><span data-bg=6 class="bg6 fg15">46</span><!--
|
||||
--><span data-bg=7 class="bg7 fg0">47</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span data-bg=8 class="bg8 fg15">100</span><!--
|
||||
--><span data-bg=9 class="bg9 fg0">101</span><!--
|
||||
--><span data-bg=10 class="bg10 fg0">102</span><!--
|
||||
--><span data-bg=11 class="bg11 fg0">103</span><!--
|
||||
--><span data-bg=12 class="bg12 fg0">104</span><!--
|
||||
--><span data-bg=13 class="bg13 fg0">105</span><!--
|
||||
--><span data-bg=14 class="bg14 fg0">106</span><!--
|
||||
--><span data-bg=15 class="bg15 fg0">107</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Row color-preview">
|
||||
<div style="
|
||||
" id="color-example">
|
||||
<?= tr("term.example") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label><?= tr("term.default_fg_bg") ?></label>
|
||||
<select name="default_fg" id="default_fg" class="short" onchange="showColor()">
|
||||
<?php for($i=0; $i<16; $i++): ?>
|
||||
<option value="<?=$i?>"><?= tr("color.$i") ?></option>
|
||||
<?php endfor; ?>
|
||||
</select> <!--
|
||||
--><select name="default_bg" id="default_bg" class="short" onchange="showColor()">
|
||||
<?php for($i=0; $i<16; $i++): ?>
|
||||
<option value="<?=$i?>"><?= tr("color.$i") ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_width"><?= tr('term.term_width') ?></label>
|
||||
<input type="number" step=1 min=1 max=255 name="term_width" id="term_width" value="%term_width%" required> <!--
|
||||
--><input type="number" step=1 min=1 max=255 name="term_height" id="term_height" value="%term_height%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_title"><?= tr('term.term_title') ?></label>
|
||||
<input type="text" name="term_title" id="term_title" value="%h:term_title%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label><?= tr("term.buttons") ?></label>
|
||||
<input class="short" type="text" name="btn1" id="btn1" value="%h:btn1%">
|
||||
<input class="short" type="text" name="btn2" id="btn2" value="%h:btn2%">
|
||||
<input class="short" type="text" name="btn3" id="btn3" value="%h:btn3%">
|
||||
<input class="short" type="text" name="btn4" id="btn4" value="%h:btn4%">
|
||||
<input class="short" type="text" name="btn5" id="btn5" value="%h:btn5%">
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="Box fold str" action="<?= e(url('term_set')) ?>" method="GET" id='form-2'>
|
||||
<h2><?= tr('term.expert') ?></h2>
|
||||
|
||||
<div class="Row explain">
|
||||
<?= tr('term.explain_expert') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="parser_tout_ms"><?= tr('term.parser_tout_ms') ?><span class="mq-phone"> (ms)</span></label>
|
||||
<input type="number" step=1 min=0 name="parser_tout_ms" id="parser_tout_ms" value="%parser_tout_ms%" required>
|
||||
<span class="mq-no-phone"> ms</span>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="display_tout_ms"><?= tr('term.display_tout_ms') ?><span class="mq-phone"> (ms)</span></label>
|
||||
<input type="number" step=1 min=0 name="display_tout_ms" id="display_tout_ms" value="%display_tout_ms%" required>
|
||||
<span class="mq-no-phone"> ms</span>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="display_cooldown_ms"><?= tr('term.display_cooldown_ms') ?><span class="mq-phone"> (ms)</span></label>
|
||||
<input type="number" step=1 min=0 name="display_cooldown_ms" id="display_cooldown_ms" value="%display_cooldown_ms%" required>
|
||||
<span class="mq-no-phone"> ms</span>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label><?= tr("term.button_msgs") ?></label>
|
||||
<input class="short" type="text" name="bm1" id="bm1" value="%h:bm1%">
|
||||
<input class="short" type="text" name="bm2" id="bm2" value="%h:bm2%">
|
||||
<input class="short" type="text" name="bm3" id="bm3" value="%h:bm3%">
|
||||
<input class="short" type="text" name="bm4" id="bm4" value="%h:bm4%">
|
||||
<input class="short" type="text" name="bm5" id="bm5" value="%h:bm5%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.fn_alt_mode') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="fn_alt_mode" name="fn_alt_mode" value="%fn_alt_mode%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.show_buttons') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="show_buttons" name="show_buttons" value="%show_buttons%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.show_config_links') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="show_config_links" name="show_config_links" value="%show_config_links%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.loopback') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="loopback" name="loopback" value="%loopback%">
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-2').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$('#default_fg').val(%default_fg%);
|
||||
$('#default_bg').val(%default_bg%);
|
||||
$('#theme').val(%theme%);
|
||||
|
||||
function showColor() {
|
||||
var ex = qs('#color-example');
|
||||
ex.className = '';
|
||||
ex.classList.add('fg'+$('#default_fg').val());
|
||||
ex.classList.add('bg'+$('#default_bg').val());
|
||||
var th = $('#theme').val();
|
||||
$('.color-preview').forEach(function(e) {
|
||||
e.className = 'Row color-preview theme-'+th;
|
||||
});
|
||||
}
|
||||
showColor();
|
||||
|
||||
$('.colorprev span').on('click', function() {
|
||||
var fg = this.dataset.fg;
|
||||
var bg = this.dataset.bg;
|
||||
if (typeof fg != 'undefined') $('#default_fg').val(fg);
|
||||
if (typeof bg != 'undefined') $('#default_bg').val(bg);
|
||||
showColor()
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,123 @@
|
||||
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET" id="form-1">
|
||||
<h2 tabindex=0><?= tr('wifi.ap') ?></h2>
|
||||
|
||||
<div class="Row checkbox x-ap-toggle">
|
||||
<label><?= tr('wifi.enable') ?></label><!--
|
||||
--><span class="box" tabindex=0></span>
|
||||
<input type="hidden" id="ap_enabled" name="ap_enable" value="%ap_enable%">
|
||||
</div>
|
||||
|
||||
<div class="Row x-ap-on">
|
||||
<label for="ap_ssid"><?= tr('wifi.ap_ssid') ?></label>
|
||||
<input type="text" name="ap_ssid" id="ap_ssid" value="%h:ap_ssid%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row x-ap-on">
|
||||
<label for="ap_password"><?= tr('wifi.ap_password') ?></label>
|
||||
<input type="text" name="ap_password" id="ap_password" value="%h:ap_password%">
|
||||
</div>
|
||||
|
||||
<div class="Row x-ap-on">
|
||||
<label for="ap_channel"><?= tr('wifi.ap_channel') ?></label>
|
||||
<input type="number" name="ap_channel" id="ap_channel" min=1 max=14 value="%ap_channel%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row range x-ap-on">
|
||||
<label for="tpw">
|
||||
<?= tr('wifi.tpw') ?>
|
||||
<span class="display x-disp1 mq-phone"></span>
|
||||
</label>
|
||||
<input type="range" name="tpw" id="tpw" step=1 min=0 max=82 value="%tpw%">
|
||||
<span class="display x-disp2 mq-no-phone"></span>
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox x-ap-on">
|
||||
<label><?= tr('wifi.ap_hidden') ?></label><!--
|
||||
--><span class="box" tabindex=0></span>
|
||||
<input type="hidden" name="ap_hidden" value="%ap_hidden%">
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="Box str mobcol expanded" action="<?= e(url('wifi_set')) ?>" method="GET" id="form-2">
|
||||
<h2 tabindex=0><?= tr('wifi.sta') ?></h2>
|
||||
|
||||
<div class="Row checkbox x-sta-toggle">
|
||||
<label><?= tr('wifi.enable') ?></label><!--
|
||||
--><span class="box" tabindex=0></span>
|
||||
<input type="hidden" id="sta_enabled" name="sta_enable" value="%sta_enable%">
|
||||
</div>
|
||||
|
||||
<div class="Row explain nomargintop x-sta-on">
|
||||
<span class="spacer"></span>
|
||||
<?= tr("wifi.sta_explain") ?>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="sta_ssid" id="sta_ssid" value="">
|
||||
<input type="hidden" name="sta_password" id="sta_password" value="">
|
||||
|
||||
<div class="Row sta-info x-sta-on">
|
||||
<label><?= tr('wifi.sta_info') ?></label>
|
||||
<div class="AP-preview hidden" id="sta-nw">
|
||||
<div class="wrap">
|
||||
<div class="inner">
|
||||
<div class="essid"></div>
|
||||
<div class="passwd"><?= tr('wifi.sta_active_pw') ?></div>
|
||||
<div class="nopasswd"><?= tr('wifi.sta_active_nopw') ?></div>
|
||||
<div class="ip"></div>
|
||||
</div>
|
||||
<a class="forget" href="#" id="forget-sta">×</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="AP-preview-nil" id="sta-nw-nil">
|
||||
<?= tr('wifi.sta_none') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ap-box" class="x-sta-on">
|
||||
<label><?= tr('wifi.select_ssid') ?></label>
|
||||
<div id="ap-scan"><a href="#" onclick="WiFi.startScanning(); return false"><?= tr('wifi.scan_now') ?></a></div>
|
||||
<div id="ap-loader" class="hidden"><?= tr('wifi.scanning') ?><span class="anim-dots">.</span></div>
|
||||
<div id="ap-list" class="hidden"></div>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-2').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
WiFi.scan_url = '<?= url('wifi_scan', true) ?>';
|
||||
WiFi.init({
|
||||
sta_ssid: '%j:sta_ssid%',
|
||||
sta_password: '%j:sta_password%',
|
||||
sta_active_ip: '%j:sta_active_ip%',
|
||||
sta_active_ssid: '%j:sta_active_ssid%',
|
||||
});
|
||||
|
||||
function updateApDisp() {
|
||||
var a = !!parseInt($('#ap_enabled').val());
|
||||
$('.x-ap-on').toggleClass('hidden', !a);
|
||||
}
|
||||
$('.x-ap-toggle').on('click', function() {
|
||||
setTimeout(function() {
|
||||
updateApDisp();
|
||||
}, 0)
|
||||
});
|
||||
|
||||
function updateStaDisp() {
|
||||
var a = !!parseInt($('#sta_enabled').val());
|
||||
$('.x-sta-on').toggleClass('hidden', !a);
|
||||
}
|
||||
$('.x-sta-toggle').on('click', function() {
|
||||
setTimeout(function() {
|
||||
updateStaDisp();
|
||||
}, 0)
|
||||
});
|
||||
|
||||
updateApDisp();
|
||||
updateStaDisp();
|
||||
</script>
|
||||
Executable
+89
@@ -0,0 +1,89 @@
|
||||
<h1><?= tr('menu.cfg_wifi_conn') ?></h1>
|
||||
|
||||
<div class="Box">
|
||||
<p><b><?= tr('wifi.conn.status') ?></b> <span id="status"></span><span class="anim-dots">.</span></p>
|
||||
<a href="<?= e(url('cfg_wifi')) ?>" id="backbtn" class="button"><?= tr('wifi.conn.back_to_config') ?></a>
|
||||
</div>
|
||||
|
||||
<div class="Box">
|
||||
<p><?= tr('wifi.conn.explain_android_sucks') ?></p>
|
||||
<p><?= tr('wifi.conn.explain_reset') ?></p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var xhr = new XMLHttpRequest();
|
||||
var abortTmeo;
|
||||
var failCounter = 0;
|
||||
|
||||
var messages = <?= json_encode([
|
||||
'disabled' => tr('wifi.conn.disabled'),
|
||||
'idle' => tr('wifi.conn.idle'),
|
||||
'success' => tr('wifi.conn.success'),
|
||||
'working' => tr('wifi.conn.working'),
|
||||
'fail' => tr('wifi.conn.fail'),
|
||||
]) ?>;
|
||||
|
||||
function onFail() {
|
||||
$("#status").html(<?= json_encode(tr('wifi.conn.telemetry_lost')) ?>);
|
||||
$('.anim-dots').addClass('hidden');
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
xhr.open("GET", 'http://'+_root+'<?= url('wifi_connstatus', true) ?>');
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
clearTimeout(abortTmeo);
|
||||
|
||||
try {
|
||||
var data = JSON.parse(xhr.responseText);
|
||||
var done = false;
|
||||
var msg = messages[data.status] || '...';
|
||||
|
||||
if (data.status == 'success') {
|
||||
msg += data.ip;
|
||||
done = true;
|
||||
}
|
||||
|
||||
if (data.status == 'fail') {
|
||||
msg += data.cause;
|
||||
done = true;
|
||||
}
|
||||
|
||||
$("#status").html(msg);
|
||||
|
||||
if (done) {
|
||||
// $('#backbtn').removeClass('hidden');
|
||||
$('.anim-dots').addClass('hidden');
|
||||
} else {
|
||||
// ask again after a short delay
|
||||
window.setTimeout(getStatus, 1000);
|
||||
}
|
||||
} catch(e) {
|
||||
failCounter++;
|
||||
console.log(e);
|
||||
// repeat
|
||||
if (failCounter > 5) {
|
||||
onFail();
|
||||
}
|
||||
else {
|
||||
window.setTimeout(getStatus, 1000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
onFail();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// XHR timeout
|
||||
abortTmeo = setTimeout(function () {
|
||||
xhr.abort();
|
||||
onFail();
|
||||
}, 4000);
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
getStatus();
|
||||
</script>
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="Box">
|
||||
<a href="#" onclick="hpfold(1);return false">Expand all</a> | <a href="#" onclick="hpfold(0);return false">Collapse all</a>
|
||||
</div>
|
||||
|
||||
<?php require __DIR__ . "/help/troubleshooting.php"; ?>
|
||||
<?php require __DIR__ . "/help/nomenclature.php"; ?>
|
||||
<?php require __DIR__ . "/help/screen_behavior.php"; ?>
|
||||
<?php require __DIR__ . "/help/input.php"; ?>
|
||||
<?php require __DIR__ . "/help/charsets.php"; ?>
|
||||
<?php require __DIR__ . "/help/sgr_styles.php"; ?>
|
||||
<?php require __DIR__ . "/help/sgr_colors.php"; ?>
|
||||
<?php require __DIR__ . "/help/cmd_cursor.php"; ?>
|
||||
<?php require __DIR__ . "/help/cmd_screen.php"; ?>
|
||||
<?php require __DIR__ . "/help/cmd_system.php"; ?>
|
||||
|
||||
<script>
|
||||
function hpfold(yes) {
|
||||
$('.fold').toggleClass('expanded', !!yes);
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,80 @@
|
||||
<div class="Box fold">
|
||||
<h2>Alternate Character Sets</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
ESPTerm implements Alternate Character Sets as a way to print box drawing characters
|
||||
and special symbols. A character set can change what each received ASCII character
|
||||
is printed as on the screen (eg. "{" is "π" in codepage `0`). The implementation is based
|
||||
on the original VT devices.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Since ESPTerm also supports UTF-8, this feature is the most useful for applications
|
||||
which can't print UTF-8 or already use alternate character sets for historical reasons.
|
||||
</p>
|
||||
|
||||
<h3>Supported codepages</h3>
|
||||
|
||||
<ul>
|
||||
<li>`B` - US ASCII (default)</li>
|
||||
<li>`A` - UK ASCII: # replaced with £</li>
|
||||
<li>`0` - Symbols and basic line drawing (standard DEC alternate character set)</li>
|
||||
<li>`1` - Symbols and advanced line drawing (based on DOS codepage 437, ESPTerm specific)</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
All codepages use codes 32-127, 32 being space. A character with no entry in the active codepage
|
||||
stays unchanged.
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$codepages = load_esp_charsets();
|
||||
foreach($codepages as $name => $cp) {
|
||||
echo "<h4>Codepage `$name`</h4>\n";
|
||||
echo '<div class="charset">';
|
||||
foreach($cp as $point) {
|
||||
$dis = $point[1]==$point[2]?' class="none"' : '';
|
||||
echo "<div$dis><span>$point[0]</span><span>$point[1]</span><span>$point[2]</span></div>";
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<h3>Switching commands</h3>
|
||||
|
||||
<p>
|
||||
There are two character set slots, G0 and G1.
|
||||
Those slots are selected as active using ASCII codes Shift In and Shift Out (those originally served for shifting
|
||||
a red-black typewriter tape). Often only G0 is used for simplicity.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Each slot (G0 and G1) can have a different codepage assigned. G0 and G1 and the active slot number are
|
||||
saved and restored with the cursor and cleared with a screen reset (<code>\ec</code>).
|
||||
</p>
|
||||
|
||||
<p>The following commands are used:</p>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>`\e(<i>x</i>`</td>
|
||||
<td>Set G0 = codepage <i>x</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`\e)<i>x</i>`</td>
|
||||
<td>Set G1 = codepage <i>x</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>_SO_ (14)</td>
|
||||
<td>Activate G0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>_SI_ (15)</td>
|
||||
<td>Activate G1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,199 @@
|
||||
<div class="Box fold">
|
||||
<h2>Commands: Cursor Functions</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
The coordinates are 1-based, origin is top left. The cursor can move within the entire screen,
|
||||
or in the active Scrolling Region if Origin Mode is enabled.
|
||||
</p>
|
||||
|
||||
<p>After writing a character, the cursor advances to the right. If it has reached the end of the row,
|
||||
it stays on the same line, but writing the next character makes it jump to the start of the next
|
||||
line first, scrolling up if needed. If Auto-wrap mode is disabled, the cursor never wraps or scrolls
|
||||
the screen.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
*Legend:*
|
||||
Italic letters such as _n_ are ASCII numbers that serve as arguments, separated with a semicolon.
|
||||
If an argument is left out, it's treated as 0 or 1, depending on what makes sense for the command.
|
||||
</p>
|
||||
|
||||
<h3>Movement</h3>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>A \\
|
||||
\e[<i>n</i>B \\
|
||||
\e[<i>n</i>C \\
|
||||
\e[<i>n</i>D
|
||||
</code>
|
||||
</td>
|
||||
<td>Move cursor up (`A`), down (`B`), right (`C`), left (`D`)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>F \\
|
||||
\e[<i>n</i>E
|
||||
</code>
|
||||
</td>
|
||||
<td>Go _n_ lines up (`F`) or down (`E`), start of line</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>r</i>d \\
|
||||
\e[<i>c</i>G \\
|
||||
\e[<i>r</i>;<i>c</i>H
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Go to absolute position - row (`d`), column (`G`), or both (`H`). Use `\e[H` to go to 1,1.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
`\e[6n`
|
||||
</td>
|
||||
<td>
|
||||
Query cursor position. Sent back as `\e[<i>r</i>;<i>c</i>R`.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Save / restore</h3>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[s \\
|
||||
\e[u
|
||||
</code>
|
||||
</td>
|
||||
<td>Save (`s`) or restore (`u`) cursor position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e7 \\
|
||||
\e8
|
||||
</code>
|
||||
</td>
|
||||
<td>Save (`7`) or restore (`8`) cursor position and attributes</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Scrolling Region</h3>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
`\e[<i>a</i>;<i>b</i>r`
|
||||
</td>
|
||||
<td>
|
||||
Set scrolling region to rows _a_ through _b_ and go to 1,1. By default, the
|
||||
scrolling region spans the entire screen height. The cursor can leave the region using
|
||||
absolute position commands, unless Origin Mode (see below) is active.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[?6h \\
|
||||
\e[?6l
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Enable (`h`) or disable (`l`) Origin Mode and go to 1,1. In Origin Mode, all coordinates
|
||||
are relative to the Scrolling Region and the cursor can't leave the region.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>S \\
|
||||
\e[<i>n</i>T
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Move contents of the Scrolling Region up (`S`) or down (`T`), pad with empty
|
||||
lines of the current background color. This is similar to what happens when AutoWrap
|
||||
is enabled and some text is printed at the very end of the screen.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Tab stops</h3>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
`\eH`
|
||||
</td>
|
||||
<td>
|
||||
Set tab stop at the current column. There are, by default, tabs every 8 columns.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>I \\
|
||||
\e[<i>n</i>Z
|
||||
</code>
|
||||
</td>
|
||||
<td>Advance (`I`) or go back (`Z`) _n_ tab stops or end/start of line. ASCII _TAB_ (9) is equivalent to <code>\e[1I</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[0g \\
|
||||
\e[3g \\
|
||||
</code>
|
||||
</td>
|
||||
<td>Clear tab stop at the current column (`0`), or all columns (`3`).</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Other options</h3>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[?7h \\
|
||||
\e[?7l
|
||||
</code>
|
||||
</td>
|
||||
<td>Enable (`h`) or disable (`l`) cursor auto-wrap and screen auto-scroll</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[?25h \\
|
||||
\e[?25l
|
||||
</code>
|
||||
</td>
|
||||
<td>Show (`h`) or hide (`l`) the cursor</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,63 @@
|
||||
<div class="Box fold">
|
||||
<h2>Commands: Screen Functions</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
<b>Legend:</b>
|
||||
Italic letters such as _n_ are ASCII numbers that serve as arguments, separated with a semicolon.
|
||||
If an argument is left out, it's treated as 0 or 1, depending on what makes sense for the command.
|
||||
</p>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
`\e[<i>m</i>J`
|
||||
</td>
|
||||
<td>
|
||||
Clear part of screen. _m_: 0 - from cursor, 1 - to cursor, 2 - all
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
`\e[<i>m</i>K`
|
||||
</td>
|
||||
<td>
|
||||
Erase part of line. _m_: 0 - from cursor, 1 - to cursor, 2 - all
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
`\e[<i>n</i>X`</td>
|
||||
<td>
|
||||
Erase _n_ characters in line.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>L \\
|
||||
\e[<i>n</i>M
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Insert (`L`) or delete (`M`) _n_ lines. Following lines are pulled up or pushed down.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[<i>n</i>@ \\
|
||||
\e[<i>n</i>P
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Insert (`@`) or delete (`P`) _n_ characters. The rest of the line is pulled left or pushed right.
|
||||
Characters going past the end of line are lost.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,103 @@
|
||||
<div class="Box fold">
|
||||
<h2>Commands: System Functions</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
It's possible to dynamically change the screen title text and action button labels.
|
||||
Setting an empty label to a button makes it look disabled. The buttons send ASCII 1-5 when clicked.
|
||||
Those changes are not retained after restart.
|
||||
</p>
|
||||
|
||||
<table class="ansiref w100">
|
||||
<thead><tr><th>Code</th><th>Meaning</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>`\ec`</td>
|
||||
<td>
|
||||
Clear screen, reset attributes and cursor.
|
||||
The screen size, title and button labels remain unchanged.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`\e[5n`</td>
|
||||
<td>
|
||||
Query device status, ESPTerm replies with `\e[0n` "device is OK".
|
||||
Can be used to check if the terminal has booted up and is ready to receive commands.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>_CAN_ (24)</td>
|
||||
<td>
|
||||
This ASCII code is not a command, but is sent by ESPTerm when it becomes ready to receive commands.
|
||||
When this code is received on the UART, it means ESPTerm has restarted and is ready. Use this to detect
|
||||
spontaneous restarts which require a full screen repaint.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`\e]0;<i>t</i>\a`</td>
|
||||
<td>Set screen title to _t_ (this is a standard OSC command)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e]<i>80+n</i>;<i>t</i>\a
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Set label for button _n_ = 1-5 (code 81-85) to _t_ - e.g.`\e]81;Yes\a`
|
||||
sets the first button text to "Yes".
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e]<i>90+n</i>;<i>m</i>\a
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Set message for button _n_ = 1-5 (code 81-85) to _m_ - e.g.`\e]94;iv\a`
|
||||
sets the 3rd button to send string "iv" when pressed.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[?800h \\
|
||||
\e[?800l
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Show (`h`) or hide (`l`) action buttons (the blue buttons under the screen).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[?801h \\
|
||||
\e[?801l
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Show (`h`) or hide (`l`) menu/help links under the screen.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
\e[12h \\
|
||||
\e[12l
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
Enable (`h`) or disable (`l`) Send-Receive Mode (SRM).
|
||||
SRM is the opposite of Local Echo, meaning `\e[12h` disables and `\e[12l` enables Local Echo.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`\e[8;<i>r</i>;<i>c</i>t`</td>
|
||||
<td>Set screen size to _r_ rows and _c_ columns (this is a command borrowed from Xterm)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,254 @@
|
||||
|
||||
<div class="Box fold">
|
||||
<h2>User Input: Keyboard, Mouse</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<h3>Keyboard</h3>
|
||||
|
||||
<p>
|
||||
The user can input text using their keyboard, or on Android, using the on-screen keyboard which is open using
|
||||
a button beneath the screen. Supported are all printable characters, as well as many control keys, such as arrows, _Ctrl+letters_
|
||||
and function keys. Sequences sent by function keys are based on VT102 and Xterm.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The codes sent by _Home_, _End_, _F1-F4_ and cursor keys are affected by various keyboard modes (_Application Cursor Keys_,
|
||||
_Application Numpad Mode_, _SS3 Fn Keys Mode_). Some can be set in the <a href="<?= url('cfg_term') ?>">Terminal Settings</a>,
|
||||
others via commands.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here are some examples of control key codes:
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<thead><tr><th>Key</th><th>Code</th><th>Key</th><th>Code</th></tr></thead>
|
||||
<tr>
|
||||
<td>Up</td>
|
||||
<td>`\e[A`,~`\eOA`</td>
|
||||
<td>F1</td>
|
||||
<td>`\eOP`,~`\e[11\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Down</td>
|
||||
<td>`\e[B`,~`\eOB`</td>
|
||||
<td>F2</td>
|
||||
<td>`\eOQ`,~`\e[12\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Right</td>
|
||||
<td>`\e[C`,~`\eOC`</td>
|
||||
<td>F3</td>
|
||||
<td>`\eOR`,~`\e[13\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Left</td>
|
||||
<td>`\e[D`,~`\eOD`</td>
|
||||
<td>F4</td>
|
||||
<td>`\eOS`,~`\e[14\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Home</td>
|
||||
<td>`\eOH`,~`\e[H`,~`\e[1\~`</td>
|
||||
<td>F5</td>
|
||||
<td>`\e[15~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>End</td>
|
||||
<td>`\eOF`,~`\e[F`,~`\e[4\~`</td>
|
||||
<td>F6</td>
|
||||
<td>`\e[17\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Insert</td>
|
||||
<td>`\e[2\~`</td>
|
||||
<td>F7</td>
|
||||
<td>`\e[18\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Delete</td>
|
||||
<td>`\e[3\~`</td>
|
||||
<td>F8</td>
|
||||
<td>`\e[19\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Page Up</td>
|
||||
<td>`\e[5\~`</td>
|
||||
<td>F9</td>
|
||||
<td>`\e[20\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Page Down</td>
|
||||
<td>`\e[6\~`</td>
|
||||
<td>F10</td>
|
||||
<td>`\e[21\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Enter</td>
|
||||
<td>`\r` (13)</td>
|
||||
<td>F11</td>
|
||||
<td>`\e[23\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ctrl+Enter</td>
|
||||
<td>`\n` (10)</td>
|
||||
<td>F12</td>
|
||||
<td>`\e[24\~`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tab</td>
|
||||
<td>`\t` (9)</td>
|
||||
<td>ESC</td>
|
||||
<td>`\e` (27)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Backspace</td>
|
||||
<td>`\b` (8)</td>
|
||||
<td>Ctrl+A..Z</td>
|
||||
<td>ASCII 1-26</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Action buttons</h3>
|
||||
|
||||
<p>
|
||||
The blue buttons under the screen send ASCII codes 1, 2, 3, 4, 5, which incidentally
|
||||
correspond to _Ctrl+A,B,C,D,E_. This choice was made to make button press parsing as simple as possible.
|
||||
</p>
|
||||
|
||||
<h3>Mouse</h3>
|
||||
|
||||
<p>
|
||||
ESPTerm implements standard mouse tracking modes based on Xterm. Mouse tracking can be used to implement
|
||||
powerful user interactions such as on-screen buttons, draggable sliders or dials, menus etc. ESPTerm's
|
||||
mouse tracking was tested using VTTest and should be compatible with all terminal applications
|
||||
that request mouse tracking.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mouse can be tracked in different ways; some are easier to parse, others more powerful. The coordinates
|
||||
can also be encoded in different ways. All mouse tracking options are set using option commands:
|
||||
`CSI ? _n_ h` to enable, `CSI ? _n_ l` to disable option _n_.
|
||||
</p>
|
||||
|
||||
<h4>Mouse Tracking Modes</h4>
|
||||
|
||||
<p>
|
||||
All tracking modes produce three numbers which are then encoded and send to the application.
|
||||
First is the _event number_ N, then the _X and Y coordinates_, 1-based.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mouse buttons are numbered: 1=left, 2=middle, 3=right.
|
||||
Wheel works as two buttons (4 and 5) which generate only press events (no release).
|
||||
</p>
|
||||
|
||||
<div class="tscroll">
|
||||
<table class="nomen">
|
||||
<thead><tr><th>Option</th><th>Name</th><th>Description</th></tr></thead>
|
||||
<tr>
|
||||
<td>`9`</td>
|
||||
<td>*X10~mode*</td>
|
||||
<td>
|
||||
This is the most basic tracking mode, in which <b>only button presses</b> are reported.
|
||||
N = button - 1: (0 left, 1 middle, 2 right, 3, 4 wheel).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1000`</td>
|
||||
<td>*Normal~mode*</td>
|
||||
<td>
|
||||
In Normal mode, both button presses and releases are reported.
|
||||
The lower two bits of N indicate the button pressed:
|
||||
`00b` (0) left, `01b` (1) middle, `10b` (2) right, `11b` (3) button release.
|
||||
Wheel buttons are reported as 0 and 1 with added 64 (e.g. 64 and 65).
|
||||
Normal mode also supports tracking of modifier keys, which are added to N as bit masks:
|
||||
4=_Shift_, 8=_Meta/Alt_, 16=_Control/Cmd_. Example: middle button with _Shift_ = 1 + 4 = `101b` (5).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1002`</td>
|
||||
<td>*Button-Event tracking*</td>
|
||||
<td>
|
||||
This is similar to Normal mode (`1000`), but mouse motion with a button held is also reported.
|
||||
A motion event is generated when the mouse cursor moves between screen character cells.
|
||||
A motion event has the same N as a press event, but 32 is added.
|
||||
For example, drag-drop event with the middle button will produce N = 1 (press), 33 (dragging) and 3 (release).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1003`</td>
|
||||
<td>*Any-Event tracking*</td>
|
||||
<td>
|
||||
This mode is almost identical to Button Event tracking (1002), but motion events
|
||||
are sent even when no mouse buttons are held. This could be used to draw on-screen mouse cursor, for example.
|
||||
Motion events with no buttons will use N = 32 + _11b_ (35).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1004`</td>
|
||||
<td>*Focus~tracking*</td>
|
||||
<td>
|
||||
Focus tracking is a separate function from the other mouse tracking modes, therefore they can be enabled together.
|
||||
Focus tracking reports when the terminal window (in Xterm) gets or loses focus, or in ESPTerm's case, when any
|
||||
user is connected. This can be used to pause/resume a game or on-screen animations.
|
||||
Focus tracking mode sends `CSI I` when the terminal receives, and `CSI O` when it loses focus.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h4>Mouse Report Encoding</h4>
|
||||
|
||||
<p>
|
||||
The following encoding schemes can be used with any of the tracking modes (except Focus tracking, which is not affected).
|
||||
</p>
|
||||
|
||||
<div class="tscroll">
|
||||
<table class="nomen">
|
||||
<thead><tr><th>Option</th><th>Name</th><th>Description</th></tr></thead>
|
||||
<tr>
|
||||
<td>--</td>
|
||||
<td>*Normal~encoding*</td>
|
||||
<td>
|
||||
This is the default encoding scheme used when no other option is selected.
|
||||
In this mode, a mouse report has the format `CSI M _n_ _x_ _y_`,
|
||||
where _n_, _x_ and _y_ are characters with ASCII value = 32 (space) + the respective number, e.g.
|
||||
0 becomes 32 (space), 1 becomes 33 (!). The reason for adding 32 is to avoid producing control characters.
|
||||
Example: `\e[M !!` - left button press at coordinates 1,1 when using X10 mode.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1005`</td>
|
||||
<td>*UTF-8~encoding*</td>
|
||||
<td>
|
||||
This scheme should encode each of the numbers as a UTF-8 code point, expanding the maximum possible value.
|
||||
Since ESPTerm's screen size is limited and this has no practical benefit, this serves simply as an alias
|
||||
to the normal scheme.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1006`</td>
|
||||
<td>*SGR~encoding*</td>
|
||||
<td>
|
||||
In SGR encoding, the response looks like a SGR sequence with the three numbers as semicolon-separated
|
||||
ASCII values. In this case 32 is not added like in the Normal and UTF-8 schemes, because
|
||||
it would serve nor purpose here. Also, button release is not reported as 11b,
|
||||
but using the normal button code while changing the final SGR character: `M` for button press
|
||||
and `m` for button release. Example: `\e[2;80;24m` - the right button was released
|
||||
at row 80, column 24.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>`1015`</td>
|
||||
<td>*URXVT~encoding*</td>
|
||||
<td>
|
||||
This is similar to SGR encoding, but the final character is always `M` and the numbers are
|
||||
like in the Normal scheme, with 32 added. This scheme has no real advantage over the previous schemes and
|
||||
was added solely for completeness.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,84 @@
|
||||
<div class="Box fold">
|
||||
<h2>Basic Intro & Nomenclature</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<img src="/img/vt100.jpg" class="aside" alt="VT102">
|
||||
|
||||
<p>
|
||||
ESPTerm emulates VT102 (pictured) with some additions from later VT models and Xterm.
|
||||
All commonly used attributes and commands are supported.
|
||||
ESPTerm is capable of displaying ncurses applications such as _Midnight Commander_ using _agetty_.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
ESPTerm accepts UTF-8 characters received on the communication UART and displays them on the screen,
|
||||
interpreting some codes as Control Characters. Those are e.g. _Carriage Return_ (13), _Line Feed_ (10),
|
||||
_Tab_ (9), _Backspace_ (8) and _Bell_ (7).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Escape sequences start with the control character _ESC_ (27),
|
||||
followed by any number of ASCII characters forming the body of the command.
|
||||
</p>
|
||||
|
||||
<h3>Nomenclature & Command Types</h3>
|
||||
|
||||
<p>
|
||||
Examples on this help page use the following symbols for special characters and command types:\\
|
||||
(spaces are for clarity only, _DO NOT_ include them in the commands!)
|
||||
</p>
|
||||
|
||||
<div class="tscroll">
|
||||
<table class="nomen">
|
||||
<thead><tr><th>Name</th><th>Symbol</th><th>ASCII</th><th>C string</th><th>Function</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>*ESC*</td>
|
||||
<td>`\e`</td>
|
||||
<td>`ESC` (27)</td>
|
||||
<td>`"\e"`, `"\x1b"`, `"\033"`</td>
|
||||
<td>Introduces an escape sequence. _(Note: `\e` is a GCC extension)_</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*Bell*</td>
|
||||
<td>`\a`</td>
|
||||
<td>`BEL`~(7)</td>
|
||||
<td>`"\a"`, `"\x7"`, `"\07"`</td>
|
||||
<td>Audible beep</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*String Terminator*</td>
|
||||
<td>`ST`</td>
|
||||
<td>`ESC \`~(27~92)<br>_or_~`\a`~(7)</td>
|
||||
<td>`"\x1b\\"`, `"\a"`</td>
|
||||
<td>Terminates a string command (`\a` can be used as an alternative)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*Control Sequence Introducer*</td>
|
||||
<td>`CSI`</td>
|
||||
<td>`ESC [`</td>
|
||||
<td>`"\x1b["`</td>
|
||||
<td>Starts a CSI command. Examples: `\e[?7;10h`, `\e[2J`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*Operating System Command*</td>
|
||||
<td>`OSC`</td>
|
||||
<td>`ESC ]`</td>
|
||||
<td>`"\x1b]"`</td>
|
||||
<td>Starts an OSC command. Is followed by a command string terminated by `ST`. Example: `\e]0;My Screen Title\a`</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*Select Graphic Rendition*</td>
|
||||
<td>`SGR`</td>
|
||||
<td>`CSI <i>n</i>;<i>n</i>;<i>n</i>m`</td>
|
||||
<td>`"\x1b[1;2;3m"`</td>
|
||||
<td>Set text attributes, like color or style. 0 to 10 numbers can be used, `\e[m` is treated as `\e[0m`</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p>There are also some other commands that don't follow the CSI, SGR or OSC pattern, such as `\e7` or
|
||||
`\e#8`. A list of the most important escape sequences is presented in the following sections.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<div class="Box fold">
|
||||
<h2>Screen Behavior & Refreshing</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
The initial screen size, title text and button labels can be configured in <a href="<?= url('cfg_term') ?>">Terminal Settings</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Screen updates are sent to the browser through a WebSocket after some time of inactivity on the communication UART
|
||||
(called "Redraw Delay"). After an update is sent, at least a time of "Redraw Cooldown" must elapse before the next
|
||||
update can be sent. Those delays are used is to avoid burdening the server with tiny updates during a large screen
|
||||
repaint. If you experience issues (broken image due to dropped bytes), try adjusting those config options. It may also
|
||||
be useful to try different baud rates.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
<div class="Box fold theme-0">
|
||||
<h2>Commands: Color SGR</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
Colors are set using SGR commands (like `\e[10;20;30m`). The following tables list the SGR codes to use.
|
||||
Selected colors are used for any new text entered, as well as for empty space when using line and screen clearing commands.
|
||||
The configured default colors can be restored using SGR 39 for foreground and SGR 49 for background.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The actual color representation depends on a color theme which
|
||||
can be selected in <a href="<?= url('cfg_term') ?>">Terminal Settings</a>.
|
||||
</p>
|
||||
|
||||
<h3>Foreground colors</h3>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg7 fg0">30</span>
|
||||
<span class="bg0 fg1">31</span>
|
||||
<span class="bg0 fg2">32</span>
|
||||
<span class="bg0 fg3">33</span>
|
||||
<span class="bg0 fg4">34</span>
|
||||
<span class="bg0 fg5">35</span>
|
||||
<span class="bg0 fg6">36</span>
|
||||
<span class="bg0 fg7">37</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg0 fg8">90</span>
|
||||
<span class="bg0 fg9">91</span>
|
||||
<span class="bg0 fg10">92</span>
|
||||
<span class="bg0 fg11">93</span>
|
||||
<span class="bg0 fg12">94</span>
|
||||
<span class="bg0 fg13">95</span>
|
||||
<span class="bg0 fg14">96</span>
|
||||
<span class="bg0 fg15">97</span>
|
||||
</div>
|
||||
|
||||
<h3>Background colors</h3>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg0 fg15">40</span>
|
||||
<span class="bg1 fg15">41</span>
|
||||
<span class="bg2 fg15">42</span>
|
||||
<span class="bg3 fg0">43</span>
|
||||
<span class="bg4 fg15">44</span>
|
||||
<span class="bg5 fg15">45</span>
|
||||
<span class="bg6 fg15">46</span>
|
||||
<span class="bg7 fg0">47</span>
|
||||
</div>
|
||||
|
||||
<div class="colorprev">
|
||||
<span class="bg8 fg15">100</span>
|
||||
<span class="bg9 fg0">101</span>
|
||||
<span class="bg10 fg0">102</span>
|
||||
<span class="bg11 fg0">103</span>
|
||||
<span class="bg12 fg0">104</span>
|
||||
<span class="bg13 fg0">105</span>
|
||||
<span class="bg14 fg0">106</span>
|
||||
<span class="bg15 fg0">107</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div class="Box fold">
|
||||
<h2>Commands: Style SGR</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<p>
|
||||
All text attributes are set using SGR commands like `\e[10;20;30m`, with up to 10 numbers separated by semicolons.
|
||||
To restore all attributes to their default states, use SGR 0: `\e[0m` or `\e[m`.
|
||||
</p>
|
||||
|
||||
<p>Those are the supported text attributes SGR codes:</p>
|
||||
|
||||
<table>
|
||||
<thead><tr><th>Style</th><th>Enable</th><th>Disable</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><b>Bold</b></td><td>1</td><td>21, 22</td></tr>
|
||||
<tr><td style="opacity:.6">Faint</td><td>2</td><td>22</td></tr>
|
||||
<tr><td><i>Italic</i></td><td>3</td><td>23</td></tr>
|
||||
<tr><td><u>Underlined</u></td><td>4</td><td>24</td></tr>
|
||||
<tr><td>Blink</td><td>5</td><td>25</td></tr>
|
||||
<tr><td><span style="color:black;background:#ccc;">Inverse</span></td><td>7</td><td>27</td></tr>
|
||||
<tr><td><s>Striked</s></td><td>9</td><td>29</td></tr>
|
||||
<tr><td>𝔉𝔯𝔞𝔨𝔱𝔲𝔯</td><td>20</td><td>23</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<div class="Box fold">
|
||||
<h2>Tips & Troubleshooting</h2>
|
||||
|
||||
<div class="Row v">
|
||||
<ul>
|
||||
<li>*Communication UART (Rx, Tx)* can be configured in the <a href="<?= url('cfg_system') ?>">System Settings</a>.
|
||||
|
||||
<li>*Boot log and debug messages* are available on pin *GPIO2* (P2) at 115200\,baud, 1 stop bit, no parity.
|
||||
Those messages may be disabled through compile flags.
|
||||
|
||||
<li>*Loopback test*: Connect the Rx and Tx pins with a piece of wire. Anything you type in the browser should
|
||||
appear on the screen. Set _Parser Timeout = 0_ in <a href="<?= url('cfg_term') ?>">Terminal Settings</a>
|
||||
to be able to manually enter escape sequences.
|
||||
|
||||
<li>There is very little RAM available to the webserver, and it can support at most 4 connections at the same time.
|
||||
Each terminal session (open window with the terminal screen) uses one persistent connection for screen updates.
|
||||
*Avoid leaving unused windows open*, or either the RAM or connections may be exhausted.
|
||||
|
||||
<li>*For best performance*, use the module in Client mode (connected to external network) and minimize the number
|
||||
of simultaneous connections. Enabling AP consumes extra RAM because the DHCP server and Captive Portal
|
||||
DNS server are started.
|
||||
|
||||
<li>In AP mode, *check that the WiFi channel used is clear*; interference may cause flaky connection.
|
||||
A good mobile app to use for this is
|
||||
<a href="https://play.google.com/store/apps/details?id=com.farproc.wifi.analyzer">WiFi Analyzer (Google Play)</a>.
|
||||
Adjust the hotspot strength and range using the _Tx Power setting_.
|
||||
|
||||
<li>Hold the BOOT button (GPIO0 to GND) for ~1 second to force enable AP. Hold it for ~6 seconds to restore default settings.
|
||||
(This is indicated by the blue LED rapidly flashing). Default settings can be overwritten in the
|
||||
<a href="<?= url('cfg_system') ?>">System Settings</a>.
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,93 @@
|
||||
<script>
|
||||
// Workaround for badly loaded page
|
||||
setTimeout(function() {
|
||||
if (typeof termInit == 'undefined' || typeof $ == 'undefined') {
|
||||
console.error("Page load failed, refreshing…");
|
||||
location.reload(true);
|
||||
}
|
||||
}, 3000);
|
||||
</script>
|
||||
|
||||
<div class="Modal light hidden" id="fu_modal">
|
||||
<div id="fu_form" class="Dialog">
|
||||
<div class="fu-content">
|
||||
<h2>Text Upload</h2>
|
||||
<p>
|
||||
<label for="fu_file">Load a text file:</label>
|
||||
<input type="file" id="fu_file" accept="text/*" /><br>
|
||||
<textarea id="fu_text"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<label for="fu_crlf">Line Endings:</label>
|
||||
<select id="fu_crlf">
|
||||
<option value="CR">CR (Enter key)</option>
|
||||
<option value="CRLF">CR LF (Windows)</option>
|
||||
<option value="LF">LF (Linux)</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="fu_delay">Line Delay (ms):</label>
|
||||
<input id="fu_delay" type="number" value=1 min=0>
|
||||
</p>
|
||||
</div>
|
||||
<div class="fu-buttons">
|
||||
<button onclick="TermUpl.start()" class="icn-ok x-fu-go">Start</button>
|
||||
<button onclick="TermUpl.close()" class="icn-cancel x-fu-cancel">Cancel</button>
|
||||
<i class="fu-prog-box">Upload: <span id="fu_prog"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1><!-- Screen title gets loaded here by JS --></h1>
|
||||
|
||||
<div id="term-wrap">
|
||||
<div id="screen" class="theme-%theme%"></div>
|
||||
|
||||
<div id="action-buttons">
|
||||
<button data-n="1"></button><!--
|
||||
--><button data-n="2"></button><!--
|
||||
--><button data-n="3"></button><!--
|
||||
--><button data-n="4"></button><!--
|
||||
--><button data-n="5"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<textarea id="softkb-input" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
|
||||
<nav id="term-nav">
|
||||
<a href="#" onclick="kbOpen(true);return false" class="mq-tablet-max"><i class="icn-keyboard"></i><span><?= tr('term_nav.keybd') ?></span></a><!--
|
||||
--><a href="#" onclick="TermUpl.open();return false"><i class="icn-download"></i><span><?= tr('term_nav.upload') ?></span></a><!--
|
||||
--><a href="<?= url('cfg_term') ?>" class="x-term-conf-btn"><i class="icn-configure"></i><span><?= tr('term_nav.config') ?></span></a><!--
|
||||
--><a href="<?= url('cfg_wifi') ?>" class="x-term-conf-btn"><i class="icn-wifi"></i><span><?= tr('term_nav.wifi') ?></span></a><!--
|
||||
--><a href="<?= url('help') ?>" class="x-term-conf-btn"><i class="icn-help"></i><span><?= tr('term_nav.help') ?></span></a><!--
|
||||
--><a href="<?= url('about') ?>" class="x-term-conf-btn"><i class="icn-about"></i><span><?= tr('term_nav.about') ?></span></a>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
try {
|
||||
window.noAutoShow = true;
|
||||
termInit(); // the screen will be loaded via ajax
|
||||
Screen.load('%j:labels_seq%');
|
||||
|
||||
// auto-clear the input box
|
||||
$('#softkb-input').on('input', function(e) {
|
||||
setTimeout(function(){
|
||||
var str = $('#softkb-input').val();
|
||||
$('#softkb-input').val('');
|
||||
Input.sendString(str);
|
||||
}, 1);
|
||||
});
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
console.error("Fail, reloading in 3s…");
|
||||
setTimeout(function() {
|
||||
location.reload(true);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function kbOpen(yes) {
|
||||
var i = qs('#softkb-input');
|
||||
if (yes) i.focus();
|
||||
else i.blur();
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user