mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🎨 Official data sync counts the number of cloud storage API calls https://github.com/siyuan-note/siyuan/issues/8048
This commit is contained in:
parent
9a975b6cc7
commit
78a5c05d28
4 changed files with 12 additions and 2 deletions
|
|
@ -1599,7 +1599,7 @@ type Sync struct {
|
|||
SaveDir string `json:"saveDir"` // 本地同步数据存放目录路径
|
||||
}
|
||||
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize string, err error) {
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize, hTrafficAPIGet, hTrafficAPIPut string, err error) {
|
||||
stat, err := getCloudSpaceOSS()
|
||||
if nil != err {
|
||||
err = errors.New(Conf.Language(30) + " " + err.Error())
|
||||
|
|
@ -1630,6 +1630,8 @@ func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchan
|
|||
hExchangeSize = "-"
|
||||
hTrafficUploadSize = "-"
|
||||
hTrafficDownloadSize = "-"
|
||||
hTrafficAPIGet = "-"
|
||||
hTrafficAPIPut = "-"
|
||||
if conf.ProviderSiYuan == Conf.Sync.Provider {
|
||||
s.HSize = humanize.Bytes(uint64(syncSize))
|
||||
b.HSize = humanize.Bytes(uint64(backupSize))
|
||||
|
|
@ -1639,6 +1641,8 @@ func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchan
|
|||
hExchangeSize = humanize.Bytes(uint64(Conf.User.UserSiYuanPointExchangeRepoSize))
|
||||
hTrafficUploadSize = humanize.Bytes(uint64(Conf.User.UserTrafficUpload))
|
||||
hTrafficDownloadSize = humanize.Bytes(uint64(Conf.User.UserTrafficDownload))
|
||||
hTrafficAPIGet = fmt.Sprintf("%d", int(Conf.User.UserTrafficAPIGet))
|
||||
hTrafficAPIPut = fmt.Sprintf("%d", int(Conf.User.UserTrafficAPIPut))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue