diff --git a/src/NetSpeaker/webserver.ino b/src/NetSpeaker/webserver.ino index 61ecf8d..6c0413a 100755 --- a/src/NetSpeaker/webserver.ino +++ b/src/NetSpeaker/webserver.ino @@ -50,9 +50,174 @@ void api_root() { html += "Web UI | " + version + ""; html += ""; html += ""; + html += "
"; - html += "


Web Interface of your

NetSpeaker




Work in progress!

"; + html += "

Welcome to

"; + html += "

" + configuration.getString(PREFERENCES_KEY_FRIENDLY_NAME, "NetSpeaker") + "

"; + html += "" + version + ""; + html += "
"; + + // informations accordion + html += "
"; + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + + // api functions accordion + html += "
"; + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; + html += "

"; + html += " "; + html += "

"; + html += "
"; + html += "
"; + html += " Work in progress"; + html += "
"; + html += "
"; + html += "
"; + + html += "
"; html += ""; html += ""; @@ -441,7 +606,7 @@ void api_v1_system_friendlyname_change() { api_server.send(200, "application/json", generate_api_json(false, content)); // return with no success ("false") return; } - + configuration.putString(PREFERENCES_KEY_FRIENDLY_NAME, newFriendlyName); Serial.printf("[INFO] Changed friendly name from \"%s\" to \"%s\".\n", currentFriendlyName.c_str(), newFriendlyName.c_str()); @@ -455,7 +620,7 @@ void api_v1_system_restore_state() { Serial.printf("[HTTP] [API] 200 - GET '/api/v1/system/restore_state/%s'\n", option); if (option == "get") { - // just here that calling .../get wont respond 404 + // just here that calling .../get wont respond 404 } else if (option == "on") { configuration.putBool(PREFERENCES_KEY_RESTORE_OLD_STATE, true); } else if (option == "off") { @@ -475,7 +640,7 @@ void api_v1_system_restore_playing() { Serial.printf("[HTTP] [API] 200 - GET '/api/v1/system/restore_playing/%s'\n", option); if (option == "get") { - // just here that calling .../get wont respond 404 + // just here that calling .../get wont respond 404 } else if (option == "on") { configuration.putBool(PREFERENCES_KEY_RESTORE_PLAYING, true); } else if (option == "off") { @@ -542,31 +707,31 @@ void setupWeb() { Serial.println("[HTTP] [API] 404: Not Found"); api_server.send(404, "application/json", "{\"code\": 404, \"message\": \"Resource not found.\"}"); }); - api_server.on("/api/v1/playback/toggle", api_v1_playback_toggle); - api_server.on("/api/v1/playback/play", api_v1_playback_play); - api_server.on("/api/v1/playback/pause", api_v1_playback_pause); - api_server.on("/api/v1/playback/next", api_v1_playback_next); - api_server.on("/api/v1/playback/previous", api_v1_playback_previous); - api_server.on("/api/v1/playback/info", api_v1_playback_info); - api_server.on(UriBraces("/api/v1/playback/{}"), api_v1_playback_byindex); - api_server.on("/api/v1/playlist/get", api_v1_playlist_get); - api_server.on("/api/v1/playlist/create", api_v1_playlist_create); - api_server.on("/api/v1/playlist/play", api_v1_playlist_play); - api_server.on(UriBraces("/api/v1/volume/{}"), api_v1_volume); - api_server.on(UriBraces("/api/v1/balance/{}"), api_v1_balance); - api_server.on("/api/v1/eq/get", api_v1_eq_get); - api_server.on(UriBraces("/api/v1/eq/reset"), api_v1_eq_reset); - api_server.on(UriBraces("/api/v1/eq/low/{}"), api_v1_eq_low); - api_server.on(UriBraces("/api/v1/eq/mid/{}"), api_v1_eq_mid); - api_server.on(UriBraces("/api/v1/eq/high/{}"), api_v1_eq_high); - api_server.on("/api/v1/system/restart", api_v1_system_restart); - api_server.on("/api/v1/system/name", api_v1_system_friendlyname_get); - api_server.on("/api/v1/system/name/change", api_v1_system_friendlyname_change); - api_server.on(UriBraces("/api/v1/system/restore_state/{}"), api_v1_system_restore_state); + api_server.on("/api/v1/playback/toggle", api_v1_playback_toggle); + api_server.on("/api/v1/playback/play", api_v1_playback_play); + api_server.on("/api/v1/playback/pause", api_v1_playback_pause); + api_server.on("/api/v1/playback/next", api_v1_playback_next); + api_server.on("/api/v1/playback/previous", api_v1_playback_previous); + api_server.on("/api/v1/playback/info", api_v1_playback_info); + api_server.on(UriBraces("/api/v1/playback/{}"), api_v1_playback_byindex); + api_server.on("/api/v1/playlist/get", api_v1_playlist_get); + api_server.on("/api/v1/playlist/create", api_v1_playlist_create); + api_server.on("/api/v1/playlist/play", api_v1_playlist_play); + api_server.on(UriBraces("/api/v1/volume/{}"), api_v1_volume); + api_server.on(UriBraces("/api/v1/balance/{}"), api_v1_balance); + api_server.on("/api/v1/eq/get", api_v1_eq_get); + api_server.on(UriBraces("/api/v1/eq/reset"), api_v1_eq_reset); + api_server.on(UriBraces("/api/v1/eq/low/{}"), api_v1_eq_low); + api_server.on(UriBraces("/api/v1/eq/mid/{}"), api_v1_eq_mid); + api_server.on(UriBraces("/api/v1/eq/high/{}"), api_v1_eq_high); + api_server.on("/api/v1/system/restart", api_v1_system_restart); + api_server.on("/api/v1/system/name", api_v1_system_friendlyname_get); + api_server.on("/api/v1/system/name/change", api_v1_system_friendlyname_change); + api_server.on(UriBraces("/api/v1/system/restore_state/{}"), api_v1_system_restore_state); api_server.on(UriBraces("/api/v1/system/restore_playing/{}"), api_v1_system_restore_playing); - api_server.on("/api/v1/system/version", api_v1_system_version); - api_server.on("/api/v1/system/wifi/change", api_v1_system_wifi_change); - api_server.on("/api/v1/system/wifi/get_ssid", api_v1_system_wifi_getssid); + api_server.on("/api/v1/system/version", api_v1_system_version); + api_server.on("/api/v1/system/wifi/change", api_v1_system_wifi_change); + api_server.on("/api/v1/system/wifi/get_ssid", api_v1_system_wifi_getssid); Serial.println("[HTTP] [API] Starting API server (http) on port " + String(webport_api)); api_server.begin();