Add MQTT publish request and response models, and implement publish route

- Introduced MQTTPublishRequest and MQTTPublishResponse models for handling MQTT message publishing.
- Implemented a new POST route for publishing MQTT messages, including error handling and logging.
- Enhanced the StandaloneAutoRecorder with improved logging during manual recording start.
- Updated the frontend to include an MQTT Debug Panel for better monitoring and debugging capabilities.
This commit is contained in:
salirezav
2025-12-01 13:07:36 -05:00
parent 5070d9b2ca
commit 73849b40a8
11 changed files with 950 additions and 19 deletions

View File

@@ -239,6 +239,13 @@ class VisionApiClient {
return this.request(`/mqtt/events?limit=${limit}`)
}
async publishMqttMessage(topic: string, payload: string, qos: number = 0, retain: boolean = false): Promise<{ success: boolean; message: string; topic: string; payload: string }> {
return this.request('/mqtt/publish', {
method: 'POST',
body: JSON.stringify({ topic, payload, qos, retain }),
})
}
async startRecording(cameraName: string, filename?: string): Promise<StartRecordingResponse> {
return this.request(`/cameras/${cameraName}/start-recording`, {
method: 'POST',