🎨 Improve the mouse hove data sync button information on the desktop and browser https://github.com/siyuan-note/siyuan/issues/8521

This commit is contained in:
Daniel 2023-06-12 11:49:01 +08:00
parent 1b8adb473c
commit 2797fae417
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 11 additions and 40 deletions

View file

@ -928,6 +928,7 @@ func syncRepoDownload() (err error) {
}
}
Conf.Sync.Stat = msg
Conf.Save()
util.PushStatusBar(msg)
util.PushErrMsg(msg, 0)
return
@ -937,6 +938,7 @@ func syncRepoDownload() (err error) {
Conf.Sync.Synced = util.CurrentTimeMillis()
msg := fmt.Sprintf(Conf.Language(150), trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)))
Conf.Sync.Stat = msg
Conf.Save()
autoSyncErrCount = 0
logging.LogInfof("synced data repo download [provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",
Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())
@ -995,6 +997,7 @@ func syncRepoUpload() (err error) {
}
}
Conf.Sync.Stat = msg
Conf.Save()
util.PushStatusBar(msg)
util.PushErrMsg(msg, 0)
return
@ -1004,6 +1007,7 @@ func syncRepoUpload() (err error) {
Conf.Sync.Synced = util.CurrentTimeMillis()
msg := fmt.Sprintf(Conf.Language(150), trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)))
Conf.Sync.Stat = msg
Conf.Save()
autoSyncErrCount = 0
logging.LogInfof("synced data repo upload [provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",
Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())
@ -1080,6 +1084,7 @@ func bootSyncRepo() (err error) {
}
}
Conf.Sync.Stat = msg
Conf.Save()
util.PushStatusBar(msg)
util.PushErrMsg(msg, 0)
BootSyncSucc = 1
@ -1152,6 +1157,7 @@ func syncRepo(exit, byHand bool) (err error) {
}
}
Conf.Sync.Stat = msg
Conf.Save()
util.PushStatusBar(msg)
if 1 > autoSyncErrCount || byHand {
util.PushErrMsg(msg, 0)
@ -1166,6 +1172,7 @@ func syncRepo(exit, byHand bool) (err error) {
Conf.Sync.Synced = util.CurrentTimeMillis()
msg := fmt.Sprintf(Conf.Language(150), trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)))
Conf.Sync.Stat = msg
Conf.Save()
autoSyncErrCount = 0
logging.LogInfof("synced data repo [kernel=%s, provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",
kernelID, Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())