cleanup: remove dead code, debug prints, and unused dead_code allow attributes

This commit is contained in:
xfy 2026-06-04 16:20:43 +08:00
parent c26c62558e
commit 1830fc9f2e
3 changed files with 2 additions and 49 deletions

View File

@ -565,7 +565,6 @@ async fn row_to_post_full(client: &tokio_postgres::Client, row: &tokio_postgres:
// ============================================================================
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct CreatePostRequest {
pub title: String,
pub slug: Option<String>,

View File

@ -39,40 +39,4 @@ pub fn AdminDashboardSkeleton() -> Element {
}
}
/// 完整的仪表盘页面骨架(含 header/footer + 内容)
#[component]
pub fn AdminSkeleton() -> Element {
rsx! {
div { class: "min-h-screen flex flex-col bg-white dark:bg-[#1d1e20]",
// Header 骨架
header { class: "sticky top-0 z-40 w-full border-b border-gray-200 dark:border-[#333] bg-white/80 dark:bg-[#1d1e20]/80 backdrop-blur-sm",
nav { class: "max-w-3xl mx-auto px-6 h-[60px] flex items-center justify-between",
// Logo 占位
SkeletonBox { class: "w-32 h-7 rounded" }
// 导航项 + 右侧按钮占位
div { class: "flex items-center gap-4",
div { class: "hidden md:flex items-center gap-2",
SkeletonBox { class: "w-12 h-5 rounded" }
SkeletonBox { class: "w-12 h-5 rounded" }
SkeletonBox { class: "w-10 h-5 rounded" }
}
SkeletonBox { class: "w-10 h-5 rounded" }
}
}
}
// 内容区骨架
main { class: "flex-1 w-full max-w-5xl mx-auto px-6 py-8",
AdminDashboardSkeleton {}
}
// Footer 骨架
footer { class: "w-full border-t border-gray-200 dark:border-[#333] py-6",
div { class: "max-w-3xl mx-auto px-6 flex justify-between items-center",
SkeletonBox { class: "h-4 w-32 rounded" }
SkeletonBox { class: "h-4 w-24 rounded" }
}
}
}
}
}

View File

@ -6,21 +6,13 @@ use crate::router::Route;
#[component]
pub fn PostNavLinks(prev: Option<PostNav>, next: Option<PostNav>) -> Element {
if let Some(ref p) = prev {
println!("[PostNavLinks] prev={} {}", p.slug, p.title);
}
if let Some(ref n) = next {
println!("[PostNavLinks] next={} {}", n.slug, n.title);
}
rsx! {
nav { class: "paginav",
if let Some(prev_post) = prev {
Link {
class: "prev",
to: Route::PostDetail { slug: prev_post.slug.clone() },
onclick: move |evt: dioxus::events::MouseEvent| {
println!("[PostNavLinks] clicked prev: {}", prev_post.slug);
},
onclick: move |_evt: dioxus::events::MouseEvent| {},
span { class: "title", "« Prev" }
span { class: "post-title-nav", "{prev_post.title}" }
}
@ -32,9 +24,7 @@ pub fn PostNavLinks(prev: Option<PostNav>, next: Option<PostNav>) -> Element {
Link {
class: "next",
to: Route::PostDetail { slug: next_post.slug.clone() },
onclick: move |evt: dioxus::events::MouseEvent| {
println!("[PostNavLinks] clicked next: {}", next_post.slug);
},
onclick: move |_evt: dioxus::events::MouseEvent| {},
span { class: "title", "Next »" }
span { class: "post-title-nav", "{next_post.title}" }
}