mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
Update webpack and web ui to recent versions, bug fixes
This commit is contained in:
@@ -30,6 +30,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"label": "webpack: prod server",
|
||||
"script": "prod",
|
||||
"promptOnClose": true,
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"owner": "webpack",
|
||||
"severity": "error",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "ERROR in (.*)",
|
||||
"file": 1
|
||||
},
|
||||
{
|
||||
"regexp": "\\((\\d+),(\\d+)\\):(.*)",
|
||||
"line": 1,
|
||||
"column": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": "Compiling\\.\\.\\.",
|
||||
"endsPattern": "Compiled successfully\\."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"label": "webpack: build",
|
||||
|
||||
7
components/wifi-manager/webapp/dist/css/index.04bd6e438114e559773d.css
vendored
Normal file
7
components/wifi-manager/webapp/dist/css/index.04bd6e438114e559773d.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/webapp/dist/css/index.04bd6e438114e559773d.css.gz
vendored
Normal file
BIN
components/wifi-manager/webapp/dist/css/index.04bd6e438114e559773d.css.gz
vendored
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
components/wifi-manager/webapp/dist/index.html.gz
vendored
BIN
components/wifi-manager/webapp/dist/index.html.gz
vendored
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,4 +1,3 @@
|
||||
import 'bootstrap';
|
||||
import './sass/main.scss';
|
||||
import './js/test.js';
|
||||
import 'remixicon/fonts/remixicon.css';
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{"ssid":"Pantum-AP-A6D49F","chan":11,"rssi":-55,"auth":4, "known":false},
|
||||
{"ssid":"a0308","chan":1,"rssi":-56,"auth":3, "known":false},
|
||||
{"ssid":"dlink-D9D8","chan":11,"rssi":-82,"auth":4, "known":false},
|
||||
{"ssid":"Linksys06730","chan":7,"rssi":-85,"auth":3, "known":false},
|
||||
{"ssid":"Linksys06730","chan":7,"rssi":-85,"auth":0, "known":false},
|
||||
{"ssid":"SINGTEL-5171","chan":9,"rssi":-88,"auth":4, "known":false},
|
||||
{"ssid":"1126-1","chan":11,"rssi":-89,"auth":4, "known":false},
|
||||
{"ssid":"The Shah 5GHz-2","chan":1,"rssi":-90,"auth":3, "known":false},
|
||||
{"ssid":"The Shah 5GHz-2","chan":1,"rssi":-90,"auth":0, "known":false},
|
||||
{"ssid":"SINGTEL-1D28 (2G)","chan":11,"rssi":-91,"auth":3, "known":false},
|
||||
{"ssid":"dlink-F864","chan":1,"rssi":-92,"auth":4, "known":false},
|
||||
{"ssid":"dlink-74F0","chan":1,"rssi":-93,"auth":4, "known":false},
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"argtable": [{
|
||||
"datatype": "squeezelite-1fe714",
|
||||
"glossary": "New Name",
|
||||
"longopts": "name",
|
||||
"longopts": "new_name",
|
||||
"shortopts": "n",
|
||||
"checkbox": false,
|
||||
"remark": false,
|
||||
@@ -745,10 +745,10 @@
|
||||
"telnet": "Telnet and Serial"
|
||||
},
|
||||
"cfg-syst-name": {
|
||||
"name": "squeezelite-1fe714"
|
||||
"new_name": "squeezelite-1fe714"
|
||||
},
|
||||
"cfg-hw-preset": {
|
||||
"model_config": ""
|
||||
"model_config": "previous config value"
|
||||
},
|
||||
"cfg-audio-general": {
|
||||
"jack_behavior": "Subwoofer"
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
"node-sass": "^5.0.0",
|
||||
"postcss": "^8.2.4",
|
||||
"postcss-loader": "^4.2.0",
|
||||
"purgecss-webpack-plugin": "^4.1.3",
|
||||
"remixicon": "^2.5.0",
|
||||
"sass-loader": "^10.1.1",
|
||||
"string-argv": "^0.3.1",
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<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>
|
||||
<title></title>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="d-flex flex-column">
|
||||
<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>
|
||||
<a class="navbar-brand" id="navtitle" href="#"></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
||||
@@ -62,14 +62,15 @@ const nvsTypes = {
|
||||
NVS_TYPE_ANY: 0xff /*! < Must be last */,
|
||||
};
|
||||
const btIcons = {
|
||||
bt_playing: 'play-circle-fill',
|
||||
bt_disconnected: 'bluetooth-fill',
|
||||
bt_neutral: '',
|
||||
bt_connected: 'bluetooth-connect-fill',
|
||||
bt_disabled: '',
|
||||
play_arrow: 'play-circle-fill',
|
||||
pause: 'pause-circle-fill',
|
||||
stop: 'stop-circle-fill',
|
||||
bt_playing: 'media_bluetooth_on',
|
||||
bt_disconnected: 'media_bluetooth_off',
|
||||
bt_neutral: 'bluetooth',
|
||||
bt_connecting: 'bluetooth_searching',
|
||||
bt_connected: 'bluetooth_connected',
|
||||
bt_disabled: 'bluetooth_disabled',
|
||||
play_arrow: 'play_circle_filled',
|
||||
pause: 'pause_circle',
|
||||
stop: 'stop_circle',
|
||||
'': '',
|
||||
};
|
||||
const batIcons = [
|
||||
@@ -80,10 +81,10 @@ const batIcons = [
|
||||
];
|
||||
const btStateIcons = [
|
||||
{ desc: 'Idle', sub: ['bt_neutral'] },
|
||||
{ desc: 'Discovering', sub: ['bt_disconnected'] },
|
||||
{ desc: 'Discovered', sub: ['bt_disconnected'] },
|
||||
{ desc: 'Discovering', sub: ['bt_connecting'] },
|
||||
{ desc: 'Discovered', sub: ['bt_connecting'] },
|
||||
{ desc: 'Unconnected', sub: ['bt_disconnected'] },
|
||||
{ desc: 'Connecting', sub: ['bt_disconnected'] },
|
||||
{ desc: 'Connecting', sub: ['bt_connecting'] },
|
||||
{
|
||||
desc: 'Connected',
|
||||
sub: ['bt_connected', 'play_arrow', 'bt_playing', 'pause', 'stop'],
|
||||
@@ -378,19 +379,18 @@ function handlebtstate(data) {
|
||||
let icon = '';
|
||||
let tt = '';
|
||||
if (data.bt_status !== undefined && data.bt_sub_status !== undefined) {
|
||||
const iconsvg = btStateIcons[data.bt_status].sub[data.bt_sub_status];
|
||||
if (iconsvg) {
|
||||
icon = `#${btIcons[iconsvg]}`;
|
||||
const iconindex = btStateIcons[data.bt_status].sub[data.bt_sub_status];
|
||||
if (iconindex) {
|
||||
icon = btIcons[iconindex];
|
||||
tt = btStateIcons[data.bt_status].desc;
|
||||
} else {
|
||||
icon = `#${btIcons.bt_connected}`;
|
||||
icon = btIcons.bt_connected;
|
||||
tt = 'Output status';
|
||||
}
|
||||
}
|
||||
$('#o_type').title = tt;
|
||||
$('#o_bt').attr('xlink:href',icon);
|
||||
|
||||
|
||||
$('#o_type').attr('title', tt);
|
||||
$('#o_bt').html(icon);
|
||||
}
|
||||
function handleTemplateTypeRadio(outtype) {
|
||||
$('#o_type').children('span').css({ display : 'none' });
|
||||
@@ -466,6 +466,7 @@ let hostName = '';
|
||||
let versionName='Squeezelite-ESP32';
|
||||
let prevmessage='';
|
||||
let project_name=versionName;
|
||||
let board_model='';
|
||||
let platform_name=versionName;
|
||||
let preset_name='';
|
||||
let btSinkNamesOptSel='#cfg-audio-bt_source-sink_name';
|
||||
@@ -549,36 +550,101 @@ function getConfigJson(slimMode) {
|
||||
return config;
|
||||
}
|
||||
|
||||
function handleHWPreset(allfields,reboot){
|
||||
|
||||
const selJson = JSON.parse(allfields[0].value);
|
||||
var cmd=allfields[0].attributes.cmdname.value;
|
||||
|
||||
console.log(`selected model: ${selJson.name}`);
|
||||
let confPayload={
|
||||
timestamp: Date.now(),
|
||||
config : { model_config : {value:selJson.name,type:33 }}
|
||||
};
|
||||
for(const [name, value] of Object.entries(selJson.config)){
|
||||
const storedval=(typeof value === 'string' || value instanceof String)?value:JSON.stringify(value);
|
||||
confPayload.config[name] = {
|
||||
value : storedval,
|
||||
type: 33,
|
||||
}
|
||||
showCmdMessage(
|
||||
cmd,
|
||||
'MESSAGING_INFO',
|
||||
`Setting ${name}=${storedval} `,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
showCmdMessage(
|
||||
cmd,
|
||||
'MESSAGING_INFO',
|
||||
`Committing `,
|
||||
true
|
||||
);
|
||||
$.ajax({
|
||||
url: '/config.json',
|
||||
dataType: 'text',
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
data: JSON.stringify(confPayload),
|
||||
error: function(xhr, _ajaxOptions, thrownError){
|
||||
handleExceptionResponse(xhr, _ajaxOptions, thrownError);
|
||||
showCmdMessage(
|
||||
cmd,
|
||||
'MESSAGING_ERROR',
|
||||
`Unexpected error ${(thrownError !== '')?thrownError:'with return status = '+xhr.status} `,
|
||||
true
|
||||
);
|
||||
},
|
||||
success: function(response) {
|
||||
showCmdMessage(
|
||||
cmd,
|
||||
'MESSAGING_INFO',
|
||||
`Saving complete `,
|
||||
true
|
||||
);
|
||||
console.log(response);
|
||||
if (reboot) {
|
||||
delayReboot(2500, cmd);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 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($("#cfg-hw-preset-model_config").length == 0) return;
|
||||
if(presetsloaded) return;
|
||||
presetsloaded = true;
|
||||
$('#cfg-hw-preset-model_config').html('<option>--</option>');
|
||||
$.getJSON(
|
||||
'https://gist.githubusercontent.com/sle118/dae585e157b733a639c12dc70f0910c5/raw/b462691f69e2ad31ac95c547af6ec97afb0f53db/squeezelite-esp32-presets.json',
|
||||
'https://gist.githubusercontent.com/sle118/dae585e157b733a639c12dc70f0910c5/raw/',
|
||||
{_: new Date().getTime()},
|
||||
function(data) {
|
||||
$.each(data, function(key, val) {
|
||||
$('#cfg-hw-preset-model_config').append(`<option value="${JSON.stringify(val).replace(/\"/g, '\'')}">${val.name}</option>`);
|
||||
$('#cfg-hw-preset-model_config').append(`<option value='${JSON.stringify(val).replace(/"/g, '\"').replace(/\'/g, '\"')}'>${val.name}</option>`);
|
||||
if(preset_name !=='' && preset_name==val.name){
|
||||
$('#cfg-hw-preset-model_config').val(preset_name);
|
||||
}
|
||||
});
|
||||
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();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function delayReboot(duration, cmdname, ota = 'reboot') {
|
||||
const url = '/'+ota+'.json';
|
||||
$('tbody#tasks').empty();
|
||||
@@ -736,9 +802,6 @@ window.handleConnect = function(){
|
||||
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('#wifiTable').on('click','tr', function() {
|
||||
|
||||
});
|
||||
$('#fw-url-input').on('input', function() {
|
||||
if($(this).val().length>8 && ($(this).val().startsWith('http://') || $(this).val().startsWith('https://'))){
|
||||
$('#start-flash').show();
|
||||
@@ -890,12 +953,6 @@ $(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');
|
||||
});
|
||||
@@ -1192,15 +1249,11 @@ function formatAP(ssid, rssi, auth){
|
||||
return `<tr data-toggle="modal" data-target="#WifiConnectDialog"><td></td><td>${ssid}</td><td>
|
||||
<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>
|
||||
|
||||
<span class="material-icons">${(auth == 0 ? 'no_encryption':'lock')}</span>
|
||||
</td></tr>`;
|
||||
}
|
||||
function refreshAPHTML2(data) {
|
||||
let h = '';
|
||||
$('#tab-wifi').show();
|
||||
$('#wifiTable tr td:first-of-type').text('');
|
||||
$('#wifiTable tr').removeClass('table-success table-warning');
|
||||
if(data){
|
||||
@@ -1221,8 +1274,7 @@ function refreshAPHTML2(data) {
|
||||
$(wifiSelector).filter(function() {return $(this).text() === ConnectedTo.ssid; }).siblings().first().html('✓').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 if(ConnectedTo.urc !== connectReturnCode.ETH){
|
||||
$('span#foot-if').html('');
|
||||
@@ -1230,9 +1282,7 @@ function refreshAPHTML2(data) {
|
||||
|
||||
}
|
||||
function refreshETH() {
|
||||
|
||||
$(".if_eth").show();
|
||||
$('.if_wifi').hide();
|
||||
|
||||
if(ConnectedTo.urc === connectReturnCode.ETH ){
|
||||
$('span#foot-if').html(`Network: Ethernet, IP: <strong>${ConnectedTo.ip}</strong>`);
|
||||
}
|
||||
@@ -1496,13 +1546,17 @@ function handleWifiDialog(data){
|
||||
}
|
||||
}
|
||||
function handleNetworkStatus(data) {
|
||||
if(hasConnectionChanged(data)){
|
||||
if(hasConnectionChanged(data) || !data.urc){
|
||||
ConnectedTo=data;
|
||||
if(ConnectedTo.urc == connectReturnCode.ETH ){
|
||||
refreshETH();
|
||||
$(".if_eth").hide();
|
||||
$('.if_wifi').hide();
|
||||
if(!data.urc || ConnectedTo.urc == connectReturnCode.ETH ){
|
||||
$('.if_wifi').show();
|
||||
refreshAPHTML2();
|
||||
}
|
||||
else {
|
||||
refreshAPHTML2();
|
||||
$(".if_eth").show();
|
||||
refreshETH();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1546,15 +1600,18 @@ function checkStatus() {
|
||||
ota_dsc: (data.ota_dsc ??''),
|
||||
event: flash_events.PROCESS_OTA_STATUS
|
||||
});
|
||||
|
||||
if (data.project_name && data.project_name !== '') {
|
||||
project_name = data.project_name;
|
||||
}
|
||||
if(data.platform_name && data.platform_name!==''){
|
||||
platform_name = data.platform_name;
|
||||
}
|
||||
if(board_model==='') board_model = project_name;
|
||||
if(board_model==='') board_model = 'Squeezelite-ESP32';
|
||||
if (data.version && data.version !== '') {
|
||||
versionName=data.version;
|
||||
$("#navtitle").html(`${project_name}${recovery?'<br>[recovery]':''}`);
|
||||
$("#navtitle").html(`${board_model}${recovery?'<br>[recovery]':''}`);
|
||||
$('span#foot-fw').html(`fw: <strong>${versionName}</strong>, mode: <strong>${recovery?"Recovery":project_name}</strong>`);
|
||||
} else {
|
||||
$('span#flash-status').html('');
|
||||
@@ -1614,38 +1671,41 @@ window.runCommand = function(button, reboot) {
|
||||
false
|
||||
);
|
||||
const fields = document.getElementById('flds-' + cmdstring);
|
||||
const allfields = fields?.querySelectorAll('select,input');
|
||||
if(cmdstring ==='cfg-hw-preset') return handleHWPreset(allfields,reboot);
|
||||
cmdstring += ' ';
|
||||
if (fields) {
|
||||
const allfields = fields.querySelectorAll('select,input');
|
||||
for (var i = 0; i < allfields.length; i++) {
|
||||
const attr = allfields[i].attributes;
|
||||
|
||||
for(const field of allfields) {
|
||||
let qts = '';
|
||||
let opt = '';
|
||||
let isSelect = $(allfields[i]).is('select');
|
||||
const hasValue=attr.hasvalue.value === 'true';
|
||||
const validVal=(isSelect && allfields[i].value !== '--' ) || ( !isSelect && allfields[i].value !== '' );
|
||||
let attr=field.attributes;
|
||||
let isSelect = $(field).is('select');
|
||||
const hasValue=attr?.hasvalue?.value === 'true';
|
||||
const validVal=(isSelect && field.value !== '--' ) || ( !isSelect && field.value !== '' );
|
||||
|
||||
if ( !hasValue|| hasValue && validVal) {
|
||||
if (attr.longopts.value !== 'undefined') {
|
||||
opt += '--' + attr.longopts.value;
|
||||
} else if (attr.shortopts.value !== 'undefined') {
|
||||
if (attr?.longopts?.value !== 'undefined') {
|
||||
opt += '--' + attr?.longopts?.value;
|
||||
} else if (attr?.shortopts?.value !== 'undefined') {
|
||||
opt = '-' + attr.shortopts.value;
|
||||
}
|
||||
|
||||
if (attr.hasvalue.value === 'true') {
|
||||
if (allfields[i].value !== '') {
|
||||
qts = /\s/.test(allfields[i].value) ? '"' : '';
|
||||
cmdstring += opt + ' ' + qts + allfields[i].value + qts + ' ';
|
||||
if (attr?.hasvalue?.value === 'true') {
|
||||
if (attr?.value !== '') {
|
||||
qts = /\s/.test(field.value) ? '"' : '';
|
||||
cmdstring += opt + ' ' + qts + field.value + qts + ' ';
|
||||
}
|
||||
} else {
|
||||
// this is a checkbox
|
||||
if (allfields[i].checked) {
|
||||
if (field?.checked) {
|
||||
cmdstring += opt + ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(cmdstring);
|
||||
|
||||
const data = {
|
||||
@@ -1705,13 +1765,7 @@ function getCommands() {
|
||||
const isConfig = cmdParts[0] === 'cfg';
|
||||
const targetDiv = '#tab-' + cmdParts[0] + '-' + cmdParts[1];
|
||||
let innerhtml = '';
|
||||
|
||||
// innerhtml+='<tr class="table-light"><td>'+(isConfig?'<h1>':'');
|
||||
innerhtml +=
|
||||
'<div class="card text-white mb-3"><div class="card-header">' +
|
||||
command.help.encodeHTML().replace(/\n/g, '<br />') +
|
||||
'</div><div class="card-body">';
|
||||
innerhtml += '<fieldset id="flds-' + command.name + '">';
|
||||
innerhtml += `<div class="card text-white mb-3"><div class="card-header">${command.help.encodeHTML().replace(/\n/g, '<br />')}</div><div class="card-body"><fieldset id="flds-${command.name}">`;
|
||||
if (command.argtable) {
|
||||
command.argtable.forEach(function(arg) {
|
||||
let placeholder = arg.datatype || '';
|
||||
@@ -1719,8 +1773,6 @@ function getCommands() {
|
||||
const curvalue = getLongOps(data,command.name,arg.longopts);
|
||||
|
||||
let attributes = 'hasvalue=' + arg.hasvalue + ' ';
|
||||
|
||||
// attributes +='datatype="'+arg.datatype+'" ';
|
||||
attributes += 'longopts="' + arg.longopts + '" ';
|
||||
attributes += 'shortopts="' + arg.shortopts + '" ';
|
||||
attributes += 'checkbox=' + arg.checkbox + ' ';
|
||||
@@ -1738,25 +1790,9 @@ function getCommands() {
|
||||
attributes += ' style="visibility: hidden;"';
|
||||
}
|
||||
if (arg.checkbox) {
|
||||
innerhtml +=
|
||||
'<div class="form-check"><label class="form-check-label">';
|
||||
innerhtml +=
|
||||
'<input type="checkbox" ' +
|
||||
attributes +
|
||||
' class="form-check-input ' +
|
||||
extraclass +
|
||||
'" value="" >' +
|
||||
arg.glossary.encodeHTML() +
|
||||
'<small class="form-text text-muted">Previous value: ' +
|
||||
(curvalue ? 'Checked' : 'Unchecked') +
|
||||
'</small></label>';
|
||||
innerhtml += `<div class="form-check"><label class="form-check-label"><input type="checkbox" ${attributes} class="form-check-input ${extraclass}" value="" >${arg.glossary.encodeHTML()}<small class="form-text text-muted">Previous value: ${(curvalue ? 'Checked' : 'Unchecked')}</small></label>`;
|
||||
} else {
|
||||
innerhtml +=
|
||||
'<div class="form-group" ><label for="' +
|
||||
ctrlname +
|
||||
'">' +
|
||||
arg.glossary.encodeHTML() +
|
||||
'</label>';
|
||||
innerhtml +=`<div class="form-group" ><label for="${ctrlname}">${arg.glossary.encodeHTML()}</label>`;
|
||||
if (placeholder.includes('|')) {
|
||||
extraclass = placeholder.startsWith('+') ? ' multiple ' : '';
|
||||
placeholder = placeholder
|
||||
@@ -1770,54 +1806,23 @@ function getCommands() {
|
||||
});
|
||||
innerhtml += '</select>';
|
||||
} else {
|
||||
innerhtml +=
|
||||
'<input type="text" class="form-control ' +
|
||||
extraclass +
|
||||
'" placeholder="' +
|
||||
placeholder +
|
||||
'" ' +
|
||||
attributes +
|
||||
'>';
|
||||
innerhtml +=`<input type="text" class="form-control ${extraclass}" placeholder="${placeholder}" ${attributes}>`;
|
||||
}
|
||||
innerhtml +=
|
||||
'<small class="form-text text-muted">Previous value: ' +
|
||||
(curvalue || '') +
|
||||
'</small>';
|
||||
innerhtml +=`<small class="form-text text-muted">Previous value: ${(curvalue || '')}</small>`;
|
||||
}
|
||||
innerhtml += '</div>';
|
||||
});
|
||||
}
|
||||
innerhtml += '<div style="margin-top: 16px;">';
|
||||
innerhtml +=
|
||||
'<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" style="display: none;" id="toast_' +
|
||||
command.name +
|
||||
'">';
|
||||
innerhtml +=
|
||||
'<div class="toast-header"><strong class="mr-auto">Result</strong><button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close" onclick="$(this).parent().parent().hide()">';
|
||||
innerhtml +=
|
||||
'<span aria-hidden="true">×</span></button></div><div class="toast-body" id="msg_' +
|
||||
command.name +
|
||||
'"></div></div>';
|
||||
innerhtml += `<div style="margin-top: 16px;">
|
||||
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" style="display: none;" id="toast_${command.name}">
|
||||
<div class="toast-header"><strong class="mr-auto">Result</strong><button type="button" class="ml-2 mb-1 close click_to_close" data-dismiss="toast" aria-label="Close" >
|
||||
<span aria-hidden="true">×</span></button></div><div class="toast-body" id="msg_${command.name}"></div></div>`;
|
||||
if (isConfig) {
|
||||
innerhtml +=
|
||||
'<button type="submit" class="btn btn-info" id="btn-save-' +
|
||||
command.name +
|
||||
'" cmdname="' +
|
||||
command.name +
|
||||
'" onclick="runCommand(this,false)">Save</button>';
|
||||
innerhtml +=
|
||||
'<button type="submit" class="btn btn-warning" id="btn-commit-' +
|
||||
command.name +
|
||||
'" cmdname="' +
|
||||
command.name +
|
||||
'" onclick="runCommand(this,true)">Apply</button>';
|
||||
`<button type="submit" class="btn btn-info sclk" id="btn-save-${command.name}" cmdname="${command.name}">Save</button>
|
||||
<button type="submit" class="btn btn-warning cclk" id="btn-commit-${command.name}" cmdname="${command.name}">Apply</button>`;
|
||||
} else {
|
||||
innerhtml +=
|
||||
'<button type="submit" class="btn btn-success" id="btn-run-' +
|
||||
command.name +
|
||||
'" cmdname="' +
|
||||
command.name +
|
||||
'" onclick="runCommand(this,false)">Execute</button>';
|
||||
innerhtml +=`<button type="submit" class="btn btn-success sclk" id="btn-run-${command.name}" cmdname="${command.name}">Execute</button>`;
|
||||
}
|
||||
innerhtml += '</div></fieldset></div></div>';
|
||||
if (isConfig) {
|
||||
@@ -1827,7 +1832,9 @@ function getCommands() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(".click_to_close").on('click', function(){$(this).parent().parent().hide()});
|
||||
$(".sclk").on('click',function(){runCommand(this,false);});
|
||||
$(".cclk").on('click',function(){runCommand(this,true);});
|
||||
data.commands.forEach(function(command) {
|
||||
$('[cmdname=' + command.name + ']:input').val('');
|
||||
$('[cmdname=' + command.name + ']:checkbox').prop('checked', false);
|
||||
@@ -1861,7 +1868,6 @@ function getCommands() {
|
||||
else {
|
||||
handleExceptionResponse(xhr, ajaxOptions, thrownError);
|
||||
}
|
||||
|
||||
$('#commands-list').empty();
|
||||
blockAjax = false;
|
||||
});
|
||||
@@ -1911,7 +1917,9 @@ function getConfig() {
|
||||
else if (key == 'preset_name') {
|
||||
preset_name = val;
|
||||
}
|
||||
|
||||
else if (key=='board_model') {
|
||||
board_model=val;
|
||||
}
|
||||
|
||||
$('tbody#nvsTable').append(
|
||||
'<tr>' +
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
|
||||
@import "~bootswatch/dist/darkly/variables";
|
||||
@import "utils/variables";
|
||||
@import "~bootstrap/scss/bootstrap";
|
||||
@import "~bootswatch/dist/darkly/bootswatch";
|
||||
@import "utils/style";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@import "utils/style";
|
||||
@@ -0,0 +1,3 @@
|
||||
$enable-gradients: false;
|
||||
// This is needed below, otherwise colors look washed out
|
||||
$table-bg-level: 0;
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'bootstrap';
|
||||
import './sass/main.scss';
|
||||
import './js/test.js';
|
||||
import 'remixicon/fonts/remixicon.css';
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/css/index.5712d0365318b239ca44.css.gz BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/css/index.04bd6e438114e559773d.css.gz BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/favicon-32x32.png BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/index.html.gz BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/js/index.41c7e6.bundle.js.gz BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/index.html.gz BINARY)
|
||||
target_add_binary_data( __idf_wifi-manager webapp/dist/js/index.79297e.bundle.js.gz BINARY)
|
||||
|
||||
@@ -1,34 +1,29 @@
|
||||
// Automatically generated. Do not edit manually!.
|
||||
#include <inttypes.h>
|
||||
extern const uint8_t _index_5712d0365318b239ca44_css_gz_start[] asm("_binary_index_5712d0365318b239ca44_css_gz_start");
|
||||
extern const uint8_t _index_5712d0365318b239ca44_css_gz_end[] asm("_binary_index_5712d0365318b239ca44_css_gz_end");
|
||||
extern const uint8_t _index_04bd6e438114e559773d_css_gz_start[] asm("_binary_index_04bd6e438114e559773d_css_gz_start");
|
||||
extern const uint8_t _index_04bd6e438114e559773d_css_gz_end[] asm("_binary_index_04bd6e438114e559773d_css_gz_end");
|
||||
extern const uint8_t _favicon_32x32_png_start[] asm("_binary_favicon_32x32_png_start");
|
||||
extern const uint8_t _favicon_32x32_png_end[] asm("_binary_favicon_32x32_png_end");
|
||||
extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start");
|
||||
extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end");
|
||||
extern const uint8_t _index_41c7e6_bundle_js_gz_start[] asm("_binary_index_41c7e6_bundle_js_gz_start");
|
||||
extern const uint8_t _index_41c7e6_bundle_js_gz_end[] asm("_binary_index_41c7e6_bundle_js_gz_end");
|
||||
extern const uint8_t _index_html_gz_start[] asm("_binary_index_html_gz_start");
|
||||
extern const uint8_t _index_html_gz_end[] asm("_binary_index_html_gz_end");
|
||||
extern const uint8_t _index_79297e_bundle_js_gz_start[] asm("_binary_index_79297e_bundle_js_gz_start");
|
||||
extern const uint8_t _index_79297e_bundle_js_gz_end[] asm("_binary_index_79297e_bundle_js_gz_end");
|
||||
const char * resource_lookups[] = {
|
||||
"/css/index.5712d0365318b239ca44.css.gz",
|
||||
"/css/index.04bd6e438114e559773d.css.gz",
|
||||
"/favicon-32x32.png",
|
||||
"/index.html.gz",
|
||||
"/js/index.41c7e6.bundle.js.gz",
|
||||
"/index.html.gz",
|
||||
"/js/index.79297e.bundle.js.gz",
|
||||
""
|
||||
};
|
||||
const uint8_t * resource_map_start[] = {
|
||||
_index_5712d0365318b239ca44_css_gz_start,
|
||||
_index_04bd6e438114e559773d_css_gz_start,
|
||||
_favicon_32x32_png_start,
|
||||
_index_html_gz_start,
|
||||
_index_41c7e6_bundle_js_gz_start,
|
||||
_index_html_gz_start
|
||||
_index_79297e_bundle_js_gz_start
|
||||
};
|
||||
const uint8_t * resource_map_end[] = {
|
||||
_index_5712d0365318b239ca44_css_gz_end,
|
||||
_index_04bd6e438114e559773d_css_gz_end,
|
||||
_favicon_32x32_png_end,
|
||||
_index_html_gz_end,
|
||||
_index_41c7e6_bundle_js_gz_end,
|
||||
_index_html_gz_end
|
||||
_index_79297e_bundle_js_gz_end
|
||||
};
|
||||
|
||||
@@ -16,6 +16,12 @@ const { merge } = require('webpack-merge');
|
||||
const devserver = require('./webpack/webpack.dev.js');
|
||||
const fs = require('fs');
|
||||
const zlib = require("zlib");
|
||||
const PurgeCSSPlugin = require('purgecss-webpack-plugin')
|
||||
|
||||
|
||||
const PATHS = {
|
||||
src: path.join(__dirname, 'src')
|
||||
}
|
||||
|
||||
class BuildEventsHook {
|
||||
constructor(name, fn, stage = 'afterEmit') {
|
||||
@@ -30,13 +36,12 @@ class BuildEventsHook {
|
||||
|
||||
|
||||
module.exports = (env, options) => (
|
||||
merge(options.mode === "production" ? {} : devserver,
|
||||
merge(env.WEBPACK_SERVE ? devserver : {},
|
||||
{
|
||||
entry:
|
||||
{
|
||||
index: './src/index.ts'
|
||||
},
|
||||
devtool: "source-map",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@@ -61,11 +66,10 @@ module.exports = (env, options) => (
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.scss$|\.css$/,
|
||||
use: [
|
||||
// options.mode !== "production"
|
||||
// ? "style-loader":
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: "../",
|
||||
@@ -81,7 +85,7 @@ module.exports = (env, options) => (
|
||||
},
|
||||
},
|
||||
"sass-loader",
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
@@ -175,19 +179,12 @@ module.exports = (env, options) => (
|
||||
// minRatio: 0.8,
|
||||
// deleteOriginalAssets: false
|
||||
// }),
|
||||
new CompressionPlugin({
|
||||
//filename: '[path].gz[query]',
|
||||
test: /\.js$|\.css$|\.html$/,
|
||||
filename: "[path][base].gz",
|
||||
|
||||
algorithm: 'gzip',
|
||||
|
||||
threshold: 100,
|
||||
minRatio: 0.8,
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "css/[name].[contenthash].css",
|
||||
}),
|
||||
new PurgeCSSPlugin({
|
||||
paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true }),
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
jQuery: "jquery",
|
||||
@@ -196,6 +193,16 @@ module.exports = (env, options) => (
|
||||
Util: "exports-loader?Util!bootstrap/js/dist/util",
|
||||
Dropdown: "exports-loader?Dropdown!bootstrap/js/dist/dropdown",
|
||||
}),
|
||||
new CompressionPlugin({
|
||||
//filename: '[path].gz[query]',
|
||||
test: /\.js$|\.css$|\.html$/,
|
||||
filename: "[path][base].gz",
|
||||
|
||||
algorithm: 'gzip',
|
||||
|
||||
threshold: 100,
|
||||
minRatio: 0.8,
|
||||
}),
|
||||
new BuildEventsHook('Update C App',
|
||||
function (stats, arguments) {
|
||||
if (options.mode !== "production") return;
|
||||
@@ -253,7 +260,6 @@ extern const uint8_t * resource_map_end[];`;
|
||||
let lookupMapStart = 'const uint8_t * resource_map_start[] = {\n';
|
||||
let lookupMapEnd = 'const uint8_t * resource_map_end[] = {\n';
|
||||
let cMake = '';
|
||||
list.push('./dist/index.html.gz');
|
||||
list.forEach(fileName => {
|
||||
|
||||
let exportName = fileName.match(regex)[2].replace(/[\. \-]/gm, '_');
|
||||
@@ -262,8 +268,8 @@ extern const uint8_t * resource_map_end[];`;
|
||||
lookupDef += '\t"/' + relativeName + '",\n';
|
||||
lookupMapStart += '\t_' + exportName + '_start,\n';
|
||||
lookupMapEnd += '\t_' + exportName + '_end,\n';
|
||||
cMake += `target_add_binary_data( __idf_wifi-manager ${path.posix.relative(path.posix.resolve(process.cwd(),'..','..'),fileName)
|
||||
} BINARY)\n`;
|
||||
cMake += `target_add_binary_data( __idf_wifi-manager ${path.posix.relative(path.posix.resolve(process.cwd(),'..','..'),fileName)} BINARY)\n`;
|
||||
console.log(`Post build: adding cmake file reference to ${path.posix.relative(path.posix.resolve(process.cwd(),'..','..'),fileName)} from C project.`);
|
||||
});
|
||||
|
||||
lookupDef += '""\n};\n';
|
||||
@@ -329,20 +335,16 @@ extern const uint8_t * resource_map_end[];`;
|
||||
//new BundleAnalyzerPlugin()
|
||||
|
||||
],
|
||||
// runtimeChunk: 'single',
|
||||
// splitChunks: {
|
||||
// chunks: 'all',
|
||||
// // maxInitialRequests: Infinity,
|
||||
// // minSize: 0,
|
||||
// cacheGroups: {
|
||||
// vendor: {
|
||||
// test: /node_modules/, // you may add "vendor.js" here if you want to
|
||||
// name: "node-modules",
|
||||
// chunks: "initial",
|
||||
// enforce: true
|
||||
// },
|
||||
// }
|
||||
// }
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
styles: {
|
||||
name: 'styles',
|
||||
test: /\.css$/,
|
||||
chunks: 'all',
|
||||
enforce: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// output: {
|
||||
// filename: "[name].js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***********************************
|
||||
webpack_headers
|
||||
dist/css/index.5712d0365318b239ca44.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.41c7e6.bundle.js.gz
|
||||
dist/css/index.04bd6e438114e559773d.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.79297e.bundle.js.gz
|
||||
***********************************/
|
||||
#pragma once
|
||||
#include <inttypes.h>
|
||||
|
||||
@@ -106,6 +106,7 @@ module.exports ={
|
||||
entry: {
|
||||
test: './src/test.ts',
|
||||
},
|
||||
devtool:"source-map",
|
||||
devServer: {
|
||||
|
||||
contentBase: path.resolve(__dirname, './dist'),
|
||||
|
||||
Reference in New Issue
Block a user