forked from external-repos/esp32cam-rtsp
Added session count in HTML
This commit is contained in:
@@ -111,6 +111,10 @@
|
||||
<div class="col-4">Uptime:</div>
|
||||
<div class="col-8">{{Uptime}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">RTSP sessions:</div>
|
||||
<div class="col-8">{{NumRTSPSessions}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">Free heap:</div>
|
||||
<div class="col-8">{{FreeHeap}}b</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,6 +10,10 @@ rtsp_server::rtsp_server(OV2640 &cam, unsigned long interval, int port /*= 554*/
|
||||
WiFiServer::begin();
|
||||
timer_.every(interval, client_handler, this);
|
||||
}
|
||||
size_t rtsp_server::num_connected()
|
||||
{
|
||||
return clients_.size();
|
||||
}
|
||||
|
||||
void rtsp_server::doLoop()
|
||||
{
|
||||
|
||||
@@ -14,6 +14,8 @@ public:
|
||||
|
||||
void doLoop();
|
||||
|
||||
size_t num_connected();
|
||||
|
||||
private:
|
||||
struct rtsp_client
|
||||
{
|
||||
|
||||
@@ -80,7 +80,8 @@ void handle_root()
|
||||
{"NetworkState.OnLine", String(iotWebConf.getState() == iotwebconf::NetworkState::OnLine)},
|
||||
{"CameraInitialized", String(camera_init_result == ESP_OK)},
|
||||
{"CameraInitResult", "0x" + String(camera_init_result, 16)},
|
||||
{"CameraInitResultText", esp_err_to_name(camera_init_result)}};
|
||||
{"CameraInitResultText", esp_err_to_name(camera_init_result)},
|
||||
{"NumRTSPSessions", camera_server != nullptr ? String(camera_server->num_connected()) : "N/A"}};
|
||||
|
||||
web_server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
auto html = template_render(file_data_index_html, substitutions);
|
||||
|
||||
Reference in New Issue
Block a user