From b9c1ac1c070f19295c79ad21a7eddf20ea42a49b Mon Sep 17 00:00:00 2001 From: mia Date: Tue, 23 Apr 2024 18:40:20 -0700 Subject: falx integration --- src/server/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/server/mod.rs') diff --git a/src/server/mod.rs b/src/server/mod.rs index d9b3beb..81dc519 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,11 +1,11 @@ mod admin; mod config; +mod falx; mod login; -mod nginx_check; mod panel; mod store; -use std::{future::IntoFuture, path::PathBuf}; +use std::{future::IntoFuture, path::PathBuf, sync::Arc}; use axum::{ body::Body, @@ -16,6 +16,7 @@ use axum::{ Router, }; use axum_extra::extract::CookieJar; +use cursive::reexports::ahash::HashSet; use eyre::Context; use maud::{html, PreEscaped}; use tap::Pipe; @@ -41,12 +42,13 @@ pub async fn serve() -> eyre::Result<()> { let app = Router::new() .pipe(login::bind) - .pipe(nginx_check::bind) + .pipe(falx::bind) .pipe(panel::bind) .with_state(ApiState { store, cookie_domain: CookieDomain(config.cookie_domain), web_base: WebBase(config.web_base), + handoffs: Handoffs(Arc::new(config.handoffs)), }) .fallback(get(|| async { render_html( @@ -72,6 +74,7 @@ struct ApiState { pub store: Store, pub cookie_domain: CookieDomain, pub web_base: WebBase, + pub handoffs: Handoffs, } #[derive(Clone)] @@ -80,6 +83,9 @@ struct CookieDomain(Option); #[derive(Clone)] struct WebBase(String); +#[derive(Clone)] +struct Handoffs(Arc>); + fn render_html(head: PreEscaped>, body: PreEscaped>) -> Response { let html = html! { (PreEscaped("")) -- cgit 1.4.1