Transfer Panel Details Without an Extra Layer of JSON Encoding (#14)

**Rationale:**

This made it harder to snoop on the traffic in the network monitor because it was encoded as a string.

**Changes:**

- Backend now accepts & provides the panel data as a JSON object rather than as a string
- Backend now supports compression
- Minor improvements to error handling
- Some panel structures were getting saved in the JSON when they weren't supposed to be (now this no longer happens)

Reviewed-on: #14
Co-authored-by: Sergey Savelyev <sergeysav.nn@gmail.com>
Co-committed-by: Sergey Savelyev <sergeysav.nn@gmail.com>
This commit was merged in pull request #14.
This commit is contained in:
2026-01-03 18:24:40 -08:00
committed by sergeysav
parent 167e9d0a01
commit 44862f65d2
15 changed files with 149 additions and 43 deletions

View File

@@ -9,7 +9,7 @@ use crate::http::backend::setup_backend;
use crate::http::websocket::setup_websocket;
use crate::panels::PanelService;
use crate::telemetry::management_service::TelemetryManagementService;
use actix_web::middleware::Logger;
use actix_web::middleware::{Compress, Logger};
use actix_web::{web, App, HttpServer};
use log::info;
use std::sync::Arc;
@@ -36,6 +36,7 @@ pub async fn setup(
.service(web::scope("/backend").configure(setup_backend))
.service(web::scope("/ws").configure(setup_websocket))
.service(web::scope("/api").configure(setup_api))
.wrap(Compress::default())
.wrap(Logger::default())
})
.bind("localhost:8080")?