Skip to main content

Module friends

Module friends 

Source
Expand description

管理后台「友链」页面(/admin/friends)。

左侧为友链列表:拖动把手或在把手上按 ↑ / ↓ 调整顺序,顺序按 10、20、30… 写回 排序值;右侧为添加 / 编辑表单(名称、链接、头像、简介、排序值、是否在前台展示), 编辑时可删除(确认对话框,物理删除)。写操作成功后服务端失效友链缓存与 /friends SSR 缓存。数据只在 WASM 前端读取(Effect + 世代号)。样式见 styles/pages/admin-friends.css。

Structs§

FriendFormProps 🔒
Props for the FriendForm component.
FriendRowProps 🔒
Props for the FriendRow component.
FriendsAdminProps 🔒
Props for the FriendsAdmin component.
FriendsAdminRoute
友链管理路由(无 SSR 数据,列表在客户端读取)。

Constants§

SORT_STEP 🔒
排序值步长:给手动插队留出空位。

Functions§

FriendForm 🔒
添加 / 编辑表单。link 为 None 时为添加;调用方按编辑对象重建以回填。
FriendRow 🔒
列表的一行:把手、头像、名称与状态、主机、排序值与编辑。
FriendsAdmin 🔒
管理后台友链页面。
__FriendsAdminRoute_View 🔒
host_of 🔒
链接去掉协议与末尾斜杠,列表里只显示主机与路径。
initial_of 🔒
名称首字(头像缺省时显示)。
reorder 🔒
把 from 移到 to 后,按步长重排排序值;返回排序值有变化的友链。
row_key 🔒
列表行的重建键:内容或位置变化时重建该行,拖动等瞬时状态不在其中。

Type Aliases§

DragState 🔒
拖动状态:正在拖的行下标(宏属性里不便直接写泛型)。