mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 21:08:49 +01:00
🎨 Data synchronization supports the multi-kernel online perception https://github.com/siyuan-note/siyuan/issues/8518
This commit is contained in:
parent
84d551bdd5
commit
4e643e6af8
3 changed files with 14 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import {needSubscribe} from "../util/needSubscribe";
|
||||
import {fetchPost} from "../util/fetch";
|
||||
import {isBrowser} from "../util/functions";
|
||||
import {showMessage} from "../dialog/message";
|
||||
import {bindSyncCloudListEvent, getSyncCloudList} from "../sync/syncGuide";
|
||||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||
|
|
@ -307,7 +308,7 @@ export const repos = {
|
|||
<option value="3" ${window.siyuan.config.sync.mode === 3 ? "selected" : ""}>${window.siyuan.languages.syncMode3}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<label class="fn__flex b3-label${isBrowser() ? " fn__none" : " fn__flex"}">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.syncPerception}
|
||||
<div class="b3-label__text">${window.siyuan.languages.syncPerceptionTip}</div>
|
||||
|
|
|
|||
|
|
@ -284,6 +284,9 @@ func InitConf() {
|
|||
}
|
||||
Conf.Sync.WebDAV.Endpoint = util.NormalizeEndpoint(Conf.Sync.WebDAV.Endpoint)
|
||||
Conf.Sync.WebDAV.Timeout = util.NormalizeTimeout(Conf.Sync.WebDAV.Timeout)
|
||||
if util.ContainerDocker == util.Container {
|
||||
Conf.Sync.Perception = false
|
||||
}
|
||||
|
||||
if nil == Conf.Api {
|
||||
Conf.Api = conf.NewAPI()
|
||||
|
|
|
|||
|
|
@ -372,6 +372,10 @@ func SetSyncEnable(b bool) {
|
|||
}
|
||||
|
||||
func SetSyncPerception(b bool) {
|
||||
if util.ContainerDocker == util.Container {
|
||||
b = false
|
||||
}
|
||||
|
||||
Conf.Sync.Perception = b
|
||||
Conf.Save()
|
||||
|
||||
|
|
@ -717,16 +721,16 @@ func connectSyncWebSocket() {
|
|||
reconnected := false
|
||||
for retries := 0; retries < 7; retries++ {
|
||||
time.Sleep(7 * time.Second)
|
||||
logging.LogWarnf("reconnecting sync websocket...")
|
||||
//logging.LogInfof("reconnecting sync websocket...")
|
||||
webSocketConn, dialErr = dialSyncWebSocket()
|
||||
if nil != dialErr {
|
||||
logging.LogWarnf("reconnect sync websocket failed: %s", dialErr)
|
||||
continue
|
||||
} else {
|
||||
logging.LogInfof("sync websocket reconnected")
|
||||
reconnected = true
|
||||
break
|
||||
}
|
||||
|
||||
logging.LogInfof("sync websocket reconnected")
|
||||
reconnected = true
|
||||
break
|
||||
}
|
||||
if !reconnected {
|
||||
logging.LogWarnf("reconnect sync websocket failed, do not retry")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue