alist
alist copied to clipboard
添加驱动后 能不能看到 在前台或者后台 看到 剩余空间 100M/10G 这样的显示
Please make sure of the following things
- [X] I have read the documentation.
- [X] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure this feature is not implemented.
- [X] I'm sure it's a reasonable and popular requirement.
Description of the feature / 需求描述
添加驱动后 能不能看到 在前台或者后台 看到 剩余空间 100M/10G 这样的显示 不知道能不能实现
Suggested solution / 实现思路
No response
Additional context / 附件
No response
不出意外 应该不能 :joy_cat:
但是clouddrive好像实现了这个功能,其他的webdav挂载服务空间显示都是有问题的
据我所知,像OneDrive,百度 这些开放Api服务的是可以使用Api获取已用空间和总空间的
理论上应该是可以的
该加载哪里好?是加在后台管理界面吗?如果是前台的目录的设计似乎是对于存储无感的,去查询是哪个存储还有额外需求。要不然做到后台的那个存储里面。刚好管理的时候看到总容量和使用量来,然后挂载之后手动刷新去调取最新数据,给那个状态下面加一行使用量怎么怎么样?
// 如果返回2个0,就说明没有拿到值,要么是接口状态不对,要么是没这个接口
func (d *BaiduNetdisk) totalSize(ctx context.Context, params map[string]string) (int64, int64) {
res, err := base.RestyClient.R().
SetContext(ctx).
SetQueryParams(params).
Get("/api/quota?openapi=xpansdk")
if err != nil {
return 0, 0
}
log.Debugln(res.RawResponse.Status + res.String())
errCode := utils.Json.Get(res.Body(), "error_code").ToInt()
errNo := utils.Json.Get(res.Body(), "errno").ToInt()
if errCode != 0 || errNo != 0 {
return 0, 0
}
return utils.Json.Get(res.Body(), "total").ToInt64(), utils.Json.Get(res.Body(), "used").ToInt64()
}
给某一个加还算比较容易,比如百度网盘这种有文档的。但是如果给全部都加上,再加上 alist 的 api和前端就得要点时间了
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello @, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.
想要这样的功能,这样就方便在上传文件时清楚空间是否足够,整理文件也会方便些。