Skip to content

Commit

Permalink
Merge branch 'master-v4.3' into cherry-jz-master
Browse files Browse the repository at this point in the history
  • Loading branch information
JacekZubielik committed Oct 11, 2023
1 parent b87ac59 commit 4933033
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2023-10-11
- Reduce the size of binaries (Fixes https://github.com/sle118/squeezelite-esp32/issues/329)
- [WEB] Allow running without LMS with option "Audio/Disable Squeezelite"

2023-10.07
- catchup with official cspot
Expand Down
48 changes: 48 additions & 0 deletions ToggleGitTracking.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
param (
[Parameter(Position=0, Mandatory=$false)]
[ValidateSet("t", "u")]
[string]$option
)

# Define the directory to apply changes to
$targetDir = "components\wifi-manager\webapp\dist"

# Get the current directory
$currentDir = Get-Location

# Get list of files from the file system
$fsFiles = Get-ChildItem -Recurse $targetDir -File | ForEach-Object {
$_.FullName.Substring($currentDir.Path.Length + 1).Replace("\", "/")
}

# Get list of files from the Git index
$indexFiles = git ls-files -s $targetDir | ForEach-Object {
($_ -split "\s+")[3]
}

# Combine and remove duplicates
$allFiles = $fsFiles + $indexFiles | Sort-Object -Unique

# Apply the git command based on the option
$allFiles | ForEach-Object {
$relativePath = $_
$isInIndex = $indexFiles -contains $relativePath

if ($null -eq $option) {
$status = if ($isInIndex) { 'tracked' } else { 'not tracked' }
Write-Host "$relativePath is $status"
}
elseif ($isInIndex) {
if ($option -eq "t") {
git update-index --no-skip-worktree $relativePath
Write-Host "Started tracking changes in $relativePath"
}
elseif ($option -eq "u") {
git update-index --skip-worktree $relativePath
Write-Host "Stopped tracking changes in $relativePath"
}
}
else {
Write-Host "File $relativePath is not tracked."
}
}
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion components/wifi-manager/webapp/dist/index.html

Large diffs are not rendered by default.

Binary file modified components/wifi-manager/webapp/dist/index.html.gz
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

This file was deleted.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions components/wifi-manager/webapp/dist/src/js/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ declare function getStatus(): {};
declare function getStatus(): {};
declare function getStatus(): {};
declare function getStatus(): {};
declare function getStatus(): {};
declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string;
declare function getRadioButton(entry: any): string;
Expand Down Expand Up @@ -196,6 +198,7 @@ declare function pushStatus(): void;
declare function pushStatus(): void;
declare function pushStatus(): void;
declare function pushStatus(): void;
declare function pushStatus(): void;
declare let sd: {};
declare let rf: boolean;
declare function refreshStatus(): void;
3 changes: 1 addition & 2 deletions components/wifi-manager/webapp/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@

<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" id="disable-squeezelite"
value="" checked="">
<input class="form-check-input" type="checkbox" id="disable-squeezelite" value="" >
Disable Squeezelite
</label>
</div>
Expand Down
50 changes: 39 additions & 11 deletions components/wifi-manager/webapp/src/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,10 @@ window.saveAutoexec1 = function (apply) {
};
data.config = {
autoexec1: { value: commandLine, type: 33 },
autoexec: {
value: $('#disable-squeezelite').prop('checked') ? '0' : '1',
type: 33,
},
// autoexec: {
// value: $('#disable-squeezelite').prop('checked') ? '0' : '1',
// type: 33,
// },
};

$.ajax({
Expand Down Expand Up @@ -1216,6 +1216,28 @@ $(document).ready(function () {
}
});

$('#disable-squeezelite').on('click', function () {
// this.checked = this.checked ? 1 : 0;
// $('#disable-squeezelite').prop('checked')
if (this.checked) {
// Store the current value before overwriting it
const currentValue = $('#cmd_opt_s').val();
$('#cmd_opt_s').data('originalValue', currentValue);

// Overwrite the value with '-disable'
$('#cmd_opt_s').val('-disable');
} else {
// Retrieve the original value
const originalValue = $('#cmd_opt_s').data('originalValue');

// Restore the original value if it exists, otherwise set it to an empty string
$('#cmd_opt_s').val(originalValue ? originalValue : '');
}

});



$('input#show-nvs').on('click', function () {
this.checked = this.checked ? 1 : 0;
Cookies.set("show-nvs", this.checked ? 'Y' : 'N');
Expand Down Expand Up @@ -2199,13 +2221,7 @@ function getConfig() {
.sort()
.forEach(function (key) {
let val = data[key].value;
if (key === 'autoexec') {
if (data.autoexec.value === '0') {
$('#disable-squeezelite')[0].checked = true;
} else {
$('#disable-squeezelite')[0].checked = false;
}
} else if (key === 'autoexec1') {
if (key === 'autoexec1') {
/* call new function to parse the squeezelite options */
processSqueezeliteCommandLine(val);
} else if (key === 'host_name') {
Expand Down Expand Up @@ -2294,6 +2310,7 @@ function processSqueezeliteCommandLine(val) {
commandBTSinkName= parsed.otherOptions.btname;
}
handleTemplateTypeRadio('bt');

}
Object.keys(parsed.options).forEach(function (key) {
const option = parsed.options[key];
Expand All @@ -2312,6 +2329,17 @@ function processSqueezeliteCommandLine(val) {
$('#resample_i').prop('checked', true);
}
}
if (parsed.options.hasOwnProperty('s')) {
// parse -u v[:i] and check the appropriate radio button with id #resample_v
if(parsed.options.s === '-disable'){
$('#disable-squeezelite')[0].checked = true;
}
else {
$('#disable-squeezelite')[0].checked = false;
}
}




}
Expand Down
4 changes: 2 additions & 2 deletions components/wifi-manager/webapp/webapp.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target_add_binary_data( __idf_wifi-manager webapp/dist/css/index.1ab179394339385e0a02.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.b02584.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/js/node_vendors.b02584.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/js/index.1b8c7b.bundle.js.gz BINARY)
target_add_binary_data( __idf_wifi-manager webapp/dist/js/node_vendors.1b8c7b.bundle.js.gz BINARY)
20 changes: 10 additions & 10 deletions components/wifi-manager/webapp/webpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ extern const uint8_t _favicon_32x32_png_start[] asm("_binary_favicon_32x32_png_s
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_b02584_bundle_js_gz_start[] asm("_binary_index_b02584_bundle_js_gz_start");
extern const uint8_t _index_b02584_bundle_js_gz_end[] asm("_binary_index_b02584_bundle_js_gz_end");
extern const uint8_t _node_vendors_b02584_bundle_js_gz_start[] asm("_binary_node_vendors_b02584_bundle_js_gz_start");
extern const uint8_t _node_vendors_b02584_bundle_js_gz_end[] asm("_binary_node_vendors_b02584_bundle_js_gz_end");
extern const uint8_t _index_1b8c7b_bundle_js_gz_start[] asm("_binary_index_1b8c7b_bundle_js_gz_start");
extern const uint8_t _index_1b8c7b_bundle_js_gz_end[] asm("_binary_index_1b8c7b_bundle_js_gz_end");
extern const uint8_t _node_vendors_1b8c7b_bundle_js_gz_start[] asm("_binary_node_vendors_1b8c7b_bundle_js_gz_start");
extern const uint8_t _node_vendors_1b8c7b_bundle_js_gz_end[] asm("_binary_node_vendors_1b8c7b_bundle_js_gz_end");
const char * resource_lookups[] = {
"/css/index.1ab179394339385e0a02.css.gz",
"/favicon-32x32.png",
"/index.html.gz",
"/js/index.b02584.bundle.js.gz",
"/js/node_vendors.b02584.bundle.js.gz",
"/js/index.1b8c7b.bundle.js.gz",
"/js/node_vendors.1b8c7b.bundle.js.gz",
""
};
const uint8_t * resource_map_start[] = {
_index_1ab179394339385e0a02_css_gz_start,
_favicon_32x32_png_start,
_index_html_gz_start,
_index_b02584_bundle_js_gz_start,
_node_vendors_b02584_bundle_js_gz_start
_index_1b8c7b_bundle_js_gz_start,
_node_vendors_1b8c7b_bundle_js_gz_start
};
const uint8_t * resource_map_end[] = {
_index_1ab179394339385e0a02_css_gz_end,
_favicon_32x32_png_end,
_index_html_gz_end,
_index_b02584_bundle_js_gz_end,
_node_vendors_b02584_bundle_js_gz_end
_index_1b8c7b_bundle_js_gz_end,
_node_vendors_1b8c7b_bundle_js_gz_end
};
2 changes: 1 addition & 1 deletion components/wifi-manager/webapp/webpack.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************
webpack_headers
dist/css/index.1ab179394339385e0a02.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.b02584.bundle.js.gz,dist/js/node_vendors.b02584.bundle.js.gz
dist/css/index.1ab179394339385e0a02.css.gz,dist/favicon-32x32.png,dist/index.html.gz,dist/js/index.1b8c7b.bundle.js.gz,dist/js/node_vendors.1b8c7b.bundle.js.gz
***********************************/
#pragma once
#include <inttypes.h>
Expand Down
Binary file added server_certs/DigiCertGlobalRootCA.crt.59
Binary file not shown.
Binary file added server_certs/r2m01.cer.31
Binary file not shown.

0 comments on commit 4933033

Please sign in to comment.