79 lines
2.1 KiB
Rust
79 lines
2.1 KiB
Rust
use std::sync::Arc;
|
|
|
|
use leptos::*;
|
|
use leptos_meta::*;
|
|
use leptos_router::*;
|
|
|
|
pub(crate) mod components;
|
|
pub(crate) mod error_template;
|
|
pub(crate) mod pages;
|
|
|
|
use self::{
|
|
error_template::{AppError, ErrorTemplate},
|
|
pages::*,
|
|
};
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub struct RefreshGen(pub i64);
|
|
|
|
#[component]
|
|
pub fn TestPage() -> impl IntoView {
|
|
view! {
|
|
<div class="dev-body">
|
|
<div class="s3d">
|
|
<div class="flex">
|
|
<div class="flex">
|
|
// <button class="s3d mx-2">
|
|
// <span>+</span>
|
|
// </button>
|
|
</div>
|
|
<div class="flex">
|
|
<a class="s3d mx-2">
|
|
<span>"TEST !"</span>
|
|
</a>
|
|
</div>
|
|
<div class="flex">
|
|
<a class="s3d mx-2">
|
|
<span>-</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
#[island]
|
|
pub fn App() -> impl IntoView {
|
|
let span = tracing::info_span!("app");
|
|
// Provides context that manages stylesheets, titles, meta tags, etc.
|
|
provide_meta_context();
|
|
|
|
let refresh_gen = create_rw_signal(RefreshGen(0));
|
|
provide_context(refresh_gen);
|
|
provide_context(Arc::new(span));
|
|
|
|
view! {
|
|
<Stylesheet id="leptos" href="/pkg/llama_forge_rs.css" />
|
|
|
|
// sets the document title
|
|
<Title text="LLama Forge RS" />
|
|
|
|
<Router fallback=|| {
|
|
let mut outside_errors = Errors::default();
|
|
outside_errors.insert_with_default_key(AppError::NotFound);
|
|
view! { <ErrorTemplate outside_errors /> }.into_view()
|
|
}>
|
|
<main>
|
|
<Routes>
|
|
<Route path="" view=MainPage>
|
|
<Route path="/chat" view=ChatPage />
|
|
<Route path="/test" view=TestPage />
|
|
// TODO make settings page for proxy-man
|
|
// <SettingsRoutes/>
|
|
</Route>
|
|
</Routes>
|
|
</main>
|
|
</Router>
|
|
}
|
|
}
|