Network WIP

This commit is contained in:
Sebastien L
2022-01-20 13:43:23 -05:00
parent 052600a45a
commit 15c0e47ae3
72 changed files with 1676 additions and 2212 deletions

View File

@@ -5,18 +5,13 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<title>SqueezeESP32</title>
</head>
<body class="d-flex flex-column">
<div style="display:none">
<% if (htmlWebpackPlugin.files.sprites) { %>
<% for (var spriteFileName in htmlWebpackPlugin.files.sprites) { %>
<%= htmlWebpackPlugin.files.sprites[spriteFileName] %>
<% } %>
<% } %>
</div>
<header class="navbar navbar-expand-sm navbar-dark bg-primary sticky-top border-bottom border-dark" id="mainnav">
<a class="navbar-brand" id="navtitle" href="#">SqueezeESP32</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
@@ -24,57 +19,34 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="nav navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#tab-wifi">WiFi</a></li>
<li class="nav-item omsg"><a class="nav-link" data-toggle="tab" href="#tab-syslog">Status<span
<ul class="nav navbar-nav mr-auto" role="tablist">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-wifi">WiFi</a></li>
<li class="nav-item omsg"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-syslog">Status<span
class="badge badge-pill badge-success" id="msgcnt"></span></a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" href="#tab-cfg-audio">Audio</a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" href="#tab-cfg-syst">System</a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" href="#tab-cfg-hw">Hardware</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-cfg-fw">Updates</a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-audio">Audio</a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-syst">System</a></li>
<li class="nav-item orec"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-hw">Hardware</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-cfg-fw">Updates</a></li>
<div class="dropdown-divider"></div>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-nvs">NVS Editor</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-commands">Advanced</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-credits">Credits</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-nvs">NVS Editor</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-commands">Advanced</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" aria-controls="profile" role="tab" href="#tab-credits">Credits</a></li>
</ul>
</div>
<div class="info navbar-right" style="display: inline-flex;">
<svg class="recovery_element " style="fill:orange; width:1.5rem; height: 1.5rem;">
<use xlink:href="#device-recover-fill"></use>
</svg>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use id="battery" xlink:href="#battery-fill"></use>
</svg>
<svg id="o_jack" style="fill:white; width:1.5rem; height: 1.5rem;">
<use xlink:href="#headphone-fill"></use>
</svg>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use id="o_bt" xlink:href="#bluetooth-fill"></use>
</svg>
<span data-toggle="tooltip" id="o_type" data-placement="top" title=""><svg
xmlns="http://www.w3.org/2000/svg" id="output" width="24" height="24" viewBox="0 0 24 24">
<g id="o_i2s" display="none">
<path
d="M2 7L2 8L2 9L2 10L2 11L2 12L2 13L2 14L2 15L2 16L2 17L3 17L3 16L3 15L3 14L3 13L3 12L3 11L3 10L3 9L3 8L2 7M6 7L6 8L6 9L7 9L7 8L8 8L9 8L10 8L10 9L11 9L11 10L11 11L10 11L10 12L9 12L9 13L8 13L8 14L7 14L7 15L6 15L6 16L6 17L7 17L8 17L9 17L10 17L11 17L12 17L12 16L11 16L10 16L9 16L8 16L8 15L9 15L9 14L10 14L10 13L11 13L11 12L12 12L12 11L12 10L12 9L12 8L11 8L11 7L10 7L9 7L8 7L6 7M16 7L16 8L15 8L15 9L15 10L15 11L16 11L16 12L17 12L18 12L18 13L19 13L20 13L21 13L21 14L21 15L20 15L20 16L19 16L18 16L17 16L16 16L16 15L15 15L15 16L15 17L16 17L17 17L18 17L19 17L20 17L21 17L21 16L22 16L22 15L22 14L22 13L21 13L21 12L20 12L20 11L19 11L18 11L17 11L16 11L16 10L16 9L17 9L17 8L18 8L19 8L20 8L21 8L21 9L22 9L22 8L22 7L21 7L20 7L19 7L18 7L16 7z" />
</g>
<g id="o_spdif" display="none">
<path
d="M3 1L3 2L2 2L2 3L2 4L2 5L3 5L3 6L4 6L5 6L5 7L6 7L7 7L8 7L8 8L8 9L7 9L7 10L6 10L5 10L4 10L3 10L3 9L2 9L2 10L2 11L3 11L4 11L5 11L6 11L7 11L8 11L8 10L9 10L9 9L9 8L9 7L8 7L8 6L7 6L7 5L6 5L5 5L4 5L3 5L3 4L3 3L4 3L4 2L5 2L6 2L7 2L8 2L8 3L9 3L9 2L9 1L8 1L7 1L6 1L5 1L3 1M13 1L13 2L13 3L13 4L12 4L12 5L12 6L12 7L12 8L11 8L11 9L11 10L11 11L10 11L10 12L10 13L11 13L11 12L11 11L12 11L12 10L12 9L12 8L13 8L13 7L13 6L13 5L14 5L14 4L14 3L14 2L15 2L15 1L13 1M16 1L16 2L16 3L16 4L16 5L16 6L16 7L16 8L16 9L16 10L16 11L17 11L17 10L17 9L17 8L17 7L18 7L19 7L20 7L21 7L21 6L22 6L22 5L22 4L22 3L22 2L21 2L21 1L20 1L19 1L18 1L16 1z" />
<path style="fill:#272B30;"
d="M17 2L17 3L17 4L17 5L17 6L18 6L19 6L20 6L20 5L21 5L21 4L21 3L20 3L20 2L19 2L17 2z" />
<path
d="M2 13L2 14L2 15L2 16L2 17L2 18L2 19L2 20L2 21L2 22L2 23L3 23L4 23L5 23L6 23L7 23L8 23L8 22L9 22L9 21L10 21L10 20L10 19L10 18L10 17L10 16L10 15L9 15L9 14L8 14L7 14L7 13L6 13L5 13L4 13L2 13M13 13L13 14L13 15L13 16L13 17L13 18L13 19L13 20L13 21L13 22L13 23L14 23L14 22L14 21L14 20L14 19L14 18L14 17L14 16L14 15L14 14L13 13M17 13L17 14L17 15L17 16L17 17L17 18L17 19L17 20L17 21L17 22L17 23L18 23L18 22L18 21L18 20L18 19L18 18L19 18L20 18L21 18L22 18L22 17L21 17L20 17L19 17L18 17L18 16L18 15L18 14L19 14L20 14L21 14L22 14L22 13L21 13L20 13L19 13L17 13z" />
<path style="fill:#272B30;"
d="M3 14L3 15L3 16L3 17L3 18L3 19L3 20L3 21L3 22L4 22L5 22L6 22L7 22L7 21L8 21L8 20L9 20L9 19L9 18L9 17L9 16L8 16L8 15L7 15L7 14L6 14L5 14L3 14z" />
</g>
</svg></span>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use id="wifiStsIcon" xlink:href="#signal-wifi-fill"></use>
</svg>
<span class="recovery_element material-icons " style="color:orange; display: none" >system_update_alt</span>
<span id="battery" class="material-icons" style="fill:white; display: none">battery_full</span>
<span id="o_jack" class="material-icons" style="fill:white; display: none">headphones</span>
<span id="s_airplay" class="material-icons" style="fill:white; display: none">airplay</span>
<em id="s_cspot" class="fab fa-spotify" style="fill:white; display: inline"></em>
<span data-toggle="tooltip" id="o_type" data-placement="top" title="">
<span id="o_bt" class="material-icons" style="fill:white; display: none" >bluetooth</span>
<span id="o_spdif" class="material-icons" style="fill:white; display: none" >graphic_eq</span>
<span id="o_i2s" class="material-icons" style="fill:white; display: none" >speaker</span>
</span>
<span id="ethernet" class="material-icons if_eth" style="fill:white; display: none" >cable</span>
<span id="wifiStsIcon" class="material-icons if_wifi" style="fill:white; display: none">signal_wifi_statusbar_4_bar</span>
</div>
</header>
@@ -108,7 +80,7 @@
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade" id="tab-cfg-hw"></div>
<div class="tab-pane fade" id="tab-cfg-hw"> </div>
<div class="tab-pane fade" id="tab-cfg-syst"></div>
<div class="tab-pane fade" id="tab-cfg-gen"></div>
<div class="tab-pane fade" id="tab-cfg-fw">
@@ -159,7 +131,7 @@
</div>
<div class="col-auto">
<button class="btn-warning ota_element" type="submit" onclick="handleReboot('recovery');" >Recovery</button>
<button id="btn_reboot_recovery" class="btn-warning ota_element" type="submit" >Recovery</button>
</div>
</div>
@@ -179,8 +151,7 @@
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning" data-dismiss="modal"
onclick="hFlash();">Ok</button>
<button id="btn_flash" type="button" class="btn btn-warning" data-dismiss="modal" >Ok</button>
</div>
</div>
</div>
@@ -218,13 +189,12 @@
</tbody>
</table>
<div class="buttons">
<button button id="reboot-button" class="btn btn-primary" style="float:right" type="submit" onclick="handleReboot('reboot');" >Reboot</button>
<button button id="btn_reboot" class="btn btn-primary" style="float:right" type="submit" >Reboot</button>
<input id="save-nvs" type="button" class="btn btn-success" value="Commit">
<input id="save-as-nvs" type="button" class="btn btn-success" value="Download config">
<input id="load-nvs" type="button" class="btn btn-success" value="Load File">
<input aria-describedby="fileHelp" onchange="onChooseFile(event, onFileLoad.bind(this))"
id="nvsfilename" type="file" style="display:none">
<input aria-describedby="fileHelp" id="nvsfilename" type="file" style="display:none">
</div>
</div>
@@ -274,10 +244,8 @@
onclick="hideSurrounding(this)"><span aria-hidden="true">×</span></button></div>
<div class="toast-body" id="msg_cfg-audio-tmpl"></div>
</div>
<button id="save-autoexec1" type="submit" class="btn btn-info" cmdname="cfg-audio-tmpl"
onclick="saveAutoexec1(false)">Save</button>
<button id="commit-autoexec1" type="submit" class="btn btn-warning" cmdname="cfg-audio-tmpl"
onclick="saveAutoexec1(true)">Apply</button>
<button id="save-autoexec1" type="submit" class="btn btn-info" cmdname="cfg-audio-tmpl">Save</button>
<button id="commit-autoexec1" type="submit" class="btn btn-warning" cmdname="cfg-audio-tmpl">Apply</button>
</fieldset>
</div>
</div>
@@ -285,7 +253,11 @@
<div class="tab-pane fade active show" id="tab-wifi">
<div class="card text-white mb-3">
<div class="card-header">WiFi Status</div>
<div class="card-body">
<div class="card-body if_eth" style="display: none">
<h2>Connected to Ethernet</h2>
<p>WiFi is inactive while connected to a wired network.
</div>
<div class="card-body if_wifi" style="display: none" >
<table class="table table-hover">
<thead>
<tr>
@@ -316,8 +288,7 @@
</div>
<div class="modal-footer connecting-success connecting-status">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning" data-dismiss="modal"
onclick="handleDisconnect();">Ok</button>
<button id="btn_disconnect" type="button" class="btn btn-warning" data-dismiss="modal">Ok</button>
</div>
</div>
</div>
@@ -367,8 +338,7 @@
class="btn btn-secondary connecting-init connecting-fail connecting"
data-dismiss="modal">Close</button>
<button type="button" id="btnJoin"
class="btn btn-primary connecting-init connecting-fail"
onclick="handleConnect();">Join</button>
class="btn btn-primary connecting-init connecting-fail">Join</button>
<button type="button" class="connecting btn btn-primary" disabled>
<span class="spinner-border spinner-border-sm" role="status"
aria-hidden="true"></span>
@@ -498,9 +468,9 @@
<footer>
<div class="fixed-bottom d-flex justify-content-between border-top border-dark p-3 bg-primary">
<span class="text-center" id="foot-fw"></span><button class="btn-warning ota_element " id="reboot_nav"
type="submit" onclick="handleReboot('reboot');" style="display: none;">Reboot</button>
<button class="btn-warning recovery_element" id="reboot_ota_nav" type="submit" onclick="handleReboot('reboot_ota');"
style="display: none;">Exit Recovery</button><span class="text-center" id="foot-wifi"></span>
type="submit" style="display: none;">Reboot</button>
<button class="btn-warning recovery_element" id="reboot_ota_nav" type="submit"
style="display: none;">Exit Recovery</button><span class="text-center" id="foot-if"></span>
</div>
</footer>

View File

@@ -1,24 +1,6 @@
//import $ from "jquery";
//import * as _ from 'lodash';
import 'bootstrap';
import '../src/sass/main.scss';
import '../node_modules/remixicon/icons/Device/signal-wifi-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-3-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-2-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-1-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-line.svg';
import '../node_modules/remixicon/icons/Device/battery-line.svg';
import '../node_modules/remixicon/icons/Device/battery-low-line.svg';
import '../node_modules/remixicon/icons/Device/battery-fill.svg';
import '../node_modules/remixicon/icons/Media/headphone-fill.svg';
import '../node_modules/remixicon/icons/Device/device-recover-fill.svg';
import '../node_modules/remixicon/icons/Device/bluetooth-fill.svg';
import '../node_modules/remixicon/icons/Device/bluetooth-connect-fill.svg';
import '../node_modules/remixicon/icons/Media/stop-circle-fill.svg';
import '../node_modules/remixicon/icons/Media/play-circle-fill.svg';
import '../node_modules/remixicon/icons/Media/pause-circle-fill.svg';
import '../node_modules/remixicon/icons/System/lock-fill.svg';
import '../node_modules/remixicon/icons/System/lock-unlock-fill.svg';
import './sass/main.scss';
import './assets/images/favicon-32x32.png';
import './js/custom.js';
// <%= `<svg><use xlink:href="#${htmlWebpackPlugin.files.sprites.svg.defs.symbol[s].id}"></use></svg>` %>

View File

@@ -14,7 +14,7 @@ if (!String.prototype.format) {
if (!String.prototype.encodeHTML) {
Object.assign(String.prototype, {
encodeHTML() {
return he.encode(this).replace(/\n/g, '<br />')
return he.encode(this).replace(/\n/g, '<br />');
},
});
}
@@ -24,7 +24,9 @@ Object.assign(Date.prototype, {
return this.toLocaleString(undefined, opt);
},
});
function isEnabled(val){
return val.match("[Yy1]");
}
const nvsTypes = {
NVS_TYPE_U8: 0x01,
@@ -70,7 +72,12 @@ const btIcons = {
stop: 'stop-circle-fill',
'': '',
};
const batIcons = [
{ icon: "battery_0_bar", ranges: [ {f: 5.8, t: 6.8},{f: 8.8, t: 10.2} ]},
{ icon: "battery_2_bar", ranges: [ {f: 6.8, t: 7.4},{f: 10.2, t: 11.1} ]},
{ icon: "battery_3_bar", ranges: [ {f: 7.4, t: 7.5},{f: 11.1, t: 11.25} ]},
{ icon: "battery_4_bar", ranges: [ {f: 7.5, t: 7.8},{f: 11.25, t: 11.7} ]}
];
const btStateIcons = [
{ desc: 'Idle', sub: ['bt_neutral'] },
{ desc: 'Discovering', sub: ['bt_disconnected'] },
@@ -90,11 +97,12 @@ const pillcolors = {
MESSAGING_ERROR: 'badge-danger',
};
const connectReturnCode = {
UPDATE_CONNECTION_OK : 0,
UPDATE_FAILED_ATTEMPT : 1,
UPDATE_USER_DISCONNECT : 2,
UPDATE_LOST_CONNECTION : 3,
UPDATE_FAILED_ATTEMPT_AND_RESTORE : 4
OK : 0,
FAIL : 1,
DISC : 2,
LOST : 3,
RESTORE : 4,
ETH : 5
}
const taskStates = {
0: 'eRunning',
@@ -120,6 +128,9 @@ let flash_state=flash_status_codes.FLASH_NONE;
let flash_ota_dsc='';
let flash_ota_pct=0;
let older_recovery=false;
let presetsloaded=false;
let is_i2c_locked=false;
function isFlashExecuting(data){
return (flash_state!=flash_status_codes.UPLOADING ) && (data.ota_dsc!='' || data.ota_pct>0);
}
@@ -382,25 +393,16 @@ function handlebtstate(data) {
}
function handleTemplateTypeRadio(outtype) {
$('#o_type').children('span').css({ display : 'none' });
if (outtype === 'bt') {
$('#bt').prop('checked', true);
$('#o_bt').attr('display', 'inline');
$('#o_spdif').attr('display', 'none');
$('#o_i2s').attr('display', 'none');
output = 'bt';
} else if (outtype === 'spdif') {
$('#spdif').prop('checked', true);
$('#o_bt').attr('display', 'none');
$('#o_spdif').attr('display', 'inline');
$('#o_i2s').attr('display', 'none');
output = 'spdif';
} else {
$('#i2s').prop('checked', true);
$('#o_bt').attr('display', 'none');
$('#o_spdif').attr('display', 'none');
$('#o_i2s').attr('display', 'inline');
output = 'i2s';
}
$('#'+output).prop('checked', true);
$('#o_'+output).css({ display : 'inline' });
}
function handleExceptionResponse(xhr, _ajaxOptions, thrownError) {
@@ -465,8 +467,9 @@ let versionName='Squeezelite-ESP32';
let prevmessage='';
let project_name=versionName;
let platform_name=versionName;
let preset_name='';
let btSinkNamesOptSel='#cfg-audio-bt_source-sink_name';
let ConnectedToSSID={};
let ConnectedTo={};
let ConnectingToSSID={};
let lmsBaseUrl;
let prevLMSIP='';
@@ -546,47 +549,36 @@ function getConfigJson(slimMode) {
return config;
}
// eslint-disable-next-line no-unused-vars
function onFileLoad(elementId, event) {
let data = {};
try {
data = JSON.parse(elementId.srcElement.result);
} catch (e) {
alert('Parsing failed!\r\n ' + e);
}
$('input.nvs').each(function(_index, entry) {
if (data[entry.id]) {
if (data[entry.id] !== entry.value) {
console.log(
'Changed ' + entry.id + ' ' + entry.value + '==>' + data[entry.id]
);
$(this).val(data[entry.id]);
// pull json file from https://gist.githubusercontent.com/sle118/dae585e157b733a639c12dc70f0910c5/raw/b462691f69e2ad31ac95c547af6ec97afb0f53db/squeezelite-esp32-presets.json and
// load the names into cfg-hw-preset-model_name
function loadPresets() {
if(presetsloaded) return;
presetsloaded = true;
$.getJSON(
'https://gist.githubusercontent.com/sle118/dae585e157b733a639c12dc70f0910c5/raw/b462691f69e2ad31ac95c547af6ec97afb0f53db/squeezelite-esp32-presets.json',
function(data) {
$.each(data, function(key, val) {
$('#cfg-hw-preset-model_config').append(`<option value="${JSON.stringify(val).replace(/\"/g, '\'')}">${val.name}</option>`);
});
if(preset_name !== ''){
('#prev_preset').show().val(preset_name);
}
console.log('update prev_preset in case of a change');
}
});
).fail(function(jqxhr, textStatus, error) {
const err = textStatus + ', ' + error;
console.log('Request Failed: ' + err);
$('hw-preset-section').hide();
}
);
}
// eslint-disable-next-line no-unused-vars
function onChooseFile(event, onLoadFileHandler) {
if (typeof window.FileReader !== 'function') {
throw "The file API isn't supported on this browser.";
}
const input = event.target;
if (!input) {
throw 'The browser does not properly implement the event object';
}
if (!input.files) {
throw 'This browser does not support the `files` property of the file input.';
}
if (!input.files[0]) {
return undefined;
}
const file = input.files[0];
let fr = new FileReader();
fr.onload = onLoadFileHandler;
fr.readAsText(file);
input.value = '';
}
function delayReboot(duration, cmdname, ota = 'reboot') {
const url = '/'+ota+'.json';
$('tbody#tasks').empty();
@@ -672,14 +664,14 @@ window.saveAutoexec1 = function(apply) {
error: handleExceptionResponse,
complete: function(response) {
if (
response.responseText.result &&
response.responseText &&
JSON.parse(response.responseText).result === 'OK'
) {
showCmdMessage('cfg-audio-tmpl', 'MESSAGING_INFO', 'Done.\n', true);
if (apply) {
delayReboot(1500, 'cfg-audio-tmpl');
}
} else if (response.responseText.result) {
} else if (JSON.parse(response.responseText).result) {
showCmdMessage(
'cfg-audio-tmpl',
'MESSAGING_WARNING',
@@ -798,6 +790,51 @@ $(document).ready(function() {
$('#load-nvs').on('click', function() {
$('#nvsfilename').trigger('click');
});
$('#nvsfilename').on('change', function() {
if (typeof window.FileReader !== 'function') {
throw "The file API isn't supported on this browser.";
}
if (!this.files) {
throw 'This browser does not support the `files` property of the file input.';
}
if (!this.files[0]) {
return undefined;
}
const file = this.files[0];
let fr = new FileReader();
fr.onload = function(e){
let data = {};
try {
data = JSON.parse(e.target.result);
} catch (ex) {
alert('Parsing failed!\r\n ' + ex);
}
$('input.nvs').each(function(_index, entry) {
$(this).parent().removeClass('bg-warning').removeClass('bg-success');
if (data[entry.id]) {
if (data[entry.id] !== entry.value) {
console.log(
'Changed ' + entry.id + ' ' + entry.value + '==>' + data[entry.id]
);
$(this).parent().addClass('bg-warning');
$(this).val(data[entry.id]);
}
else {
$(this).parent().addClass('bg-success');
}
}
});
var changed = $("input.nvs").children('.bg-warning');
if(changed) {
alert('Highlighted values were changed. Press Commit to change on the device');
}
}
fr.readAsText(file);
this.value = null;
}
);
$('#clear-syslog').on('click', function() {
messagecount = 0;
messageseverity = 'MESSAGING_INFO';
@@ -807,7 +844,7 @@ $(document).ready(function() {
$('#wifiTable').on('click','tr', function() {
ConnectingToSSID.Action=ConnectingToActions.CONN;
if($(this).children('td:eq(1)').text() == ConnectedToSSID.ssid){
if($(this).children('td:eq(1)').text() == ConnectedTo.ssid){
ConnectingToSSID.Action=ConnectingToActions.STS;
return;
}
@@ -853,6 +890,39 @@ $(document).ready(function() {
$('*[href*="-nvs"]').hide();
}
});
$('#btn-save-cfg-hw-preset').on('click', function(){
runCommand(this,false);
});
$('#btn-commit-cfg-hw-preset').on('click', function(){
runCommand(this,true);
});
$('#btn_reboot_recovery').on('click',function(){
handleReboot('recovery');
});
$('#btn_reboot').on('click',function(){
handleReboot('reboot');
});
$('#btn_flash').on('click',function(){
hFlash();
});
$('#save-autoexec1').on('click',function(){
saveAutoexec1(false);
});
$('#commit-autoexec1').on('click',function(){
saveAutoexec1(true);
});
$('#btn_disconnect').on('click',function(){
handleDisconnect();
});
$('#btnJoin').on('click',function(){
handleConnect();
});
$('#reboot_nav').on('click',function(){
handleReboot('reboot');
});
$('#reboot_ota_nav').on('click',function(){
handleReboot('reboot_ota');
});
$('#save-as-nvs').on('click', function() {
const config = getConfigJson(true);
@@ -1061,6 +1131,7 @@ $(document).ready(function() {
// start timers
startCheckStatusInterval();
});
// eslint-disable-next-line no-unused-vars
@@ -1085,19 +1156,20 @@ window.setURL = function(button) {
function rssiToIcon(rssi) {
if (rssi >= -55) {
return `signal-wifi-fill`;
return `signal_wifi_statusbar_4_bar`;
} else if (rssi >= -60) {
return `signal-wifi-3-fill`;
return `network_wifi_3_bar`;
} else if (rssi >= -65) {
return `signal-wifi-2-fill`;
return `network_wifi_2_bar`;
} else if (rssi >= -70) {
return `signal-wifi-1-fill`;
return `network_wifi_1_bar`;
} else {
return `signal-wifi-line`;
return `signal_wifi_statusbar_null`;
}
}
function refreshAP() {
if( ConnectedTo.urc === connectReturnCode.ETH) return;
$.getJSON('/scan.json', async function() {
await sleep(2000);
$.getJSON('/ap.json', function(data) {
@@ -1118,13 +1190,9 @@ function refreshAP() {
}
function formatAP(ssid, rssi, auth){
return `<tr data-toggle="modal" data-target="#WifiConnectDialog"><td></td><td>${ssid}</td><td>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use xlink:href="#${rssiToIcon(rssi)}"></use>
</svg>
</td><td>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<span class="material-icons" style="fill:white; display: inline" >${rssiToIcon(rssi)}</span>
</td><td>
<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use xlink:href="#lock${(auth == 0 ? '-unlock':'')}-fill"></use>
</svg>
@@ -1132,6 +1200,7 @@ function formatAP(ssid, rssi, auth){
}
function refreshAPHTML2(data) {
let h = '';
$('#tab-wifi').show();
$('#wifiTable tr td:first-of-type').text('');
$('#wifiTable tr').removeClass('table-success table-warning');
if(data){
@@ -1144,20 +1213,30 @@ function refreshAPHTML2(data) {
$('#wifiTable').append(formatAP('Manual add', 0,0));
$('#wifiTable tr:last').addClass('table-light text-dark').addClass('manual_add');
}
if(ConnectedToSSID.ssid && ( ConnectedToSSID.urc === connectReturnCode.UPDATE_CONNECTION_OK || ConnectedToSSID.urc === connectReturnCode.UPDATE_FAILED_ATTEMPT_AND_RESTORE )){
const wifiSelector=`#wifiTable td:contains("${ConnectedToSSID.ssid}")`;
if($(wifiSelector).filter(function() {return $(this).text() === ConnectedToSSID.ssid; }).length==0){
$('#wifiTable').prepend(`${formatAP(ConnectedToSSID.ssid, ConnectedToSSID.rssi ?? 0, 0)}`);
if(ConnectedTo.ssid && ( ConnectedTo.urc === connectReturnCode.OK || ConnectedTo.urc === connectReturnCode.RESTORE )){
const wifiSelector=`#wifiTable td:contains("${ConnectedTo.ssid}")`;
if($(wifiSelector).filter(function() {return $(this).text() === ConnectedTo.ssid; }).length==0){
$('#wifiTable').prepend(`${formatAP(ConnectedTo.ssid, ConnectedTo.rssi ?? 0, 0)}`);
}
$(wifiSelector).filter(function() {return $(this).text() === ConnectedToSSID.ssid; }).siblings().first().html('&check;').parent().addClass((ConnectedToSSID.urc === connectReturnCode.UPDATE_CONNECTION_OK?'table-success':'table-warning'));
$('span#foot-wifi').html(`SSID: <strong>${ConnectedToSSID.ssid}</strong>, IP: <strong>${ConnectedToSSID.ip}</strong>`);
$('#wifiStsIcon').attr('xlink:href',rssiToIcon(ConnectedToSSID.rssi));
$(wifiSelector).filter(function() {return $(this).text() === ConnectedTo.ssid; }).siblings().first().html('&check;').parent().addClass((ConnectedTo.urc === connectReturnCode.OK?'table-success':'table-warning'));
$('span#foot-if').html(`SSID: <strong>${ConnectedTo.ssid}</strong>, IP: <strong>${ConnectedTo.ip}</strong>`);
$('#wifiStsIcon').html(rssiToIcon(ConnectedTo.rssi));
$(".if_eth").hide();
$('.if_wifi').show();
}
else {
$('span#foot-wifi').html('');
else if(ConnectedTo.urc !== connectReturnCode.ETH){
$('span#foot-if').html('');
}
}
function refreshETH() {
$(".if_eth").show();
$('.if_wifi').hide();
if(ConnectedTo.urc === connectReturnCode.ETH ){
$('span#foot-if').html(`Network: Ethernet, IP: <strong>${ConnectedTo.ip}</strong>`);
}
}
function showTask(task) {
console.debug(
this.toLocaleString() +
@@ -1342,25 +1421,25 @@ function hasConnectionChanged(data){
// netmask: "255.255.255.0"
// ssid: "MyTestSSID"
return (data.urc !== ConnectedToSSID.urc ||
data.ssid !== ConnectedToSSID.ssid ||
data.gw !== ConnectedToSSID.gw ||
data.netmask !== ConnectedToSSID.netmask ||
data.ip !== ConnectedToSSID.ip || data.rssi !== ConnectedToSSID.rssi )
return (data.urc !== ConnectedTo.urc ||
data.ssid !== ConnectedTo.ssid ||
data.gw !== ConnectedTo.gw ||
data.netmask !== ConnectedTo.netmask ||
data.ip !== ConnectedTo.ip || data.rssi !== ConnectedTo.rssi )
}
function handleWifiDialog(data){
if($('#WifiConnectDialog').is(':visible')){
if(ConnectedToSSID.ip) {
$('#ipAddress').text(ConnectedToSSID.ip);
if(ConnectedTo.ip) {
$('#ipAddress').text(ConnectedTo.ip);
}
if(ConnectedToSSID.ssid) {
$('#connectedToSSID' ).text(ConnectedToSSID.ssid);
if(ConnectedTo.ssid) {
$('#connectedToSSID' ).text(ConnectedTo.ssid);
}
if(ConnectedToSSID.gw) {
$('#gateway' ).text(ConnectedToSSID.gw);
if(ConnectedTo.gw) {
$('#gateway' ).text(ConnectedTo.gw);
}
if(ConnectedToSSID.netmask) {
$('#netmask' ).text(ConnectedToSSID.netmask);
if(ConnectedTo.netmask) {
$('#netmask' ).text(ConnectedTo.netmask);
}
if(ConnectingToSSID.Action===undefined || (ConnectingToSSID.Action && ConnectingToSSID.Action == ConnectingToActions.STS)) {
$("*[class*='connecting']").hide();
@@ -1378,30 +1457,30 @@ function handleWifiDialog(data){
}
else {
switch (data.urc) {
case connectReturnCode.UPDATE_CONNECTION_OK:
case connectReturnCode.OK:
if(data.ssid && data.ssid===ConnectingToSSID.ssid){
$("*[class*='connecting']").hide();
$('.connecting-success').show();
ConnectingToSSID.Action = ConnectingToActions.STS;
}
break;
case connectReturnCode.UPDATE_FAILED_ATTEMPT:
case connectReturnCode.FAIL:
//
if(ConnectingToSSID.Action !=ConnectingToActions.STS && ConnectingToSSID.ssid == data.ssid ){
$("*[class*='connecting']").hide();
$('.connecting-fail').show();
}
break;
case connectReturnCode.UPDATE_LOST_CONNECTION:
case connectReturnCode.LOST:
break;
case connectReturnCode.UPDATE_FAILED_ATTEMPT_AND_RESTORE:
case connectReturnCode.RESTORE:
if(ConnectingToSSID.Action !=ConnectingToActions.STS && ConnectingToSSID.ssid != data.ssid ){
$("*[class*='connecting']").hide();
$('.connecting-fail').show();
}
break;
case connectReturnCode.UPDATE_USER_DISCONNECT:
case connectReturnCode.DISC:
// that's a manual disconnect
// if ($('#wifi-status').is(':visible')) {
// $('#wifi-status').slideUp('fast', function() {});
@@ -1416,14 +1495,22 @@ function handleWifiDialog(data){
}
}
function handleWifiStatus(data) {
function handleNetworkStatus(data) {
if(hasConnectionChanged(data)){
ConnectedToSSID=data;
refreshAPHTML2();
ConnectedTo=data;
if(ConnectedTo.urc == connectReturnCode.ETH ){
refreshETH();
}
else {
refreshAPHTML2();
}
}
handleWifiDialog(data);
}
function batteryToIcon(voltage) {
/* Assuming Li-ion 18650s as a power source, 3.9V per cell, or above is treated
as full charge (>75% of capacity). 3.4V is empty. The gauge is loosely
@@ -1431,25 +1518,17 @@ function batteryToIcon(voltage) {
https://learn.adafruit.com/li-ion-and-lipoly-batteries/voltages
using the 0.2C discharge profile for the rest of the values.
*/
if (voltage > 0) {
if (inRange(voltage, 5.8, 6.8) || inRange(voltage, 8.8, 10.2)) {
return `battery-low-line`;
} else if (inRange(voltage, 6.8, 7.4) || inRange(voltage, 10.2, 11.1)) {
return `battery-low-line`;
} else if (
inRange(voltage, 7.4, 7.5) ||
inRange(voltage, 11.1, 11.25)
) {
return `battery-low-line`;
} else if (
inRange(voltage, 7.5, 7.8) ||
inRange(voltage, 11.25, 11.7)
) {
return `battery-fill`;
} else {
return `battery-line`;
for (const iconEntry of batIcons) {
for (const entryRanges of iconEntry.ranges ) {
if(inRange(voltage,entryRanges.f, entryRanges.t)){
return iconEntry.icon;
}
}
}
return "battery_full";
}
function checkStatus() {
RepeatCheckStatusInterval();
@@ -1460,7 +1539,7 @@ function checkStatus() {
getMessages();
$.getJSON('/status.json', function(data) {
handleRecoveryMode(data);
handleWifiStatus(data);
handleNetworkStatus(data);
handlebtstate(data);
handle_flash_state({
ota_pct: (data.ota_pct ?? -1),
@@ -1481,7 +1560,7 @@ function checkStatus() {
$('span#flash-status').html('');
}
if (data.Voltage) {
$('#battery').attr('xlink:href', `#${batteryToIcon(data.Voltage)}`);
$('#battery').html( `${batteryToIcon(data.Voltage)}`);
$('#battery').show();
} else {
$('#battery').hide();
@@ -1491,6 +1570,13 @@ function checkStatus() {
prevmessage = data.message;
showLocalMessage(data.message, 'MESSAGING_INFO')
}
is_i2c_locked = data.is_i2c_locked;
if(is_i2c_locked){
$('flds-cfg-hw-preset').hide();
}
else {
$('flds-cfg-hw-preset').show();
}
$("button[onclick*='handleReboot']").removeClass('rebooting');
if (typeof lmsBaseUrl == "undefined" || data.lms_ip != prevLMSIP && data.lms_ip && data.lms_port) {
@@ -1511,7 +1597,7 @@ function checkStatus() {
});
}
$('#o_jack').attr('display', Number(data.Jack) ? 'inline' : 'none');
$('#o_jack').css({ display : Number(data.Jack) ? 'inline' : 'none' });
blockAjax = false;
}).fail(function(xhr, ajaxOptions, thrownError) {
handleExceptionResponse(xhr, ajaxOptions, thrownError);
@@ -1595,12 +1681,10 @@ window.runCommand = function(button, reboot) {
}
},
success: function(response) {
// var returnedResponse = JSON.parse(response.responseText);
$('.orec').show();
console.log(response.responseText);
console.log(response);
if (
response.responseText &&
JSON.parse(response.responseText).Result === 'Success' &&
JSON.parse(response).Result === 'Success' &&
reboot
) {
delayReboot(2500, button.attributes.cmdname.value);
@@ -1769,6 +1853,7 @@ function getCommands() {
});
}
});
loadPresets();
}).fail(function(xhr, ajaxOptions, thrownError) {
if(xhr.status==404){
$('.orec').hide();
@@ -1817,6 +1902,17 @@ function getConfig() {
} else if (key === 'rel_api') {
releaseURL = val;
}
else if (key === 'enable_airplay') {
$("#s_airplay").css({ display : isEnabled(val) ? 'inline' : 'none' })
}
else if (key === 'enable_cspot') {
$("#s_cspot").css({ display : isEnabled(val) ? 'inline' : 'none' })
}
else if (key == 'preset_name') {
preset_name = val;
}
$('tbody#nvsTable').append(
'<tr>' +
'<td>' +

View File

@@ -2,7 +2,7 @@ let sd = {};
let rf=false;
function getStatus() {
const config = {};
window.$(`#valuesTable input:text, #valuesTable input:checked`).each(function(_index, entry) {
$(`#valuesTable input:text, #valuesTable input:checked`).each(function(_index, entry) {
switch (entry.attributes.dtype.value) {
case 'string':
config[entry.name] = entry.value;
@@ -42,11 +42,11 @@ function getStatus() {
}
window.refreshStatus = function() {
var refreshStatus = function() {
if(Object.keys(sd).length>0){
if(rf) return;
rf=true;
window.$.getJSON('/status.json', function(data) {
$.getJSON('/status.json', function(data) {
for (const property in data) {
const val = data[property];
let input = $(`#val_${property}, #valuesTable input[name="${property}"]`) ;
@@ -64,7 +64,7 @@ function getStatus() {
else {
if(sd[property]){
window.$('#valuesTable').append(
$('#valuesTable').append(
`<tr><td>${property}</td>
<td >
${getRadioButton(property)}
@@ -72,8 +72,8 @@ function getStatus() {
$(`#${property}_${val ?? 0}`).prop('checked',true);
}
else {
window.$('#valuesTable').append(`<tr><td>${property}</td><td><input type='text' class='value form-control nvs' id="val_${property}" name='${property}' dtype='${typeof(val)}' ></input></td></tr>`);
window.$(`#val_${property}`).val(val);
$('#valuesTable').append(`<tr><td>${property}</td><td><input type='text' class='value form-control nvs' id="val_${property}" name='${property}' dtype='${typeof(val)}' ></input></td></tr>`);
$(`#val_${property}`).val(val);
}
@@ -90,7 +90,7 @@ function getStatus() {
}
else {
window.$.getJSON('/statusdefinition.json', function(data) {
$.getJSON('/statusdefinition.json', function(data) {
sd=data;
})
.fail(function() {
@@ -106,7 +106,7 @@ function getStatus() {
timestamp: Date.now(),
status: getStatus()
};
window.$.ajax({
$.ajax({
url: '/status.json',
dataType: 'text',
method: 'POST',
@@ -117,15 +117,15 @@ function getStatus() {
console.log('sent config JSON with data:', JSON.stringify(data));
}
window.$(document).ready(function() {
window.$('#save_status').on('click', function() {
$(document).ready(function() {
$('#save_status').on('click', function() {
pushStatus();
});
window.$( "#valuesTable" ).change(function() {
$( "#valuesTable" ).change(function() {
pushStatus();
});
setInterval(window.refreshStatus, 1000);
setInterval(refreshStatus, 1000);
$('svg >> symbol').each(function() {
$('#allIcons').append( `<svg style="fill:white; width:1.5rem; height: 1.5rem;">
<use xlink:href="#${this.id}"></use>

View File

@@ -1,34 +0,0 @@
// .features:hover {
// cursor: pointer;
// animation: jello-horizontal 1.2s;
// }
// @keyframes jello-horizontal {
// 0% {
// transform: scale3d(1, 1, 1);
// }
// 30% {
// transform: scale3d(1.25, .75, 1);
// }
// 40% {
// transform: scale3d(.75, 1.25, 1);
// }
// 50% {
// transform: scale3d(1.15, .85, 1);
// }
// 65% {
// transform: scale3d(.95, 1.05, 1);
// }
// 75% {
// transform: scale3d(1.05, .95, 1);
// }
// 100% {
// transform: scale3d(1, 1, 1);
// }
// }

View File

@@ -1,5 +1,9 @@
@import 'themes/darkly';
@import "~bootswatch/dist/darkly/variables";
@import "~bootstrap/scss/bootstrap";
@import "~bootswatch/dist/darkly/bootswatch";
@import "utils/style";
@import "utils/mixins";
@import "setup/normalize";
@import "layout/features";

View File

@@ -1,348 +0,0 @@
// /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
// /* Document
// ========================================================================== */
// /**
// * 1. Correct the line height in all browsers.
// * 2. Prevent adjustments of font size after orientation changes in iOS.
// */
// html {
// line-height: 1.15; /* 1 */
// -webkit-text-size-adjust: 100%; /* 2 */
// }
// /* Sections
// ========================================================================== */
// /**
// * Remove the margin in all browsers.
// */
// body {
// margin: 0;
// }
// /**
// * Render the `main` element consistently in IE.
// */
// main {
// display: block;
// }
// /**
// * Correct the font size and margin on `h1` elements within `section` and
// * `article` contexts in Chrome, Firefox, and Safari.
// */
// h1 {
// font-size: 2em;
// margin: .67em 0;
// }
// /* Grouping content
// ========================================================================== */
// /**
// * 1. Add the correct box sizing in Firefox.
// * 2. Show the overflow in Edge and IE.
// */
// hr {
// box-sizing: content-box; /* 1 */
// height: 0; /* 1 */
// overflow: visible; /* 2 */
// }
// /**
// * 1. Correct the inheritance and scaling of font size in all browsers.
// * 2. Correct the odd `em` font sizing in all browsers.
// */
// pre {
// font-family: monospace; /* 1 */
// font-size: 1em; /* 2 */
// }
// /* Text-level semantics
// ========================================================================== */
// /**
// * Remove the gray background on active links in IE 10.
// */
// a {
// background-color: transparent;
// }
// /**
// * 1. Remove the bottom border in Chrome 57-
// * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
// */
// abbr[title] {
// border-bottom: none; /* 1 */
// text-decoration: underline; /* 2 */
// }
// /**
// * Add the correct font weight in Chrome, Edge, and Safari.
// */
// b,
// strong {
// font-weight: bolder;
// }
// /**
// * 1. Correct the inheritance and scaling of font size in all browsers.
// * 2. Correct the odd `em` font sizing in all browsers.
// */
// code,
// kbd,
// samp {
// font-family: monospace; /* 1 */
// font-size: 1em; /* 2 */
// }
// /**
// * Add the correct font size in all browsers.
// */
// small {
// font-size: 80%;
// }
// /**
// * Prevent `sub` and `sup` elements from affecting the line height in
// * all browsers.
// */
// sub,
// sup {
// font-size: 75%;
// line-height: 0;
// position: relative;
// vertical-align: baseline;
// }
// sub {
// bottom: -.25em;
// }
// sup {
// top: -.5em;
// }
// /* Embedded content
// ========================================================================== */
// /**
// * Remove the border on images inside links in IE 10.
// */
// img {
// border-style: none;
// }
// /* Forms
// ========================================================================== */
// /**
// * 1. Change the font styles in all browsers.
// * 2. Remove the margin in Firefox and Safari.
// */
// button,
// input,
// optgroup,
// select,
// textarea {
// font-family: inherit; /* 1 */
// font-size: 100%; /* 1 */
// line-height: 1.15; /* 1 */
// margin: 0; /* 2 */
// }
// /**
// * Show the overflow in IE.
// * 1. Show the overflow in Edge.
// */
// button,
// input { /* 1 */
// overflow: visible;
// }
// /**
// * Remove the inheritance of text transform in Edge, Firefox, and IE.
// * 1. Remove the inheritance of text transform in Firefox.
// */
// button,
// select { /* 1 */
// text-transform: none;
// }
// /**
// * Correct the inability to style clickable types in iOS and Safari.
// */
// button,
// [type="button"],
// [type="reset"],
// [type="submit"] {
// -webkit-appearance: button;
// }
// /**
// * Remove the inner border and padding in Firefox.
// */
// button::-moz-focus-inner,
// [type="button"]::-moz-focus-inner,
// [type="reset"]::-moz-focus-inner,
// [type="submit"]::-moz-focus-inner {
// border-style: none;
// padding: 0;
// }
// /**
// * Restore the focus styles unset by the previous rule.
// */
// button:-moz-focusring,
// [type="button"]:-moz-focusring,
// [type="reset"]:-moz-focusring,
// [type="submit"]:-moz-focusring {
// outline: 1px dotted ButtonText;
// }
// /**
// * Correct the padding in Firefox.
// */
// fieldset {
// padding: .35em .75em .625em;
// }
// /**
// * 1. Correct the text wrapping in Edge and IE.
// * 2. Correct the color inheritance from `fieldset` elements in IE.
// * 3. Remove the padding so developers are not caught out when they zero out
// * `fieldset` elements in all browsers.
// */
// legend {
// box-sizing: border-box; /* 1 */
// color: inherit; /* 2 */
// display: table; /* 1 */
// max-width: 100%; /* 1 */
// padding: 0; /* 3 */
// white-space: normal; /* 1 */
// }
// /**
// * Add the correct vertical alignment in Chrome, Firefox, and Opera.
// */
// progress {
// vertical-align: baseline;
// }
// /**
// * Remove the default vertical scrollbar in IE 10+.
// */
// textarea {
// overflow: auto;
// }
// /**
// * 1. Add the correct box sizing in IE 10.
// * 2. Remove the padding in IE 10.
// */
// [type="checkbox"],
// [type="radio"] {
// box-sizing: border-box; /* 1 */
// padding: 0; /* 2 */
// }
// /**
// * Correct the cursor style of increment and decrement buttons in Chrome.
// */
// [type="number"]::-webkit-inner-spin-button,
// [type="number"]::-webkit-outer-spin-button {
// height: auto;
// }
// /**
// * 1. Correct the odd appearance in Chrome and Safari.
// * 2. Correct the outline style in Safari.
// */
// [type="search"] {
// -webkit-appearance: textfield; /* 1 */
// outline-offset: -2px; /* 2 */
// }
// /**
// * Remove the inner padding in Chrome and Safari on macOS.
// */
// [type="search"]::-webkit-search-decoration {
// -webkit-appearance: none;
// }
// /**
// * 1. Correct the inability to style clickable types in iOS and Safari.
// * 2. Change font properties to `inherit` in Safari.
// */
// ::-webkit-file-upload-button {
// -webkit-appearance: button; /* 1 */
// font: inherit; /* 2 */
// }
// /* Interactive
// ========================================================================== */
// /*
// * Add the correct display in Edge, IE 10+, and Firefox.
// */
// details {
// display: block;
// }
// /*
// * Add the correct display in all browsers.
// */
// summary {
// display: list-item;
// }
// /* Misc
// ========================================================================== */
// /**
// * Add the correct display in IE 10+.
// */
// template {
// display: none;
// }
// /**
// * Add the correct display in IE 10.
// */
// [hidden] {
// display: none;
// }

View File

@@ -1,3 +0,0 @@
@import "~bootswatch/dist/darkly/variables";
@import "~bootstrap/scss/bootstrap";
@import "~bootswatch/dist/darkly/bootswatch";

View File

@@ -1,24 +0,0 @@
// /* Device = Most of the Smartphones Mobiles (Portrait) */
// $screen-xxs-min: 320px;
// $screen-xxs-max: 480px;
// /* Device = Low Resolution Tablets, Mobiles (Landscape) */
// $screen-xs-min: 481px;
// $screen-xs-max: 767px;
// /* Device = Tablets, Ipads (portrait) */
// $screen-sm-min: 768px;
// $screen-sm-max: 1024px;
// /* Device = Laptops, Desktops */
// $screen-md-min: 1025px;
// $screen-md-max: 1280px;
// /* Device = Desktops */
// $screen-lg-min: 1281px;
// $screen-lg-max: 1440px;
// /* Higher Resolution Screens */
// $screen-xlg-min: 1441px;
// $screen-xlg-max: 2560px;

View File

@@ -6,7 +6,7 @@ body {
.border-bottom {
border-width:3px !important;
}
.xl { font-size: 1.5em; line-height: 1em; vertical-align: -.075em; }
.border-top {
border-width:3px !important;
}
@@ -22,397 +22,3 @@ td.value {
#boot-div {
float: right;
}
/* body {
border: 0;
margin: 0;
margin-bottom:50px;
padding-left: 12px;
padding-right: 12px;
padding-bottom: 45px;
}
a {
color: #fff;
transition: color .2s ease-out;
text-decoration: none
}
a:hover {
color: #99f;
text-decoration: none
}
.glyphicon {
font-size: 18px;
}
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
.blur {
-webkit-filter: blur(2px);
-moz-filter: blur(2px);
-ms-filter: blur(2px);
-o-filter: blur(2px);
filter: blur(2px);
}
.ape {
padding: 10px 0px 10px 10px;
background-color: #444;
}
.ape:hover {
cursor: pointer;
}
header {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
}
section {
border-bottom: 1px solid #000;
border-top: 1px solid #000;
}
h1 {
margin: 0;
margin-top: 20px;
padding: 10px;
text-transform: uppercase;
color: #888;
font-size: 1.6em
}
h2 {
margin: 0;
margin-top: 20px;
padding: 10px;
text-transform: uppercase;
color: #888;
font-size: 1.0em
}
h3 {
margin: 0;
text-align: center;
padding: 20px 0px 20px 0px;
}
.gr {
color: green;
}
.rd {
color: red;
}
#wifi-status {
display: none;
}
#connect {
display: none;
}
#connect_manual {
display: none;
}
#manual_ssid {
border: none;
width: 80%;
padding: 10px 0px 10px 10px;
display: block
}
#manual_pwd {
border: none;
width: 80%;
padding: 10px 0px 10px 10px;
display: block
}
#pwd {
border: none;
width: 80%;
padding: 10px 0px 10px 10px;
display: block
}
.buttons {
padding: 15px;
}
#join {
float: right;
}
#manual_join {
float: right;
}
#yes-disconnect {
display: inline-block;
}
#no-disconnect {
display: inline-block;
}
.tctr {
text-align: center;
}
#connect-wait {
display: none;
}
#connect-success {
display: none;
}
#connect-fail {
display: none;
}
#connect-details {
display: none;
}
#diag-disconnect {
display: none;
}
.fr {
float: right;
margin-right: 20px;
} */
/* .w0 {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTJDBGvsAAABzUlEQVRIS+WUTShEURTH3zyRhjQ+8hWxmCJMoSzEwsbCgi1LZRYW9pONptiwka9iI81CWFpYaEqNMkVKmpWN1IhYKN9ZDL/z3p3mxZh5g9X4168799xz/vPefedeLeuVC+3gdTgc07CsmCQ2DI2gg21Jci30wSpGt/CeghickTsHPVACDkgqp67rPgpO4E0ZZMIj7OHhxSvPtEyomcVDeFXJv+EZNvEsNa01rZfAuSUhThR2wU+ObJkbyhRNMMDaDIThBqy1MdZ3wAPawqfFC2Lj0Ab5kpBGxdAJs9TeW72ITUhCPZMjFYwwbwXpnkwlDzOIx50yXwP5c0MeggHGanNqSDqqBqQ7/Kxvg2zHAfMN8IE8uZhYO6eBnBXGKnOakLWfaQZ9jMRjSPXhZUuC5A9JjVFpKkeNSVVA0Tq8KJN0yFl4gilqbW2tm+SQKoybXIG8jcT34RSsh1Byt6iVg2ZLlRCg6JpROqEDpFheXZ5S9rcLFsl5YJwHad+MVA5y13w5lRY5oRsKjdm/Vz/7LR86zG+5wr+9NX+iOowjEO+aELEic+lv1ILppeUPosRst6QduTANgnE2mC+BnYswI1VwfYzCCL9dZij7pWkf6UeSTYAuE/QAAAAASUVORK5CYII=') no-repeat left top;
height: 24px;
}
.w1 {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAHiSURBVEhL5dRPKINxHMfxPVskpA35F3FYEVasHBYHFwcHrhyVZ8vBfblIceEi/4qLtINwdHCQUpQVKcnJRYqIg/J3OYz399nv0YPNtuzEt149+31/v+/n4fGYLVHpup4Rnyregd+K27TIghe63+8fx7wySqsPdbAj3qzha0MOV6ETiwTd4u0HUZxydgrtKISGj0xreG4gEAgycIRXFZCOR2yTQZSebeaa4Q1s7iOiDv/GM1bJLDJv0EHjzHLAdIFNjHBGHpkbxUo9utmbQBg3sM5G2d+AR24w82XznN4QmpGjXrCExRkXfJhk9t6aRW9YDtSwOFDNE9ZNyFLzKRczOegh406FL8ElG8JDM8S1Qtaq7KhEO0Y0TVtHGHusVxCEDy5oMLNqyVrgWm5kqaYw3mdVdmqQsENE8JbAPbY43yszMqiyHOr66QayL5XH0DJeVEgyUTxhjNmPR/vtBpZyc3hHDZohV5DfRvq7OMYtrDdZY7YwFpG8yhBi6JrrMFogww7IT1mOVsxy5oHrNIqRVpWgDtnGKn7log35xurfVxfPW/7QYT57Ybz7mapqgk9gvjU79ApiW5mpRkIvLTe4oJfyK5lKOQndgvG/wXoOSb8I061Svj4G0M9nZ6z198tmeweYtIrMYP17VAAAAABJRU5ErkJggg==') no-repeat left top;
height: 24px;
}
.w2 {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEQAACxEBf2RfkQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAHkSURBVEhL3dRLKERRGMDxuSPSkLzyilgo8iiUhVjYWFiwZancmSzsZSPFho28io1kISwtLKQURZGSrGykiFgo7yyG/zdzznRm5iK5Sk79uvd85/u++5hzx2Pb9q9yDLrJMWhIRB1sv98/ghlliFAXyuGFU21IbECSi9CKORrd4O0TQZyQO45mZMJCpKfZ3BcIBPooOMSravAdD9ikB63sJN1XN69kcQ8vKvknnrBMzyx9gRYCp0aCdo51DJIjr6wU2UoF2lkbxS6uYdYGWV9DtVxgMmbxjFg/apEM/ZQfyUADxqi9M3sRG5CEEib7KnjMvAaye2IbfUVupoMet6r5PDL0YjXBBY4Fai5kRxVCdscg66uQ17HDfAl9kDuXJzB3Thk5sxzzZa6DumHknN3QS+IBPvvh5ZVskN8ZU5+gz3XAlELRIp5Vk6/It/CIYWrjXm3URCkleUsV6iaXkKeR+DaOYH6EkrtCrXxoUf2iJoY8LFB0xXEA9ZBieXS5S3m/jZgi557jBGT7xvWKCxhyIP81ka/SgQ9NSDViURyDbvpTo82yrAPscl4HKxR1aRTT+BhvyhaxtPCSO6OKphfGBc6JZYaX3BnpNN1AUC7AfBrJoRUXR67X6+1BN+fp4dD/Hx7PO4o9VGuAapKIAAAAAElFTkSuQmCC') no-repeat left top;
height: 24px;
}
.w3 {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAACAElEQVRIS7XUP0gbYRjH8VSpiBZJWvEflXYQKtqACg6ig4uDg651LPQSHLpLlyDoUhdpVdBFxEG0YwcHCQgRFJSCFKcuUohY6iC0VYtD9PuE9w3vXZ74h16HD3fv733e53KX9y7ied5/pYZhUkPHQ3TBSyQS7zFvTBC9RivKoK3NCwZS3IxBLNLoBFc3yOEbtR/Qj8d4gEJPt3lVMpkcY8E+Lk2D+/iDTXrQyquwfW3zdiZ38dcU/4tzrNHzib3AAMGhU2BlsYFxauSRtaDWaMMwc1PYwU+4a3PMryMuF5gJTH4ne4dOVMLeZSkx9GCatb/cXmQpKXjOYM+EB4w7ILsn2Og28mNe0ePUNF9CzE7GCZc5NpmxkB31FLI7xpn/DHkc24xXMQb55XIH7s55Qc0Cx0YZ29A2LJyzG95S+AU3/fHySNLUjwTWl9tzG7iqWbSCC9PkNvIunGGStUWP1jcwWijOmIW2yTHkbiTfwle4L6HUfmKtvGi+fr6BowHLLPrBMYVuyGK5dfmV8nx7MUvNb44fIdu3qFdR4KiDfGsKb6WiCn145GQ+ahgmNQyTGpYwxPOWP3qHc/mE+76apaih4hmND2B3TYasJlCjUkPFS5oeORfIkhVtSY0aKqI0TSP/bjCew10+hPf6D+r5fIziDefRwFxJahgmNQyPF7kGEsc1es+A2E4AAAAASUVORK5CYII=') no-repeat left top;
height: 24px;
} */
/* .pw {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTJDBGvsAAABIUlEQVRIS+3VsU7CUBTGcYhBJCwqwcmEJ2DkCQgzb8ADmLgYWXTzMVjcGNjYGEAXgoSRhTg5OroYIyFY/h+hWGwvtzQ0LpzkF8i5l/uRQ2kTjuPEKrC5T79vzHWJO4wxwzeGuMY5AitsQBFvmEObvNQboQBfhQk4gQ5wD+zgBrcYrHrSwzE2KkxAHVrQWB6QgiqJLB7xA+2pYaNsAWm8QAsa0Sn+1gU+oT1NHGFdtoAcJtBCSw1DuaPqQiNdly0gj1doQaMwleavPc+IJUDffKeADO7Rxxe08A4dEOQD2qPXJ1xh+VuYAirQVaNGFFPov2MM0OXm/UAUZRwCtjoEWP1vQBXuLTgKPYRKMAacoY0oIboDNLB8+PgC4hLY3B8nsQCQEf56jLJoQAAAAABJRU5ErkJggg==') no-repeat left top;
height: 24px;
} */
/* SpinKit is licensed under the MIT License. Copyright (c) 2015 Tobias Ahlin */
/* .spinner {
width: 40px;
height: 40px;
position: relative;
margin: 100px auto;
}
.double-bounce1, .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #333;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: bounce 2.0s infinite ease-in-out;
animation: bounce 2.0s infinite ease-in-out;
}
.double-bounce2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes bounce {
0%, 100% { -webkit-transform: scale(0.0) }
50% { -webkit-transform: scale(1.0) }
}
@keyframes bounce {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 50% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
} */
/* end of SpinKit */
/* daduke stuff */
/* input[type='text'], input[type='password'], textarea, select, option {
background: #999;
border: 0;
padding: 4px;
}
.custom-switch {
margin-left: 8px;
}
.custom-switch, .custom-radio {
padding-left: 2.25rem;
padding-bottom: 1rem;
}
.custom-checkbox > .custom-control-label {
padding-top: 0.5rem;
padding-left: 2rem;
padding-bottom: 0.1rem;
}
.custom-switch .custom-control-label::before {
left: -2.25rem;
height: 2rem;
width: 3.5rem;
pointer-events: all;
border-radius: 1rem;
background-color: #f00;
} */
/*
.custom-switch .custom-control-label::after {
top: calc(0.25rem + 2px);
left: calc(-2.25rem + 2px);
width: calc(2rem - 4px);
height: calc(2rem - 4px);
background-color: #adb5bd;
border-radius: 2rem;
transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out;
transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
.custom-switch .custom-control-label::after {
transition: none;
}
} */
/*
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
background-color: #0f0;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
background-color: #fff;
-webkit-transform: translateX(1.5rem);
transform: translateX(1.5rem);
}
textarea#autoexec1, textarea#fwurl, div#upload {
width: 80%;
}
table tr.MESSAGING_INFO {
background: #123;
}
table tr.MESSAGING_WARNING {
background: #330;
}
table tr.MESSAGING_ERROR {
background: #300;
}
input, textarea {
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}
#otadiv {
display: none;
}
#btsinkdiv {
display: none;
}
.tooltip-inner {
font-family: monospace, monospace;
font-size: 70%;
}
#progress {
width: 60%;
}
.progress-bar {
color: #fff;
background-color: #037AF0;
}
span#flash-status {
padding-left: 15px;
font-size: 120%;
} */
/* #info {
padding-top: 7px;
float: right;
display: grid;
} */
/* svg#battery {
fill: #ddd;
}
svg#output {
fill: #ddd;
padding-right: 4px;
}
svg#jack {
fill: #ddd;
padding-right: 4px;
} */
/*
ul#navbar {
border-bottom: 0px;
}
.navbar-nav {
float: left;
margin: 0;
padding-top: 1rem;
}
#content {
border-top: 1px solid black;
} */
/* .footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #555;
color: white;
text-align: center;
} */
/*
.sl {
background-color: #053c1e;
}
.recovery {
background-color: #3c0505;
}
div#message {
display: none;
color: #000;
background: #f00;
position:fixed;
padding: 8px;
top: 20%;
left: 50%;
width:20em;
height:4em;
text-align: center;
margin-left: -10em;
margin-top: -2em;
border-radius: 8px;
box-shadow: 0px 5px 2px -5px rgba(255, 255, 255, 0.5) inset, 0px 10px 20px -5px rgba(255, 255, 255, 0.1) inset, 0 0px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 1px rgba(0, 0, 0, 0.12), 0 1px 10px 0 rgba(0, 0, 0, 0.3);
z-index: 20;
} */
/*
*/
/*
#searchfw {
float: right;
display: none;
} */
/* button#updateAP {
float: right;
display: inline;
} */

View File

@@ -16,7 +16,18 @@
<% } %>
<% } %>
</div>
<div id="allIcons"></div>
<div id="allIcons"><i class="recovery_element ri-device-recover-fill ri-xl" style="color:orange; " ></i>
<i class="ri-battery-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-headphone-fill ri-xl" style="fill:white; "></i>
<i class= "ri-bluetooth-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-speaker-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-voiceprint ri-xl" style="fill:white; " ></i>
<i class= "ri-signal-wifi-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-signal-wifi-3-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-signal-wifi-2-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-signal-wifi-1-fill ri-xl" style="fill:white; " ></i>
<i class= "ri-signal-wifi-line ri-xl" style="fill:white; " ></i>
</div>
<div class="card border-primary mb-3">
<div class="card-header">Status Variables</div>

View File

@@ -1,23 +1,5 @@
import 'bootstrap';
import '../src/sass/main.scss';
import './sass/main.scss';
import './js/test.js';
import '../node_modules/remixicon/icons/Device/signal-wifi-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-3-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-2-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-1-fill.svg';
import '../node_modules/remixicon/icons/Device/signal-wifi-line.svg';
import '../node_modules/remixicon/icons/Device/battery-line.svg';
import '../node_modules/remixicon/icons/Device/battery-low-line.svg';
import '../node_modules/remixicon/icons/Device/battery-fill.svg';
import 'remixicon/fonts/remixicon.css';
import '../node_modules/remixicon/icons/Media/headphone-fill.svg';
import '../node_modules/remixicon/icons/Device/device-recover-fill.svg';
import '../node_modules/remixicon/icons/Device/bluetooth-fill.svg';
import '../node_modules/remixicon/icons/Device/bluetooth-connect-fill.svg';
import '../node_modules/remixicon/icons/Media/stop-circle-fill.svg';
import '../node_modules/remixicon/icons/Media/stop-circle-line.svg';
import '../node_modules/remixicon/icons/Logos/google-play-fill.svg';
import '../node_modules/remixicon/icons/Media/pause-fill.svg';
import '../node_modules/remixicon/icons/Media/stop-fill.svg';
import '../node_modules/remixicon/icons/System/lock-fill.svg';
import '../node_modules/remixicon/icons/System/lock-unlock-fill.svg';