mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 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:
parent
71add56563
commit
b53d210258
3 changed files with 23 additions and 0 deletions
|
|
@ -209,6 +209,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/sync/performSync", model.CheckAuth, model.CheckReadonly, performSync)
|
||||
ginServer.Handle("POST", "/api/sync/performBootSync", model.CheckAuth, model.CheckReadonly, performBootSync)
|
||||
ginServer.Handle("POST", "/api/sync/getBootSync", model.CheckAuth, getBootSync)
|
||||
ginServer.Handle("POST", "/api/sync/getSyncInfo", model.CheckAuth, getSyncInfo)
|
||||
|
||||
ginServer.Handle("POST", "/api/inbox/getShorthands", model.CheckAuth, getShorthands)
|
||||
ginServer.Handle("POST", "/api/inbox/getShorthand", model.CheckAuth, getShorthand)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,22 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getSyncInfo(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
if !model.Conf.Sync.Enabled {
|
||||
ret.Msg = model.Conf.Language(53)
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"synced": model.Conf.Sync.Synced,
|
||||
"stat": model.Conf.Sync.Stat,
|
||||
"kernels": model.GetOnlineKernels(),
|
||||
}
|
||||
}
|
||||
|
||||
func getBootSync(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
|
|
@ -653,6 +653,12 @@ var (
|
|||
onlineKernelsLock = sync.Mutex{}
|
||||
)
|
||||
|
||||
func GetOnlineKernels() []*OnlineKernel {
|
||||
onlineKernelsLock.Lock()
|
||||
defer onlineKernelsLock.Unlock()
|
||||
return onlineKernels
|
||||
}
|
||||
|
||||
var closedSyncWebSocket = false
|
||||
|
||||
func closeSyncWebSocket() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue