mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
refactor: Update UI components for consistency and improve layout
This commit is contained in:
parent
da619171cf
commit
77be7f10d9
74 changed files with 3186 additions and 618 deletions
|
|
@ -6,6 +6,10 @@ static INDEX_HTML: &str = include_str!("assets/dist/index.html");
|
|||
static STYLE_CSS: &str = include_str!("assets/dist/style.css");
|
||||
static APP_JS: &str = include_str!("assets/dist/app.js");
|
||||
static FAVICON_SVG: &str = include_str!("assets/favicon.svg");
|
||||
static FAVICON_32: &[u8] = include_bytes!("assets/favicon-32.png");
|
||||
static FAVICON_64: &[u8] = include_bytes!("assets/favicon-64.png");
|
||||
static FAVICON_180: &[u8] = include_bytes!("assets/favicon-180.png");
|
||||
static LOGO_PNG: &[u8] = include_bytes!("assets/logo.png");
|
||||
|
||||
/// Serve embedded static files or fall back to the SPA shell.
|
||||
pub async fn static_handler(req: Request) -> Response {
|
||||
|
|
@ -33,6 +37,30 @@ pub async fn static_handler(req: Request) -> Response {
|
|||
FAVICON_SVG,
|
||||
)
|
||||
.into_response(),
|
||||
"/favicon-32.png" => (
|
||||
StatusCode::OK,
|
||||
[(header::CONTENT_TYPE, "image/png")],
|
||||
FAVICON_32,
|
||||
)
|
||||
.into_response(),
|
||||
"/favicon-64.png" => (
|
||||
StatusCode::OK,
|
||||
[(header::CONTENT_TYPE, "image/png")],
|
||||
FAVICON_64,
|
||||
)
|
||||
.into_response(),
|
||||
"/favicon-180.png" => (
|
||||
StatusCode::OK,
|
||||
[(header::CONTENT_TYPE, "image/png")],
|
||||
FAVICON_180,
|
||||
)
|
||||
.into_response(),
|
||||
"/logo.png" => (
|
||||
StatusCode::OK,
|
||||
[(header::CONTENT_TYPE, "image/png")],
|
||||
LOGO_PNG,
|
||||
)
|
||||
.into_response(),
|
||||
// SPA fallback: any non-API path serves index.html.
|
||||
_ => Html(INDEX_HTML).into_response(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue