Add broker management and writer transfer UI
This commit is contained in:
+15
-1
@@ -27,6 +27,7 @@
|
||||
#include "web_account_settings.h"
|
||||
#include "web_network_settings.h"
|
||||
#include "web_display_settings.h"
|
||||
#include "web_broker_settings.h"
|
||||
#include "web_admin_transport.h"
|
||||
#include "web_session_store.h"
|
||||
#include "web_cookie_auth.h"
|
||||
@@ -414,6 +415,15 @@ static const httpd_uri_t s_account_generate_password_uri = {
|
||||
static const httpd_uri_t s_network_uri = {
|
||||
.uri = "/api/settings/network", .method = HTTP_GET, .handler = web_network_snapshot_handler,
|
||||
};
|
||||
static const httpd_uri_t s_broker_uri = {
|
||||
.uri = "/api/settings/broker", .method = HTTP_GET, .handler = web_broker_settings_handler,
|
||||
};
|
||||
static const httpd_uri_t s_broker_operation_get_uri = {
|
||||
.uri = "/api/settings/broker-operation", .method = HTTP_GET, .handler = web_broker_operation_handler,
|
||||
};
|
||||
static const httpd_uri_t s_broker_operation_post_uri = {
|
||||
.uri = "/api/settings/broker-operation", .method = HTTP_POST, .handler = web_broker_operation_handler,
|
||||
};
|
||||
static const httpd_uri_t s_display_uri = {
|
||||
.uri = "/api/settings/display", .method = HTTP_GET, .handler = web_display_settings_handler,
|
||||
};
|
||||
@@ -645,7 +655,7 @@ esp_err_t web_server_start(void)
|
||||
config.httpd.max_open_sockets = 6;
|
||||
config.httpd.max_uri_handlers =
|
||||
sizeof(s_uri_handlers) / sizeof(s_uri_handlers[0]) +
|
||||
sizeof(s_auth_uris) / sizeof(s_auth_uris[0]) + 16U;
|
||||
sizeof(s_auth_uris) / sizeof(s_auth_uris[0]) + 19U;
|
||||
/* Exhaustion rejects new sockets, never evicts an existing serial writer. */
|
||||
config.httpd.lru_purge_enable = false;
|
||||
config.httpd.recv_wait_timeout = 1;
|
||||
@@ -713,6 +723,10 @@ esp_err_t web_server_start(void)
|
||||
web_httpd_register_optional_get(server, &s_display_operation_get_uri) == ESP_OK &&
|
||||
web_httpd_register_optional(server, &s_display_operation_post_uri) != ESP_OK)
|
||||
(void)httpd_unregister_uri_handler(server, s_display_operation_get_uri.uri, HTTP_GET);
|
||||
if (web_httpd_register_optional_get(server, &s_broker_uri) == ESP_OK &&
|
||||
web_httpd_register_optional_get(server, &s_broker_operation_get_uri) == ESP_OK &&
|
||||
web_httpd_register_optional(server, &s_broker_operation_post_uri) != ESP_OK)
|
||||
(void)httpd_unregister_uri_handler(server, s_broker_operation_get_uri.uri, HTTP_GET);
|
||||
}
|
||||
if (error != ESP_OK) {
|
||||
web_cookie_auth_stop();
|
||||
|
||||
Reference in New Issue
Block a user