From 204b64a4f95b429a69c2dd242daaa6cae2f6b2c2 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 5 Mar 2026 16:08:31 +0200 Subject: [PATCH] connect masters --- crates/httpd/src/config.rs | 7 ++++--- crates/httpd/src/global.rs | 1 + crates/httpd/src/main.rs | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/httpd/src/config.rs b/crates/httpd/src/config.rs index 5f86518..bef9685 100644 --- a/crates/httpd/src/config.rs +++ b/crates/httpd/src/config.rs @@ -1,12 +1,13 @@ use serde::Deserialize; -use std::net::IpAddr; +use std::net::{IpAddr, SocketAddr}; #[derive(Debug, Deserialize)] pub struct Config { - pub title: String, + pub debug: bool, pub description: Option, pub format_time: String, pub host: IpAddr, + pub masters: Vec, pub port: u16, - pub debug: bool, + pub title: String, } diff --git a/crates/httpd/src/global.rs b/crates/httpd/src/global.rs index 97d432b..0018901 100644 --- a/crates/httpd/src/global.rs +++ b/crates/httpd/src/global.rs @@ -4,4 +4,5 @@ use rocket::serde::Serialize; #[serde(crate = "rocket::serde")] pub struct Global { pub format_time: String, + pub masters: Vec, } diff --git a/crates/httpd/src/main.rs b/crates/httpd/src/main.rs index eced369..e05a8c6 100644 --- a/crates/httpd/src/main.rs +++ b/crates/httpd/src/main.rs @@ -23,8 +23,10 @@ fn index(meta: &State, global: &State) -> Result Ok(Template::render( "index", context! { - title: &meta.title, + masters: &global.masters, servers: servers, + title: &meta.title, + version: &meta.version, }, )) } @@ -48,6 +50,7 @@ fn rocket() -> _ { }) .manage(Global { format_time: config.format_time, + masters: config.masters, }) .manage(Meta { description: config.description,