This commit is contained in:
Mateusz Gruszczyński committed 2026-10-08 22:22:46 +02:00
1 parent 76cb4acef0
commit 68678e98be
84 files changed
+1519 -325

No files matched your search

+7 -1
View File
@@ -2,10 +2,16 @@
use crate::{auth::Session, runtime::ApiError};
use axum::{extract::rejection::JsonRejection, response::Html, Extension};
use http::StatusCode;
use std::sync::OnceLock;
static ADMIN_INDEX: OnceLock<String> = OnceLock::new();
pub(super) async fn index(session: Option<Extension<Session>>) -> Html<&'static str> {
if session.is_some() {
Html(include_str!("web/index.html"))
Html(ADMIN_INDEX.get_or_init(|| {
include_str!("web/index.html")
.replace("__RUSTPROXY_VERSION__", env!("CARGO_PKG_VERSION"))
}).as_str())
} else {
Html(include_str!("web/login.html"))
}