random-api-go/web/README.md

36 lines
902 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 端点拖拽排序功能
## 功能说明
在管理页面的API端点管理中现在支持通过拖拽来重新排序端点。
## 使用方法
1. 进入管理页面 (`/admin`)
2. 在API端点管理表格中每行左侧有一个拖拽图标 (⋮⋮)
3. 点击并拖拽该图标可以重新排列端点的顺序
4. 松开鼠标后,新的排序会自动保存到后端
## 技术实现
- 使用 `@dnd-kit` 库实现拖拽功能
- 支持鼠标和键盘操作
- 拖拽过程中有视觉反馈(透明度变化)
- 自动保存排序到数据库
## 特性
- **无障碍支持**: 支持键盘操作
- **视觉反馈**: 拖拽时元素半透明显示
- **自动保存**: 排序变更后自动同步到后端
- **错误处理**: 如果保存失败会显示错误提示
## 依赖
```json
{
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2"
}
```