![google-labs-jules[bot]](/assets/img/avatar_default.png)
This commit introduces a full-stack Dioxus application with a web frontend to manage TTRPG data from a SQLite database. The application is built using a Server-Side Rendering (SSR) architecture with Axum for the web server and Dioxus for templating. This approach was chosen for its simplicity and robustness, avoiding client-side build complexities. Features include: - A web server powered by Axum. - Server-side rendered pages for Home, Creatures, Edit Creature, Import, and Changelog. - Database integration with `sqlx` to view a list of creatures and details for a single creature. - A modular structure with components, pages, and database logic separated into modules. - A navigation bar for easy access to all pages. - Placeholder pages for data import and editing functionality.
27 lines
731 B
Rust
27 lines
731 B
Rust
use dioxus::prelude::*;
|
|
|
|
#[component]
|
|
pub fn ImportPage() -> Element {
|
|
rsx! {
|
|
div {
|
|
h2 { "Import Data" }
|
|
p { "This page will be used to import data from files." }
|
|
form {
|
|
prevent_default: "onsubmit",
|
|
onsubmit: move |_| {
|
|
// Placeholder for form submission logic
|
|
log::info!("Form submitted for file import.");
|
|
},
|
|
input {
|
|
r#type: "file",
|
|
accept: ".json,.csv", // Example file types
|
|
}
|
|
button {
|
|
r#type: "submit",
|
|
"Import"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|