diff --git a/src/components/ui.rs b/src/components/ui.rs index b43ca5d..b307f6a 100644 --- a/src/components/ui.rs +++ b/src/components/ui.rs @@ -29,6 +29,12 @@ pub const ADMIN_ROW_HOVER: &str = /// 列表复选框统一样式(全选表头 + 行内)。 pub const CHECKBOX_CLASS: &str = "rounded border-paper-border"; +/// 行内加载 spinner:环形渐变 + 自旋动画,用 currentColor 继承文字色。 +/// +/// 内联 SVG(含 `@keyframes`),通过 `dangerous_inner_html` 注入;尺寸由外层 +/// Tailwind 类(如 `w-3.5 h-3.5`)控制。源文件 `public/icons/90-ring-with-gradient.svg`。 +pub const SPINNER_SVG: &str = r#""#; + /// 状态徽章外层:小号圆角胶囊。 pub const BADGE_BASE: &str = "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium whitespace-nowrap"; diff --git a/src/pages/admin/posts.rs b/src/pages/admin/posts.rs index f1d71c7..3bf3c03 100644 --- a/src/pages/admin/posts.rs +++ b/src/pages/admin/posts.rs @@ -17,6 +17,7 @@ use crate::components::skeletons::delayed_skeleton::DelayedSkeleton; use crate::components::skeletons::posts_skeleton::PostsSkeleton; use crate::components::ui::{ Pagination, StatusBadge, ADMIN_ROW_HOVER, ADMIN_TABLE_CLASS, BTN_TEXT_ACCENT, BTN_TEXT_RED, + SPINNER_SVG, }; use crate::hooks::query::use_paginated; use crate::models::post::PostListItem; @@ -118,7 +119,7 @@ pub fn PostsPage(page: i32) -> Element { "状态" } th { class: "px-4 py-3 font-medium w-32", "日期" } - th { class: "px-4 py-3 font-medium w-24 text-right", + th { class: "px-4 py-3 font-medium w-44 text-right", "操作" } } @@ -302,11 +303,18 @@ fn PostRow( "编辑" } button { - class: if rebuilding { "text-xs text-paper-secondary cursor-not-allowed" } else { BTN_TEXT_ACCENT }, + class: if rebuilding { + "inline-flex items-center gap-1 text-xs text-paper-secondary cursor-not-allowed" + } else { + BTN_TEXT_ACCENT + }, disabled: rebuilding, onclick: move |_| on_rebuild.call(post.id), if rebuilding { - "重建中..." + {rsx! { + span { dangerous_inner_html: SPINNER_SVG } + "重建中" + }} } else { "重建" }