Expand description
管理后台「友链」页面(/admin/friends)。
左侧为友链列表:拖动把手或在把手上按 ↑ / ↓ 调整顺序,顺序按 10、20、30… 写回
排序值;右侧为添加 / 编辑表单(名称、链接、头像、简介、排序值、是否在前台展示),
编辑时可删除(确认对话框,物理删除)。写操作成功后服务端失效友链缓存与 /friends
SSR 缓存。数据只在 WASM 前端读取(Effect + 世代号)。样式见 styles/pages/admin-friends.css。
Structs§
- Friend
Form 🔒Props - Props for the
FriendFormcomponent. - Friend
RowProps 🔒 - Props for the
FriendRowcomponent. - Friends
Admin 🔒Props - Props for the
FriendsAdmincomponent. - Friends
Admin Route - 友链管理路由(无 SSR 数据,列表在客户端读取)。
Constants§
- SORT_
STEP 🔒 - 排序值步长:给手动插队留出空位。
Functions§
- Friend
Form 🔒 - 添加 / 编辑表单。
link为None时为添加;调用方按编辑对象重建以回填。 - Friend
Row 🔒 - 列表的一行:把手、头像、名称与状态、主机、排序值与编辑。
- Friends
Admin 🔒 - 管理后台友链页面。
- __
Friends 🔒Admin Route_ View - host_of 🔒
- 链接去掉协议与末尾斜杠,列表里只显示主机与路径。
- initial_
of 🔒 - 名称首字(头像缺省时显示)。
- reorder 🔒
- 把
from移到to后,按步长重排排序值;返回排序值有变化的友链。 - row_key 🔒
- 列表行的重建键:内容或位置变化时重建该行,拖动等瞬时状态不在其中。
Type Aliases§
- Drag
State 🔒 - 拖动状态:正在拖的行下标(宏属性里不便直接写泛型)。