Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dan fix webapp content area#1058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chillenberger merged 2 commits intomasterfromdan-fix-webapp-content-area
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletionspgml-dashboard/src/api/chatbot.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
Expand DownExpand Up@@ -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();
Expand DownExpand Up@@ -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(),
Expand All@@ -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)
Expand Down
75 changes: 39 additions & 36 deletionspgml-dashboard/src/components/chatbot/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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] = [
Expand All@@ -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",
Expand Down
2 changes: 1 addition & 1 deletionpgml-dashboard/src/components/star/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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)]
Expand Down
4 changes: 4 additions & 0 deletionspgml-dashboard/static/css/scss/abstracts/variables.scss
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand DownExpand Up@@ -240,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;
Expand Down
2 changes: 1 addition & 1 deletionpgml-dashboard/static/css/scss/components/_navs.scss
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
height: $navbar-height;
position: fixed;
top: 0px;
z-index: $zindex-fixed;
z-index:calc($zindex-fixed + 1);
}

.navbar {
Expand Down
6 changes: 6 additions & 0 deletionspgml-dashboard/static/css/scss/layout/_containers.scss
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 - $breadcrumb-height - 1px);
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
<turbo-frame id="notebooks">
<div class="pb-5">
<div class="pb-5 position-relative">
<div style="width: 526px;
height: 433px;
max-width: 50vw;
position:relative;
position: absolute;
left: 50%;
top:93px;
top:calc(50% - 216px);
transform: translateX(-50%);
border-radius: 752px;
background: radial-gradient(46.38% 45.17% at 22.72% 36.90%, rgba(57, 210, 231, 0.60) 26.40%, rgba(174, 110, 255, 0.60) 100%);
filter: blur(252.66856384277344px);">
</div>
<% if !notebooks.is_empty() { %>
<div class="row gx-4 gy-4 position-relative" style="margin-top: -433px;">
<div class="row gx-4 gy-4 position-relative">
<% for notebook in notebooks { %>
<div class="col-12 col-md-6 col-xxl-4">
<div class="card h-100">
Expand Down
8 changes: 5 additions & 3 deletionspgml-dashboard/templates/layout/web_app_base.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,12 +32,14 @@
</div>

<div class="clear-from-under-navbar flex-grow-1 min-vw-0">
<div class="px-5 py-3">
<div class="px-5 py-3" style="position: absolute">
<%- Breadcrumbs::render( breadcrumbs ) %>
</div>

<div class="px-xs-2 px-md-5 pt-2 mb-2 overflow-auto">
<%- content.unwrap_or_default() %>
<div class="px-xs-2 px-md-5 overflow-hidden" style="padding-top: 57px;">
<div class="webapp-content-max-width-container pt-4">
<%- content.unwrap_or_default() %>
</div>
</div>
</div>
</div>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp