feat(sidebar): add compliance scanner link from env config (#19)
CI / Format (push) Successful in 4s
CI / Clippy (push) Successful in 2m43s
CI / Security Audit (push) Successful in 1m37s
CI / Tests (push) Successful in 3m54s
CI / Deploy (push) Successful in 2s
CI / E2E Tests (push) Failing after 31s

This commit was merged in pull request #19.
This commit is contained in:
2026-03-09 08:39:00 +00:00
parent ca5da3c232
commit 75a35dbb85
11 changed files with 38 additions and 7 deletions
+1
View File
@@ -76,6 +76,7 @@ pub fn AppShell() -> Element {
name: info.name,
avatar_url: info.avatar_url,
librechat_url: info.librechat_url,
compliance_scanner_url: info.compliance_scanner_url,
class: sidebar_cls,
on_nav: move |_| mobile_menu_open.set(false),
}
+13 -2
View File
@@ -1,7 +1,7 @@
use dioxus::prelude::*;
use dioxus_free_icons::icons::bs_icons::{
BsBoxArrowRight, BsBuilding, BsChatDots, BsCloudArrowUp, BsCodeSlash, BsGithub, BsGlobe2,
BsGrid, BsHouseDoor, BsMoonFill, BsSunFill,
BsGrid, BsHouseDoor, BsMoonFill, BsShieldCheck, BsSunFill,
};
use dioxus_free_icons::Icon;
@@ -44,13 +44,14 @@ pub fn Sidebar(
email: String,
avatar_url: String,
#[props(default = "http://localhost:3080".to_string())] librechat_url: String,
#[props(default)] compliance_scanner_url: String,
#[props(default = "sidebar".to_string())] class: String,
#[props(default)] on_nav: EventHandler<()>,
) -> Element {
let locale = use_context::<Signal<Locale>>();
let locale_val = *locale.read();
let nav_items: Vec<NavItem> = vec![
let mut nav_items: Vec<NavItem> = vec![
NavItem {
key: "dashboard",
label: t(locale_val, "nav.dashboard"),
@@ -84,6 +85,16 @@ pub fn Sidebar(
},
];
// Only show the compliance scanner link when a URL is configured.
if !compliance_scanner_url.is_empty() {
nav_items.push(NavItem {
key: "compliance",
label: t(locale_val, "nav.compliance"),
target: NavTarget::External(compliance_scanner_url.clone()),
icon: rsx! { Icon { icon: BsShieldCheck, width: 18, height: 18 } },
});
}
// Determine current path to highlight the active nav link.
let current_route = use_route::<Route>();
let logout_label = t(locale_val, "common.logout");