From bbfbc77b302a051d7f52c2b8a25e92a5c6f6a745 Mon Sep 17 00:00:00 2001 From: CNWei Date: Mon, 2 Nov 2026 19:54:36 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"style(admin):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=B1=82=E7=BA=A7=E4=B8=8E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8E=92=E7=89=88"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1f7589538715204eb14397b36533b9742c1babd. --- stash-web/src/App.css | 63 +------- stash-web/src/components/admin/AdminNext.tsx | 154 +++++++------------ 2 files changed, 54 insertions(+), 163 deletions(-) diff --git a/stash-web/src/App.css b/stash-web/src/App.css index c44b4c3..fa54630 100644 --- a/stash-web/src/App.css +++ b/stash-web/src/App.css @@ -787,67 +787,7 @@ } .admin-form { - margin-top: 0; -} - -.admin-form-narrow { - max-width: 820px; -} - -/* 每个后台页面统一的标题区 */ -.admin-panel-head { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: var(--su-space-5); - padding-bottom: var(--su-space-4); - border-bottom: 1px solid var(--su-border); - margin-bottom: var(--su-space-2); -} - -.admin-panel-heading { - min-width: 0; -} - -.admin-panel-title { - margin: 0; - color: var(--su-text-main); - font-size: 20px; - font-weight: 700; - line-height: 1.3; - letter-spacing: -0.01em; -} - -.admin-panel-desc { - max-width: 760px; - margin: var(--su-space-2) 0 0; - color: var(--su-text-muted); - font-size: var(--su-font-size-sm); - line-height: 1.65; -} - -.admin-panel-actions { - display: flex; - flex: none; - flex-wrap: wrap; - align-items: center; - justify-content: flex-end; - gap: var(--su-space-2); -} - -/* 表单标签统一加粗,避免组件默认字重在不同字体下发虚 */ -.admin-panel label { - font-weight: 600; -} - -.admin-inline-actions { - display: flex; - gap: var(--su-space-2); -} - -.admin-form-divider { - margin: var(--su-space-1) 0; - border-top: 1px dashed var(--su-border-strong); + margin-top: var(--su-space-5); } .admin-row { @@ -956,7 +896,6 @@ } .admin-actions { - max-width: 820px; margin-top: var(--su-space-6); } diff --git a/stash-web/src/components/admin/AdminNext.tsx b/stash-web/src/components/admin/AdminNext.tsx index 306e2e7..c10d3ef 100644 --- a/stash-web/src/components/admin/AdminNext.tsx +++ b/stash-web/src/components/admin/AdminNext.tsx @@ -30,7 +30,7 @@ import { type IconName, type MenuItem, } from '@stash/ui' -import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react' +import { useEffect, useMemo, useRef, useState } from 'react' import { changePassword, fetchSession, logout, type SessionState } from '../../auth' import { LoginDialog } from '../auth/LoginDialog' import { GroupMark as GroupGlyph } from '../common/GroupMark' @@ -127,27 +127,6 @@ function flattenCardsGroups(groups: GroupNode[]) { return flattenGroups(groups) } -/** 后台每个页面统一的标题区:加粗标题 + 说明 + 右侧操作 */ -function PanelHeader({ - title, - description, - children, -}: { - title: string - description?: string - children?: ReactNode -}) { - return ( -
-
-

{title}

- {description !== undefined &&

{description}

} -
- {children !== undefined &&
{children}
} -
- ) -} - export function AdminNext() { const [session, setSession] = useState(null) const [loginOpen, setLoginOpen] = useState(false) @@ -313,9 +292,9 @@ export function AdminNext() {
- 后台管理 + 站点设置 - 管理内容、首页展示与站点设置。 + 分组是唯一容器;侧边栏和内容卡片都只是勾选分组来组合展示。 @@ -353,10 +332,7 @@ export function AdminNext() { {tab === 'home-sidebar' && (
- + 侧边栏 - + 内容卡片 + + 说明:卡片是首页上的一个区块;在这里勾选它包含哪些分组,并调整这些分组的先后顺序与预览条数。 + 分组是否启用仍由「分组管理」决定,停用的分组不会出现在卡片里。 + - + + 说明:分组用于控制前台侧边栏与卡片;可多层嵌套,根分组决定格式。内容(条目)只挂在分组上。 + + +
- +
- -
-
- ({ + value: option.key, + label: option.title, + }))} + value={group?.key ?? ''} + onChange={setGroupKey} + />
- + +
{group?.title ?? ''} 下共 {rows.length} 条(含子分组) @@ -1356,7 +1333,11 @@ function SidebarPanel({ saving: boolean }) { return ( - + + + 说明:分组在侧边栏的显隐只由「分组管理 → 状态」决定;这里只管三块侧栏卡片。 + +