diff --git a/frontend/src/pages/S2AConfig.tsx b/frontend/src/pages/S2AConfig.tsx index ce7f143..68d8a43 100644 --- a/frontend/src/pages/S2AConfig.tsx +++ b/frontend/src/pages/S2AConfig.tsx @@ -598,10 +598,15 @@ function ProfileCard({ profile, isActive, isActivating, groupNameCache, onActiva onDelete: () => void }) { const [confirming, setConfirming] = useState(false) + const [expanded, setExpanded] = useState(false) let parsedGroups: number[] = [] try { parsedGroups = JSON.parse(profile.group_ids || '[]') } catch { /* ignore */ } + const MAX_VISIBLE = 4 + const visibleGroups = expanded ? parsedGroups : parsedGroups.slice(0, MAX_VISIBLE) + const hiddenCount = parsedGroups.length - MAX_VISIBLE + return ( {/* 活动标记 */} @@ -636,13 +641,23 @@ function ProfileCard({ profile, isActive, isActivating, groupNameCache, onActiva {/* 分组列表 */} {parsedGroups.length > 0 && ( -
- {parsedGroups.map(id => ( -
- {groupNameCache[id] || `#${id}`} - {groupNameCache[id] && #{id}} -
- ))} +
+
+ {visibleGroups.map(id => ( +
+ {groupNameCache[id] || `#${id}`} + {groupNameCache[id] && #{id}} +
+ ))} +
+ {hiddenCount > 0 && ( + + )}
)}