diff --git a/pgml-dashboard/Cargo.lock b/pgml-dashboard/Cargo.lock index 0acfe1334..457fd46b1 100644 --- a/pgml-dashboard/Cargo.lock +++ b/pgml-dashboard/Cargo.lock @@ -1903,6 +1903,43 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "korvus" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d70457bd5491bf05dfea5aca6b6e33358a988f0e459ee2ad06ae885557f9f542" +dependencies = [ + "anyhow", + "async-trait", + "chrono", + "clap", + "colored", + "ctrlc", + "futures", + "indicatif", + "inquire", + "is-terminal", + "itertools", + "lopdf", + "md5", + "once_cell", + "parking_lot", + "regex", + "reqwest", + "sea-query", + "sea-query-binder", + "serde", + "serde_json", + "serde_with", + "sqlx", + "tokio", + "tracing", + "tracing-subscriber", + "url", + "uuid", + "walkdir", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2533,41 +2570,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pgml" -version = "1.1.1" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "clap", - "colored", - "ctrlc", - "futures", - "indicatif", - "inquire", - "is-terminal", - "itertools", - "lopdf", - "md5", - "once_cell", - "parking_lot", - "regex", - "reqwest", - "sea-query", - "sea-query-binder", - "serde", - "serde_json", - "serde_with", - "sqlx", - "tokio", - "tracing", - "tracing-subscriber", - "url", - "uuid", - "walkdir", -] - [[package]] name = "pgml-components" version = "0.1.0" @@ -2592,13 +2594,13 @@ dependencies = [ "futures", "glob", "itertools", + "korvus", "lazy_static", "log", "markdown", "num-traits", "once_cell", "parking_lot", - "pgml", "pgml-components", "pgvector", "rand", diff --git a/pgml-dashboard/src/components/breadcrumbs/breadcrumbs.scss b/pgml-dashboard/src/components/breadcrumbs/breadcrumbs.scss index 048a6f8b1..e35c8ffaa 100644 --- a/pgml-dashboard/src/components/breadcrumbs/breadcrumbs.scss +++ b/pgml-dashboard/src/components/breadcrumbs/breadcrumbs.scss @@ -28,9 +28,16 @@ } } - .vr { - opacity: 1; - color: #{$gray-600}; - width: 2px; + > *:not(:last-child) { + &::after { + content: '/'; + margin: 0 2px; + color: #{$gray-600}; + } + } + + li { + display: flex; + align-items: center; } } diff --git a/pgml-dashboard/src/components/breadcrumbs/mod.rs b/pgml-dashboard/src/components/breadcrumbs/mod.rs index 8f026b046..3c9977576 100644 --- a/pgml-dashboard/src/components/breadcrumbs/mod.rs +++ b/pgml-dashboard/src/components/breadcrumbs/mod.rs @@ -1,16 +1,24 @@ +use crate::components::dropdown::{Dropdown, DropdownItems}; use crate::components::NavLink; +use crate::components::StaticNavLink; use pgml_components::component; use sailfish::TemplateOnce; -#[derive(TemplateOnce)] +#[derive(TemplateOnce, Clone, Default)] #[template(path = "breadcrumbs/template.html")] pub struct Breadcrumbs<'a> { - pub links: Vec>, + pub organizations: Vec, + pub databases: Vec, + pub path: Vec>, } impl<'a> Breadcrumbs<'a> { - pub fn render(links: Vec>) -> String { - Breadcrumbs { links }.render_once().unwrap() + pub fn new(path: Vec>, organizations: Vec, databases: Vec) -> Self { + Breadcrumbs { + path, + databases, + organizations, + } } } diff --git a/pgml-dashboard/src/components/breadcrumbs/template.html b/pgml-dashboard/src/components/breadcrumbs/template.html index d4c3c1515..58b770857 100644 --- a/pgml-dashboard/src/components/breadcrumbs/template.html +++ b/pgml-dashboard/src/components/breadcrumbs/template.html @@ -1,29 +1,25 @@ <% use crate::utils::config; use crate::utils::urls; - - let home_uri = if config::standalone_dashboard() { - urls::deployment_notebooks() - } else { - "/deployments".to_string() - }; + use crate::components::dropdown::Dropdown; %>