fix CloudDrive2助手支持HomePage自定义API

This commit is contained in:
thsrite
2024-08-05 11:20:37 +08:00
parent c9be7fbbf5
commit b5bed2d2de
4 changed files with 122 additions and 4 deletions

46
docs/Cd2Assistant.md Normal file
View File

@@ -0,0 +1,46 @@
# CloudDriver HomePage自定义API
![img.png](../img/HomePage/img.png)
HomePage services.yaml配置
```angular2html
- CloudDrive2:
icon: /icons/icon/clouddrive.png
href: http://cd2ip:cd2端口/
ping: http://cd2ip:cd2端口
#server: unraid
#container: CloudDrive
showStats: true
display: list
widget:
type: customapi
url: http://mp_ip:mp_port/api/v1/plugin/Cd2Assistant/homepage?apikey=mp_apikey
method: GET
mappings:
# - field: uptime
# label: 运行时间
- field: upload_count
label: 上传数量
- field: upload_speed
label: 上传速度
- field: download_count
label: 下载数量
- field: download_speed
label: 下载速度
# - field: cloud_space
# label: 剩余空间
```
### 自定义API Response字段
- cpuUsage CPU使用率
- memUsageKB 内存使用量
- uptime 运行时间
- upload_count 上传数量
- upload_speed 上传速度
- download_count 下载数量
- download_speed 下载速度
- cloud_space 剩余空间
### HomePage自定义API文档
https://gethomepage.dev/latest/widgets/services/customapi/#custom-request-body