mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
177b42c1ef
commit
e4b712547f
9 changed files with 22 additions and 14 deletions
|
|
@ -59,9 +59,7 @@ func RemoveCloudBackup() (err error) {
|
|||
}
|
||||
|
||||
func getCloudAvailableBackupSize() (size int64, err error) {
|
||||
var sync map[string]interface{}
|
||||
var assetSize int64
|
||||
sync, _, assetSize, err = getCloudSpaceOSS()
|
||||
sync, _, assetSize, repoSize, err := getCloudSpaceOSS()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -70,16 +68,15 @@ func getCloudAvailableBackupSize() (size int64, err error) {
|
|||
if nil != sync {
|
||||
syncSize = int64(sync["size"].(float64))
|
||||
}
|
||||
size = int64(Conf.User.UserSiYuanRepoSize) - syncSize - assetSize
|
||||
size = int64(Conf.User.UserSiYuanRepoSize) - syncSize - assetSize - repoSize
|
||||
return
|
||||
}
|
||||
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize string, err error) {
|
||||
var sync, backup map[string]interface{}
|
||||
var assetSize int64
|
||||
sync, backup, assetSize, err = getCloudSpaceOSS()
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hRepoSize, hTotalSize string, err error) {
|
||||
sync, backup, assetSize, repoSize, err := getCloudSpaceOSS()
|
||||
if nil != err {
|
||||
return nil, nil, "", "", "", errors.New(Conf.Language(30) + " " + err.Error())
|
||||
err = errors.New(Conf.Language(30) + " " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
var totalSize, syncSize, backupSize int64
|
||||
|
|
@ -103,8 +100,9 @@ func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize string,
|
|||
HSize: humanize.Bytes(uint64(backupSize)),
|
||||
Updated: backupUpdated,
|
||||
}
|
||||
totalSize = syncSize + backupSize + assetSize
|
||||
totalSize = syncSize + backupSize + assetSize + repoSize
|
||||
hAssetSize = humanize.Bytes(uint64(assetSize))
|
||||
hRepoSize = humanize.Bytes(uint64(repoSize))
|
||||
hSize = humanize.Bytes(uint64(totalSize))
|
||||
hTotalSize = byteCountSI(int64(Conf.User.UserSiYuanRepoSize))
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue