Compare commits
4 Commits
e9251f403e
...
fb622c6bd5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb622c6bd5 | ||
|
|
e49590313f | ||
|
|
09bb8a5fc2 | ||
|
|
c0baa4f217 |
@@ -1,6 +1,5 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
#[allow(clippy::expect_used)]
|
#[allow(clippy::expect_used)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Init logger
|
// Init logger
|
||||||
dioxus_logger::init(tracing::Level::DEBUG).expect("Failed to init logger");
|
dioxus_logger::init(tracing::Level::DEBUG).expect("Failed to init logger");
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ pub fn AppShell() -> Element {
|
|||||||
email: "user@example.com".to_string(),
|
email: "user@example.com".to_string(),
|
||||||
avatar_url: String::new(),
|
avatar_url: String::new(),
|
||||||
}
|
}
|
||||||
main { class: "main-content",
|
main { class: "main-content", Outlet::<Route> {} }
|
||||||
Outlet::<Route> {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,7 @@ use dioxus::prelude::*;
|
|||||||
/// * `href` - URL the card links to when clicked.
|
/// * `href` - URL the card links to when clicked.
|
||||||
/// * `icon` - Element rendered as the card icon (typically a `dioxus_free_icons::Icon`).
|
/// * `icon` - Element rendered as the card icon (typically a `dioxus_free_icons::Icon`).
|
||||||
#[component]
|
#[component]
|
||||||
pub fn DashboardCard(
|
pub fn DashboardCard(title: String, description: String, href: String, icon: Element) -> Element {
|
||||||
title: String,
|
|
||||||
description: String,
|
|
||||||
href: String,
|
|
||||||
icon: Element,
|
|
||||||
) -> Element {
|
|
||||||
rsx! {
|
rsx! {
|
||||||
a { class: "dashboard-card", href: "{href}",
|
a { class: "dashboard-card", href: "{href}",
|
||||||
div { class: "card-icon", {icon} }
|
div { class: "card-icon", {icon} }
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_free_icons::icons::bs_icons::{
|
use dioxus_free_icons::icons::bs_icons::{
|
||||||
BsBoxArrowRight, BsFileEarmarkText, BsGear, BsGithub, BsGrid,
|
BsBoxArrowRight, BsFileEarmarkText, BsGear, BsGithub, BsGrid, BsHouseDoor, BsRobot,
|
||||||
BsHouseDoor, BsRobot,
|
|
||||||
};
|
};
|
||||||
use dioxus_free_icons::icons::fa_solid_icons::FaCubes;
|
use dioxus_free_icons::icons::fa_solid_icons::FaCubes;
|
||||||
use dioxus_free_icons::Icon;
|
use dioxus_free_icons::Icon;
|
||||||
@@ -66,15 +65,9 @@ pub fn Sidebar(email: String, avatar_url: String) -> Element {
|
|||||||
{
|
{
|
||||||
// Simple active check: highlight Overview only when on `/`.
|
// Simple active check: highlight Overview only when on `/`.
|
||||||
let is_active = item.route == current_route;
|
let is_active = item.route == current_route;
|
||||||
let cls = if is_active {
|
let cls = if is_active { "sidebar-link active" } else { "sidebar-link" };
|
||||||
"sidebar-link active"
|
|
||||||
} else {
|
|
||||||
"sidebar-link"
|
|
||||||
};
|
|
||||||
rsx! {
|
rsx! {
|
||||||
Link {
|
Link { to: item.route, class: cls,
|
||||||
to: item.route,
|
|
||||||
class: cls,
|
|
||||||
{item.icon}
|
{item.icon}
|
||||||
span { "{item.label}" }
|
span { "{item.label}" }
|
||||||
}
|
}
|
||||||
@@ -135,16 +128,10 @@ fn SidebarFooter() -> Element {
|
|||||||
rsx! {
|
rsx! {
|
||||||
footer { class: "sidebar-footer",
|
footer { class: "sidebar-footer",
|
||||||
div { class: "sidebar-social",
|
div { class: "sidebar-social",
|
||||||
a {
|
a { href: "#", class: "social-link", title: "GitHub",
|
||||||
href: "#",
|
|
||||||
class: "social-link",
|
|
||||||
title: "GitHub",
|
|
||||||
Icon { icon: BsGithub, width: 16, height: 16 }
|
Icon { icon: BsGithub, width: 16, height: 16 }
|
||||||
}
|
}
|
||||||
a {
|
a { href: "#", class: "social-link", title: "Impressum",
|
||||||
href: "#",
|
|
||||||
class: "social-link",
|
|
||||||
title: "Impressum",
|
|
||||||
Icon { icon: BsGrid, width: 16, height: 16 }
|
Icon { icon: BsGrid, width: 16, height: 16 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ pub async fn auth_callback(
|
|||||||
|
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let token_resp = client
|
let token_resp = client
|
||||||
.post(&config.token_endpoint())
|
.post(config.token_endpoint())
|
||||||
.form(&[
|
.form(&[
|
||||||
("grant_type", "authorization_code"),
|
("grant_type", "authorization_code"),
|
||||||
("client_id", &config.client_id),
|
("client_id", &config.client_id),
|
||||||
@@ -237,7 +237,7 @@ pub async fn auth_callback(
|
|||||||
|
|
||||||
// --- Fetch userinfo ---
|
// --- Fetch userinfo ---
|
||||||
let userinfo: UserinfoResponse = client
|
let userinfo: UserinfoResponse = client
|
||||||
.get(&config.userinfo_endpoint())
|
.get(config.userinfo_endpoint())
|
||||||
.bearer_auth(&tokens.access_token)
|
.bearer_auth(&tokens.access_token)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
use std::{
|
use std::{ops::Deref, sync::Arc};
|
||||||
ops::{Deref, DerefMut},
|
|
||||||
sync::Arc,
|
|
||||||
};
|
|
||||||
|
|
||||||
use axum::extract::FromRequestParts;
|
use axum::extract::FromRequestParts;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tracing::debug;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct UserState(Arc<UserStateInner>);
|
pub struct UserState(Arc<UserStateInner>);
|
||||||
|
|||||||
@@ -40,11 +40,7 @@ pub fn OverviewPage() -> Element {
|
|||||||
description: "Guides & API Reference".to_string(),
|
description: "Guides & API Reference".to_string(),
|
||||||
href: "#".to_string(),
|
href: "#".to_string(),
|
||||||
icon: rsx! {
|
icon: rsx! {
|
||||||
Icon {
|
Icon { icon: BsBook, width: 28, height: 28 }
|
||||||
icon: BsBook,
|
|
||||||
width: 28,
|
|
||||||
height: 28,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
DashboardCard {
|
DashboardCard {
|
||||||
@@ -52,11 +48,7 @@ pub fn OverviewPage() -> Element {
|
|||||||
description: "Observability & Analytics".to_string(),
|
description: "Observability & Analytics".to_string(),
|
||||||
href: "#".to_string(),
|
href: "#".to_string(),
|
||||||
icon: rsx! {
|
icon: rsx! {
|
||||||
Icon {
|
Icon { icon: FaChartLine, width: 28, height: 28 }
|
||||||
icon: FaChartLine,
|
|
||||||
width: 28,
|
|
||||||
height: 28,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
DashboardCard {
|
DashboardCard {
|
||||||
@@ -64,11 +56,7 @@ pub fn OverviewPage() -> Element {
|
|||||||
description: "Agent Framework".to_string(),
|
description: "Agent Framework".to_string(),
|
||||||
href: "#".to_string(),
|
href: "#".to_string(),
|
||||||
icon: rsx! {
|
icon: rsx! {
|
||||||
Icon {
|
Icon { icon: FaGears, width: 28, height: 28 }
|
||||||
icon: FaGears,
|
|
||||||
width: 28,
|
|
||||||
height: 28,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
DashboardCard {
|
DashboardCard {
|
||||||
@@ -76,11 +64,7 @@ pub fn OverviewPage() -> Element {
|
|||||||
description: "Browse Models".to_string(),
|
description: "Browse Models".to_string(),
|
||||||
href: "#".to_string(),
|
href: "#".to_string(),
|
||||||
icon: rsx! {
|
icon: rsx! {
|
||||||
Icon {
|
Icon { icon: FaCubes, width: 28, height: 28 }
|
||||||
icon: FaCubes,
|
|
||||||
width: 28,
|
|
||||||
height: 28,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user