fix background color, start scheduled task tests
All checks were successful
build docker container automatically / build (push) Successful in 3m39s
All checks were successful
build docker container automatically / build (push) Successful in 3m39s
This commit is contained in:
18
src/main.rs
18
src/main.rs
@ -6,6 +6,9 @@ use tracing::Level;
|
||||
|
||||
pub mod config;
|
||||
|
||||
use async_std::task;
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::components::toast::ToastProvider;
|
||||
|
||||
use crate::views::{
|
||||
@ -39,16 +42,28 @@ enum Route {
|
||||
|
||||
|
||||
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
||||
const STYLE_CSS: Asset = asset!("/assets/style.css");
|
||||
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
|
||||
|
||||
|
||||
fn main() {
|
||||
#[cfg(feature = "server")]
|
||||
let _ = ServerConfig::load();
|
||||
|
||||
#[cfg(feature = "server")]
|
||||
task::spawn(scheduled_tasks());
|
||||
|
||||
dioxus::logger::init(Level::INFO).expect("failed to init logger");
|
||||
dioxus::launch(App);
|
||||
}
|
||||
|
||||
async fn scheduled_tasks() {
|
||||
loop {
|
||||
task::sleep(Duration::from_secs(1)).await;
|
||||
// tracing::info!("patate douce");
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn ErrorLayout() -> Element {
|
||||
rsx! {
|
||||
@ -69,9 +84,10 @@ fn ErrorLayout() -> Element {
|
||||
fn App() -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "icon", href: FAVICON }
|
||||
document::Link { rel: "stylesheet", href: STYLE_CSS }
|
||||
document::Link { rel: "stylesheet", href: TAILWIND_CSS }
|
||||
div {
|
||||
class: "h-screen w-screen bg-zinc-900 text-white",
|
||||
class: "h-full w-full text-white",
|
||||
ToastProvider {
|
||||
Router::<Route> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user