An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve the mouse hove data sync button information on the desktop and browser https://github.com/siyuan-note/siyuan/issues/8521
Daniel2797fae417e0
diff --git a/kernel/model/repository.go b/kernel/model/repository.goindex af27440d71..8006de9321 100644--- a/kernel/model/repository.go+++ b/kernel/model/repository.go@@ -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 = 0logging.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 = 0logging.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 = 0logging.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())diff --git a/kernel/model/sync.go b/kernel/model/sync.goindex bf988596f9..47c2d1da3d 100644--- a/kernel/model/sync.go+++ b/kernel/model/sync.go@@ -62,20 +62,11 @@ func SyncDataDownload() {Conf.Sync.Synced = nowerr := syncRepoDownload()- synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"- if nil == err {- synced += Conf.Sync.Stat- } else {- synced += fmt.Sprintf(Conf.Language(80), formatRepoErrorMsg(err))- }- msg := fmt.Sprintf(Conf.Language(82), synced)- Conf.Sync.Stat = msg- Conf.Save()code := 1if nil != err {code = 2}- util.BroadcastByType("main", "syncing", code, msg, nil)+ util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)}func SyncDataUpload() {@@ -98,20 +89,11 @@ func SyncDataUpload() {Conf.Sync.Synced = nowerr := syncRepoUpload()- synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"- if nil == err {- synced += Conf.Sync.Stat- } else {- synced += fmt.Sprintf(Conf.Language(80), formatRepoErrorMsg(err))- }- msg := fmt.Sprintf(Conf.Language(82), synced)- Conf.Sync.Stat = msg- Conf.Save()code := 1if nil != err {code = 2}- util.BroadcastByType("main", "syncing", code, msg, nil)+ util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)return}@@ -161,20 +143,11 @@ func BootSyncData() {Conf.Sync.Synced = nowutil.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)err := bootSyncRepo()- synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"- if nil == err {- synced += Conf.Sync.Stat- } else {- synced += fmt.Sprintf(Conf.Language(80), formatRepoErrorMsg(err))- }- msg := fmt.Sprintf(Conf.Language(82), synced)- Conf.Sync.Stat = msg- Conf.Save()code := 1if nil != err {code = 2}- util.BroadcastByType("main", "syncing", code, msg, nil)+ util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)return}@@ -208,20 +181,11 @@ func syncData(exit, byHand, byWebSocket bool) {Conf.Sync.Synced = nowerr := syncRepo(exit, byHand)- synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"- if nil == err {- synced += Conf.Sync.Stat- } else {- synced += fmt.Sprintf(Conf.Language(80), formatRepoErrorMsg(err))- }- msg := fmt.Sprintf(Conf.Language(82), synced)- Conf.Sync.Stat = msg- Conf.Save()code := 1if nil != err {code = 2}- util.BroadcastByType("main", "syncing", code, msg, nil)+ util.BroadcastByType("main", "syncing", code, Conf.Sync.Stat, nil)if nil == webSocketConn && Conf.Sync.Perception {// 如果 websocket 连接已经断开,则重新连接