-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7032f41
commit d865dcf
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ | |
packages = with pkgs; [ | ||
just | ||
nixci | ||
pkg-config | ||
# For when we start using Tauri | ||
cargo-tauri | ||
trunk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,49 @@ | |
use dioxus::prelude::*; | ||
use nix_health::traits::{Check, CheckResult}; | ||
|
||
use dioxus_markdown::Markdown; | ||
use crate::{app::state::AppState, app::widget::Loader}; | ||
|
||
pub fn renderMarkDown<'a>(cx: Scope<'a>, string: &'a str) -> Element<'a> { | ||
cx.render(rsx! { | ||
link { | ||
rel: "stylesheet", | ||
href: "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css", | ||
} | ||
div { | ||
Markdown { | ||
class: "content", | ||
content: string, | ||
} | ||
} | ||
}) | ||
} | ||
|
||
/// Nix health checks | ||
pub fn Health(cx: Scope) -> Element { | ||
let state = AppState::use_state(cx); | ||
let health_checks = state.health_checks.read(); | ||
let title = "Nix Health"; | ||
render! { | ||
renderMarkDown(cx, "# Markdown Working") | ||
h1 { class: "text-5xl font-bold", title } | ||
if health_checks.is_loading_or_refreshing() { | ||
render! { Loader {} } | ||
} | ||
health_checks.render_with(cx, |checks| render! { | ||
div { class: "flex flex-col items-stretch justify-start space-y-8 text-left", | ||
for check in checks { | ||
println!("{:?}", check) | ||
ViewCheck { check: check.clone() } | ||
renderMarkDown(cx, "# hello \n - ok") | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
|
||
|
||
|
||
#[component] | ||
fn ViewCheck(cx: Scope, check: Check) -> Element { | ||
render! { | ||
|