Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Danielb35950b95770
diff --git a/kernel/api/sync.go b/kernel/api/sync.go
index ba5c44733d..5bd16e1a93 100644
--- a/kernel/api/sync.go
+++ b/kernel/api/sync.go
@@ -39,6 +39,7 @@ func getSyncInfo(c *gin.Context) {
"synced": model.Conf.Sync.Synced,
"stat": stat,
"kernels": model.GetOnlineKernels(),
+ "kernel": model.KernelID,
}
}
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 8006de9321..9ea0670c9c 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -1175,7 +1175,7 @@ func syncRepo(exit, byHand bool) (err error) {
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())
+ KernelID, Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())
processSyncMergeResult(exit, byHand, start, mergeResult)
return
diff --git a/kernel/model/sync.go b/kernel/model/sync.go
index f3626c5c74..5f9f4c86cd 100644
--- a/kernel/model/sync.go
+++ b/kernel/model/sync.go
@@ -623,7 +623,7 @@ func GetOnlineKernels() (ret []*OnlineKernel) {
tmp := onlineKernels
onlineKernelsLock.Unlock()
for _, kernel := range tmp {
- if kernel.ID == kernelID {
+ if kernel.ID == KernelID {
continue
}
@@ -740,14 +740,14 @@ func connectSyncWebSocket() {
}()
}
-var kernelID = gulu.Rand.String(7)
+var KernelID = gulu.Rand.String(7)
func dialSyncWebSocket() (c *websocket.Conn, err error) {
//endpoint := "ws://127.0.0.1:64388" + "/apis/siyuan/dejavu/ws"
endpoint := util.AliyunWebSocketServer + "/apis/siyuan/dejavu/ws"
header := http.Header{
"x-siyuan-uid": []string{Conf.User.UserId},
- "x-siyuan-kernel": []string{kernelID},
+ "x-siyuan-kernel": []string{KernelID},
"x-siyuan-ver": []string{util.Ver},
"x-siyuan-os": []string{runtime.GOOS},
"x-siyuan-hostname": []string{util.GetDeviceName()},