graphs website added

This commit is contained in:
Priec
2026-07-16 01:26:00 +02:00
parent 52d1064071
commit 9825616a78
6 changed files with 67 additions and 769 deletions

View File

@@ -99,8 +99,21 @@ struct ColumnOutput {
data_type: String,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// Starts the analytics web UI as a detached task on the current Tokio runtime.
///
/// The web UI still uses the existing gRPC endpoints for now. Keeping startup
/// here limits the server integration to a single call until the application
/// is switched to the in-process analytics runtime.
pub fn spawn() -> tokio::task::JoinHandle<()> {
tokio::spawn(async {
if let Err(error) = serve().await {
eprintln!("Analytics graphs stopped: {error}");
}
})
}
/// Serves the analytics web UI until the task is cancelled or the listener fails.
pub async fn serve() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let grpc_endpoint =
env::var("ANALYTICS_GRPC_ENDPOINT").unwrap_or_else(|_| "http://[::1]:50051".into());
let listen_address = env::var("LISTEN_ADDRESS")