WiFi sections hiding, STA auto enable on scan click, Terminal colors preview, better explanations, CONFIGURABLE UART
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<div class="Box">
|
||||
<div class="Row explain">
|
||||
<?= tr('admin.explain') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-restore"
|
||||
onclick="return confirm('<?= tr('admin.confirm_restore') ?>');"
|
||||
href="<?= e(url('restore_defaults')) ?>"
|
||||
>
|
||||
<?= tr('admin.restore_defaults') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a onclick="writeDefaults(); return false;" href="#"><?= tr('admin.write_defaults') ?></a>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a onclick="return confirm('<?= tr('admin.confirm_restore_hard') ?>');"
|
||||
href="<?= e(url('restore_hard')) ?>"
|
||||
>
|
||||
<?= tr('admin.restore_hard') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function writeDefaults() {
|
||||
var pw = prompt('<?= tr('admin.confirm_store_defaults') ?>');
|
||||
if (!pw) return;
|
||||
location.href = <?=json_encode(url('write_defaults')) ?> + '?pw=' + pw;
|
||||
}
|
||||
</script>
|
||||
@@ -12,7 +12,7 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
|
||||
<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" name="sta_dhcp_enable" value="%sta_dhcp_enable%">
|
||||
<input type="hidden" id="sta_dhcp_enable" name="sta_dhcp_enable" value="%sta_dhcp_enable%">
|
||||
</div>
|
||||
|
||||
<div class="Row x-static">
|
||||
@@ -43,9 +43,13 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
|
||||
</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>
|
||||
<label for="ap_addr_mask"><?= tr('net.ap_addr_mask') ?></label>
|
||||
<input type="text" name="ap_addr_mask" id="ap_addr_mask" value="%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="%ap_addr_ip%" <?=$ipmask?> required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
@@ -59,13 +63,9 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
|
||||
</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="%ap_addr_ip%" <?=$ipmask?> required>
|
||||
</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="%ap_addr_mask%" <?=$ipmask?> required>
|
||||
<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">
|
||||
@@ -86,10 +86,13 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
|
||||
|
||||
<script>
|
||||
function updateStaticDisp() {
|
||||
$('.x-static').toggleClass('hidden', $('#sta_dhcp_enable').val());
|
||||
var sttc = !parseInt($('#sta_dhcp_enable').val());
|
||||
$('.x-static').toggleClass('hidden', !sttc);
|
||||
}
|
||||
$('.x-static-toggle').on('click', function() {
|
||||
updateStaticDisp();
|
||||
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>
|
||||
@@ -1,67 +1,69 @@
|
||||
<form class="Box mobopen str" action="<?= e(url('app_set')) ?>" method="GET" id='form-1'>
|
||||
<h2><?= tr('app.defaults') ?></h2>
|
||||
<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('app.explain_initials') ?>
|
||||
<?= tr('term.explain_initials') ?>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_width"><?= tr('app.term_width') ?></label>
|
||||
<input type="number" step=1 min=1 max=255 name="term_width" id="term_width" value="%term_width%" required>
|
||||
<div style="font-family:monospace; font-size: 16pt; padding: 5px;" id="color-example"><?= tr("term.example") ?></div>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_height"><?= tr('app.term_height') ?></label>
|
||||
<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="default_fg"><?= tr("app.default_fg") ?></label>
|
||||
<select name="default_fg" id="default_fg">
|
||||
<label for="default_fg"><?= tr("term.default_fg") ?></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>
|
||||
<script>qs('#default_fg').selectedIndex = %default_fg%;</script>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="default_bg"><?= tr("app.default_bg") ?></label>
|
||||
<select name="default_bg" id="default_bg">
|
||||
<label for="default_bg"><?= tr("term.default_bg") ?></label>
|
||||
<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>
|
||||
<script>qs('#default_bg').selectedIndex = %default_bg%;</script>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_title"><?= tr('app.term_title') ?></label>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="term_height"><?= tr('term.term_height') ?></label>
|
||||
<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="%term_title%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="btn1"><?= tr("app.btn1") ?></label>
|
||||
<label for="btn1"><?= tr("term.btn1") ?></label>
|
||||
<input class="short" type="text" name="btn1" id="btn1" value="%btn1%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="btn2"><?= tr("app.btn2") ?></label>
|
||||
<label for="btn2"><?= tr("term.btn2") ?></label>
|
||||
<input class="short" type="text" name="btn2" id="btn2" value="%btn2%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="btn3"><?= tr("app.btn3") ?></label>
|
||||
<label for="btn3"><?= tr("term.btn3") ?></label>
|
||||
<input class="short" type="text" name="btn3" id="btn3" value="%btn3%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="btn4"><?= tr("app.btn4") ?></label>
|
||||
<label for="btn4"><?= tr("term.btn4") ?></label>
|
||||
<input class="short" type="text" name="btn4" id="btn4" value="%btn4%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label for="btn5"><?= tr("app.btn5") ?></label>
|
||||
<label for="btn5"><?= tr("term.btn5") ?></label>
|
||||
<input class="short" type="text" name="btn5" id="btn5" value="%btn5%">
|
||||
</div>
|
||||
|
||||
@@ -69,3 +71,16 @@
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$('#default_fg').val(%default_fg%);
|
||||
$('#default_bg').val(%default_bg%);
|
||||
|
||||
function showColor() {
|
||||
var ex = qs('#color-example');
|
||||
ex.className = '';
|
||||
ex.classList.add('fg'+$('#default_fg').val());
|
||||
ex.classList.add('bg'+$('#default_bg').val());
|
||||
}
|
||||
showColor();
|
||||
</script>
|
||||
@@ -1,28 +1,28 @@
|
||||
<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">
|
||||
<div class="Row checkbox x-ap-toggle">
|
||||
<label><?= tr('wifi.enable') ?></label><!--
|
||||
--><span class="box" tabindex=0></span>
|
||||
<input type="hidden" name="ap_enable" value="%ap_enable%">
|
||||
<input type="hidden" id="ap_enabled" name="ap_enable" value="%ap_enable%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<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="%ap_ssid%" required>
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<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="%ap_password%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<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">
|
||||
<div class="Row range x-ap-on">
|
||||
<label for="tpw">
|
||||
<?= tr('wifi.tpw') ?>
|
||||
<span class="display x-disp1 mq-phone"></span>
|
||||
@@ -31,7 +31,7 @@
|
||||
<span class="display x-disp2 mq-no-phone"></span>
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox">
|
||||
<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%">
|
||||
@@ -45,16 +45,21 @@
|
||||
<form class="Box str mobcol" action="<?= e(url('wifi_set')) ?>" method="GET" id="form-2">
|
||||
<h2 tabindex=0><?= tr('wifi.sta') ?></h2>
|
||||
|
||||
<div class="Row checkbox">
|
||||
<div class="Row checkbox x-sta-toggle">
|
||||
<label><?= tr('wifi.enable') ?></label><!--
|
||||
--><span class="box" tabindex=0></span>
|
||||
<input type="hidden" name="sta_enable" value="%sta_enable%">
|
||||
<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">
|
||||
<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">
|
||||
@@ -72,11 +77,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ap-box">
|
||||
<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-noscan" class="hidden"><?= tr('wifi.cant_scan_no_sta') ?></div>
|
||||
<div id="ap-list" class="hidden"></div>
|
||||
</div>
|
||||
|
||||
@@ -85,24 +89,35 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="Modal hidden" id="psk-modal">
|
||||
<div class="Dialog">
|
||||
<form id="conn-form" onsubmit="submitPskModal(); return false;">
|
||||
<input type="hidden" id="conn-ssid"><!--
|
||||
--><label for="conn-passwd"><?= tr('wifi.sta_password') ?></label><!--
|
||||
--><input type="text" id="conn-passwd"><!--
|
||||
--><input type="submit" value="<?= tr('confirm') ?>">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
WiFi.scan_url = '<?= url('wifi_scan', true) ?>';
|
||||
WiFi.init({
|
||||
mode: '%opmode%',
|
||||
sta_ssid: '%sta_ssid%',
|
||||
sta_password: '%sta_password%',
|
||||
sta_active_ip: '%sta_active_ip%',
|
||||
sta_active_ssid: '%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>
|
||||
|
||||
Reference in New Issue
Block a user