Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/settings_manager/settings_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,13 @@ esp_err_t settings_get_json(char *json_out, size_t max_len) {
cJSON_AddBoolToObject(root, "eq_available", false);
#endif

// Add web OTA availability flag
#if CONFIG_SNAPCLIENT_WEB_OTA
cJSON_AddBoolToObject(root, "web_ota_enabled", true);
#else
cJSON_AddBoolToObject(root, "web_ota_enabled", false);
#endif

// Render to string
char *json_str = cJSON_PrintUnformatted(root);
cJSON_Delete(root);
Expand Down
4 changes: 3 additions & 1 deletion components/ui_http_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
idf_component_register(SRCS "ui_http_server.c"
"ota_handlers.c"
INCLUDE_DIRS "include"
REQUIRES esp_http_server settings_manager dsp_processor_settings tas5805m_settings
REQUIRES esp_http_server settings_manager dsp_processor_settings tas5805m_settings app_update
PRIV_REQUIRES custom_board
EMBED_TXTFILES html/index.html
html/index.js
Expand All @@ -10,4 +11,5 @@ idf_component_register(SRCS "ui_http_server.c"
html/dsp-settings.html
html/dac-settings.html
html/eq-settings.html
html/ota-update.html
EMBED_FILES html/favicon.ico)
9 changes: 9 additions & 0 deletions components/ui_http_server/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ <h1>ESP32 Snapclient</h1>
<li id="dsp-tab" style="display: none;"><a href="#" class="nav-link" data-page="dsp-settings.html">DSP Settings</a></li>
<li id="dac-tab" style="display: none;"><a href="#" class="nav-link" data-page="dac-settings.html">DAC Settings</a></li>
<li id="eq-tab" style="display: none;"><a href="#" class="nav-link" data-page="eq-settings.html">EQ</a></li>
<li id="ota-tab" style="display: none;"><a href="#" class="nav-link" data-page="ota-update.html">OTA Update</a></li>
</ul>
</nav>

Expand Down Expand Up @@ -135,6 +136,14 @@ <h1>ESP32 Snapclient</h1>
eqTab.style.display = 'block';
}
}

// Show OTA tab if web_ota_enabled is true
if (capabilities.web_ota_enabled === true) {
const otaTab = document.getElementById('ota-tab');
if (otaTab) {
otaTab.style.display = 'block';
}
}
} catch (error) {
console.error('Error checking DSP availability:', error);
// DSP and DAC tabs remain hidden on error
Expand Down
Loading