From 3a85b730363a0bbec589883ef36c4933f2678e37 Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:49:07 -0600 Subject: [PATCH 1/2] fix web app content area width, ellipses, fix formatting, fix left nav over top nav on scroll --- pgml-dashboard/src/api/chatbot.rs | 15 +++- pgml-dashboard/src/components/chatbot/mod.rs | 75 ++++++++++--------- pgml-dashboard/src/components/star/mod.rs | 2 +- .../static/css/scss/abstracts/variables.scss | 3 + .../static/css/scss/components/_navs.scss | 2 +- .../static/css/scss/layout/_containers.scss | 6 ++ .../templates/layout/web_app_base.html | 8 +- 7 files changed, 66 insertions(+), 45 deletions(-) diff --git a/pgml-dashboard/src/api/chatbot.rs b/pgml-dashboard/src/api/chatbot.rs index 4eaf8b5fd..a608edaaa 100644 --- a/pgml-dashboard/src/api/chatbot.rs +++ b/pgml-dashboard/src/api/chatbot.rs @@ -121,7 +121,13 @@ struct Document { } impl Document { - fn new(text: String, role: ChatRole, user_id: String, model: ChatbotBrain, knowledge_base: KnowledgeBase) -> Document { + fn new( + text: String, + role: ChatRole, + user_id: String, + model: ChatbotBrain, + knowledge_base: KnowledgeBase, + ) -> Document { let id = rand::thread_rng() .sample_iter(&Alphanumeric) .take(32) @@ -225,7 +231,7 @@ pub async fn wrapped_chatbot_get_answer( ChatRole::User, user.chatbot_session_id.clone(), brain, - knowledge_base + knowledge_base, ); let collection = knowledge_base.collection(); @@ -317,7 +323,7 @@ pub async fn wrapped_chatbot_get_answer( ChatRole::Bot, user.chatbot_session_id.clone(), brain, - knowledge_base + knowledge_base, )) .unwrap() .into(), @@ -327,7 +333,8 @@ pub async fn wrapped_chatbot_get_answer( tokio::spawn(async move { history_collection .upsert_documents(new_history_messages, None) - .await.expect("Failed to upsert user history"); + .await + .expect("Failed to upsert user history"); }); Ok(answer) diff --git a/pgml-dashboard/src/components/chatbot/mod.rs b/pgml-dashboard/src/components/chatbot/mod.rs index 9e7ea0b73..c0ad3ae25 100644 --- a/pgml-dashboard/src/components/chatbot/mod.rs +++ b/pgml-dashboard/src/components/chatbot/mod.rs @@ -10,30 +10,42 @@ use sailfish::TemplateOnce; type ExampleQuestions = [(&'static str, [(&'static str, &'static str); 4]); 4]; const EXAMPLE_QUESTIONS: ExampleQuestions = [ - ("PostgresML", [ - ("PostgresML", "sample question continued"), - ("PostgresML", "sample question continued"), - ("PostgresML", "sample question continued"), - ("PostgresML", "sample question continued"), - ]), - ("PyTorch", [ - ("PyTorch", "sample question continued"), - ("PyTorch", "sample question continued"), - ("PyTorch", "sample question continued"), - ("PyTorch", "sample question continued"), - ]), - ("Rust", [ - ("Rust", "sample question continued"), - ("Rust", "sample question continued"), - ("Rust", "sample question continued"), - ("Rust", "sample question continued"), - ]), - ("PostgreSQL", [ - ("PostgreSQL", "sample question continued"), - ("PostgreSQL", "sample question continued"), - ("PostgreSQL", "sample question continued"), - ("PostgreSQL", "sample question continued"), - ]), + ( + "PostgresML", + [ + ("PostgresML", "sample question continued"), + ("PostgresML", "sample question continued"), + ("PostgresML", "sample question continued"), + ("PostgresML", "sample question continued"), + ], + ), + ( + "PyTorch", + [ + ("PyTorch", "sample question continued"), + ("PyTorch", "sample question continued"), + ("PyTorch", "sample question continued"), + ("PyTorch", "sample question continued"), + ], + ), + ( + "Rust", + [ + ("Rust", "sample question continued"), + ("Rust", "sample question continued"), + ("Rust", "sample question continued"), + ("Rust", "sample question continued"), + ], + ), + ( + "PostgreSQL", + [ + ("PostgreSQL", "sample question continued"), + ("PostgreSQL", "sample question continued"), + ("PostgreSQL", "sample question continued"), + ("PostgreSQL", "sample question continued"), + ], + ), ]; const KNOWLEDGE_BASES: [&'static str; 0] = [ @@ -44,18 +56,9 @@ const KNOWLEDGE_BASES: [&'static str; 0] = [ ]; const KNOWLEDGE_BASES_WITH_LOGO: [KnowledgeBaseWithLogo; 4] = [ - KnowledgeBaseWithLogo::new( - "PostgresML", - "/dashboard/static/images/owl_gradient.svg", - ), - KnowledgeBaseWithLogo::new( - "PyTorch", - "/dashboard/static/images/logos/pytorch.svg", - ), - KnowledgeBaseWithLogo::new( - "Rust", - "/dashboard/static/images/logos/rust.svg", - ), + KnowledgeBaseWithLogo::new("PostgresML", "/dashboard/static/images/owl_gradient.svg"), + KnowledgeBaseWithLogo::new("PyTorch", "/dashboard/static/images/logos/pytorch.svg"), + KnowledgeBaseWithLogo::new("Rust", "/dashboard/static/images/logos/rust.svg"), KnowledgeBaseWithLogo::new( "PostgreSQL", "/dashboard/static/images/logos/postgresql.svg", diff --git a/pgml-dashboard/src/components/star/mod.rs b/pgml-dashboard/src/components/star/mod.rs index 63a5f99bc..31dda9a71 100644 --- a/pgml-dashboard/src/components/star/mod.rs +++ b/pgml-dashboard/src/components/star/mod.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; -use pgml_components::component; use once_cell::sync::Lazy; +use pgml_components::component; use sailfish::TemplateOnce; #[derive(TemplateOnce, Default)] diff --git a/pgml-dashboard/static/css/scss/abstracts/variables.scss b/pgml-dashboard/static/css/scss/abstracts/variables.scss index f2cb64d45..8d52a6788 100644 --- a/pgml-dashboard/static/css/scss/abstracts/variables.scss +++ b/pgml-dashboard/static/css/scss/abstracts/variables.scss @@ -209,6 +209,9 @@ $nav-pills-border-radius: calc(#{$border-radius} / 2); $left-nav-w: 17rem; $left-nav-w-collapsed: 88px; +// WebApp Content Container +$webapp-content-max-width: 1224px; + //Grid $enable-cssgrid: true; $enable-shadows: true; diff --git a/pgml-dashboard/static/css/scss/components/_navs.scss b/pgml-dashboard/static/css/scss/components/_navs.scss index 5f8b703d5..ca7c78394 100644 --- a/pgml-dashboard/static/css/scss/components/_navs.scss +++ b/pgml-dashboard/static/css/scss/components/_navs.scss @@ -9,7 +9,7 @@ height: $navbar-height; position: fixed; top: 0px; - z-index: $zindex-fixed; + z-index: calc($zindex-fixed + 1); } .navbar { diff --git a/pgml-dashboard/static/css/scss/layout/_containers.scss b/pgml-dashboard/static/css/scss/layout/_containers.scss index 160dd5727..15c5d998d 100644 --- a/pgml-dashboard/static/css/scss/layout/_containers.scss +++ b/pgml-dashboard/static/css/scss/layout/_containers.scss @@ -145,3 +145,9 @@ width: $left-nav-w; } } + +.webapp-content-max-width-container { + max-width: $webapp-content-max-width; + margin-left: 0px; + min-height: calc(100vh - $navbar-height - 1px); + } diff --git a/pgml-dashboard/templates/layout/web_app_base.html b/pgml-dashboard/templates/layout/web_app_base.html index 62cdb94a5..31113c8e4 100644 --- a/pgml-dashboard/templates/layout/web_app_base.html +++ b/pgml-dashboard/templates/layout/web_app_base.html @@ -32,12 +32,14 @@
-
+
<%- Breadcrumbs::render( breadcrumbs ) %>
-
- <%- content.unwrap_or_default() %> +
+
+ <%- content.unwrap_or_default() %> +
From c506103a39bc78ade66785c696894299a0f156e6 Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:55:53 -0600 Subject: [PATCH 2/2] allow glow to fall under breadcrumb --- pgml-dashboard/static/css/scss/abstracts/variables.scss | 1 + pgml-dashboard/static/css/scss/layout/_containers.scss | 2 +- .../templates/content/dashboard/panels/notebooks.html | 8 ++++---- pgml-dashboard/templates/layout/web_app_base.html | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pgml-dashboard/static/css/scss/abstracts/variables.scss b/pgml-dashboard/static/css/scss/abstracts/variables.scss index 8d52a6788..38f245472 100644 --- a/pgml-dashboard/static/css/scss/abstracts/variables.scss +++ b/pgml-dashboard/static/css/scss/abstracts/variables.scss @@ -243,6 +243,7 @@ $breadcrumb-padding-x: 4px; $breadcrumb-item-padding-x: 4px; $breadcrumb-margin-bottom: 0px; $breadcrumb-divider: quote(""); +$breadcrumb-height: 57px; // animations $animation-timer: 0.35s; diff --git a/pgml-dashboard/static/css/scss/layout/_containers.scss b/pgml-dashboard/static/css/scss/layout/_containers.scss index 15c5d998d..f0ac22b21 100644 --- a/pgml-dashboard/static/css/scss/layout/_containers.scss +++ b/pgml-dashboard/static/css/scss/layout/_containers.scss @@ -149,5 +149,5 @@ .webapp-content-max-width-container { max-width: $webapp-content-max-width; margin-left: 0px; - min-height: calc(100vh - $navbar-height - 1px); + min-height: calc(100vh - $navbar-height - $breadcrumb-height - 1px); } diff --git a/pgml-dashboard/templates/content/dashboard/panels/notebooks.html b/pgml-dashboard/templates/content/dashboard/panels/notebooks.html index c08971b33..6f36430e4 100644 --- a/pgml-dashboard/templates/content/dashboard/panels/notebooks.html +++ b/pgml-dashboard/templates/content/dashboard/panels/notebooks.html @@ -1,18 +1,18 @@ -
+
<% if !notebooks.is_empty() { %> -
+
<% for notebook in notebooks { %>
diff --git a/pgml-dashboard/templates/layout/web_app_base.html b/pgml-dashboard/templates/layout/web_app_base.html index 31113c8e4..60da7ee17 100644 --- a/pgml-dashboard/templates/layout/web_app_base.html +++ b/pgml-dashboard/templates/layout/web_app_base.html @@ -36,8 +36,8 @@ <%- Breadcrumbs::render( breadcrumbs ) %>
-
-
+
+
<%- content.unwrap_or_default() %>
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy