This commit is contained in:
2026-08-06 22:38:23 +08:00
parent 14b0b0e3bc
commit 114207f85d
16 changed files with 524 additions and 111 deletions
+2 -2
View File
@@ -12,9 +12,9 @@ Radio_State make_radio_state(Radio_Mode mode, int port, int buffer_count, int lo
return result;
}
}
Server_App::Server_App(int port, std::filesystem::path frontend_dist, std::filesystem::path config_file) : port_(port), frontend_dist_(std::move(frontend_dist)), config_store_(std::move(config_file)), state_resource_("/admin/radio_states", make_radio_states()), service_config_resource_(config_store_.data().radio_service, "/admin/config/radio", [this](const Radio_Service_Config& value) {
Server_App::Server_App(int port, std::filesystem::path frontend_dist, std::filesystem::path config_file) : port_(port), frontend_dist_(std::move(frontend_dist)), config_store_(std::move(config_file)), state_resource_("/admin/radio_states", make_radio_states()), service_config_resource_(config_store_.data().radio_service, "/admin/config/radio", [this](Radio_Service_Config&, Radio_Service_Config value) {
config_store_.persist_radio_service(value);
}, &config_store_.mutex()), alert_config_resource_(config_store_.data().alerts, "/admin/config/alerts", [this](const Alert_Config& value) {
}, &config_store_.mutex()), alert_config_resource_(config_store_.data().alerts, "/admin/config/alerts", [this](Alert_Config&, Alert_Config value) {
config_store_.persist_alerts(value);
}, &config_store_.mutex()), device_tables_(config_store_) {
state_resource_.register_overview_status<Server_Status>("/admin/status", 2000);