fix: add missing files
This commit is contained in:
parent
ac27329bda
commit
d7d1778fea
41
src/html/page/not_found.rs
Normal file
41
src/html/page/not_found.rs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
use crate::html::component::header::HeaderHtml;
|
||||||
|
use crate::http_util::not_found_html_err;
|
||||||
|
use crate::model::app_state::AppState;
|
||||||
|
use axum::extract::State;
|
||||||
|
use axum::response::Html;
|
||||||
|
use axum::response::Response;
|
||||||
|
use html_escaper::Escape;
|
||||||
|
// use html_escaper::Trusted;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
// #[axum::debug_handler]
|
||||||
|
pub fn not_found_page(
|
||||||
|
State(state): State<Arc<AppState>>,
|
||||||
|
error_msg: Option<String>,
|
||||||
|
) -> Html<String> {
|
||||||
|
#[derive(boilerplate::Boilerplate)]
|
||||||
|
#[boilerplate(filename = "web/html/page/not_found.html")]
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub struct NotFoundHtmlPage {
|
||||||
|
header: HeaderHtml,
|
||||||
|
error_msg: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
let header = HeaderHtml {
|
||||||
|
site_name: "Neptune Explorer".to_string(),
|
||||||
|
state: state.clone(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let not_found_page = NotFoundHtmlPage {
|
||||||
|
header,
|
||||||
|
error_msg: error_msg.unwrap_or_default(),
|
||||||
|
};
|
||||||
|
Html(not_found_page.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn not_found_html_response(
|
||||||
|
State(state): State<Arc<AppState>>,
|
||||||
|
error_msg: Option<String>,
|
||||||
|
) -> Response {
|
||||||
|
not_found_html_err(not_found_page(State(state), error_msg))
|
||||||
|
}
|
||||||
4
templates/web/css/pico.cyan.min.css
vendored
Normal file
4
templates/web/css/pico.cyan.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
templates/web/css/pico.min.css
vendored
Symbolic link
1
templates/web/css/pico.min.css
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
pico.cyan.min.css
|
||||||
Loading…
x
Reference in New Issue
Block a user