feat: rag-embedding-ai-chat (#1)
Co-authored-by: Sharang Parnerkar <parnerkarsharang@gmail.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -47,17 +47,19 @@ fn insert_path(
|
||||
let name = parts[0].to_string();
|
||||
let is_leaf = parts.len() == 1;
|
||||
|
||||
let entry = children.entry(name.clone()).or_insert_with(|| FileTreeNode {
|
||||
name: name.clone(),
|
||||
path: if is_leaf {
|
||||
full_path.to_string()
|
||||
} else {
|
||||
String::new()
|
||||
},
|
||||
is_dir: !is_leaf,
|
||||
node_count: 0,
|
||||
children: Vec::new(),
|
||||
});
|
||||
let entry = children
|
||||
.entry(name.clone())
|
||||
.or_insert_with(|| FileTreeNode {
|
||||
name: name.clone(),
|
||||
path: if is_leaf {
|
||||
full_path.to_string()
|
||||
} else {
|
||||
String::new()
|
||||
},
|
||||
is_dir: !is_leaf,
|
||||
node_count: 0,
|
||||
children: Vec::new(),
|
||||
});
|
||||
|
||||
if is_leaf {
|
||||
entry.node_count = node_count;
|
||||
|
||||
@@ -46,6 +46,11 @@ pub fn Sidebar() -> Element {
|
||||
route: Route::GraphIndexPage {},
|
||||
icon: rsx! { Icon { icon: BsDiagram3, width: 18, height: 18 } },
|
||||
},
|
||||
NavItem {
|
||||
label: "AI Chat",
|
||||
route: Route::ChatIndexPage {},
|
||||
icon: rsx! { Icon { icon: BsChatDots, width: 18, height: 18 } },
|
||||
},
|
||||
NavItem {
|
||||
label: "DAST",
|
||||
route: Route::DastOverviewPage {},
|
||||
@@ -58,7 +63,11 @@ pub fn Sidebar() -> Element {
|
||||
},
|
||||
];
|
||||
|
||||
let sidebar_class = if collapsed() { "sidebar collapsed" } else { "sidebar" };
|
||||
let sidebar_class = if collapsed() {
|
||||
"sidebar collapsed"
|
||||
} else {
|
||||
"sidebar"
|
||||
};
|
||||
|
||||
rsx! {
|
||||
nav { class: "{sidebar_class}",
|
||||
@@ -76,6 +85,7 @@ pub fn Sidebar() -> Element {
|
||||
(Route::GraphIndexPage {}, Route::GraphIndexPage {}) => true,
|
||||
(Route::GraphExplorerPage { .. }, Route::GraphIndexPage {}) => true,
|
||||
(Route::ImpactAnalysisPage { .. }, Route::GraphIndexPage {}) => true,
|
||||
(Route::ChatPage { .. }, Route::ChatIndexPage {}) => true,
|
||||
(Route::DastTargetsPage {}, Route::DastOverviewPage {}) => true,
|
||||
(Route::DastFindingsPage {}, Route::DastOverviewPage {}) => true,
|
||||
(Route::DastFindingDetailPage { .. }, Route::DastOverviewPage {}) => true,
|
||||
|
||||
@@ -20,6 +20,12 @@ pub struct Toasts {
|
||||
next_id: Signal<usize>,
|
||||
}
|
||||
|
||||
impl Default for Toasts {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Toasts {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
@@ -39,11 +45,11 @@ impl Toasts {
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
{
|
||||
let mut items = self.items;
|
||||
spawn(async move {
|
||||
gloo_timers::future::TimeoutFuture::new(4_000).await;
|
||||
items.write().retain(|t| t.id != id);
|
||||
});
|
||||
let mut items = self.items;
|
||||
spawn(async move {
|
||||
gloo_timers::future::TimeoutFuture::new(4_000).await;
|
||||
items.write().retain(|t| t.id != id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user