🎨 Use Endpoint for network connectivity checks when syncing with third-party cloud providers https://github.com/siyuan-note/siyuan/issues/7805

This commit is contained in:
Liang Ding 2023-03-29 15:04:58 +08:00
parent c09c2a048f
commit 011ad83b6a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 15 additions and 10 deletions

View file

@ -1026,7 +1026,7 @@
"73": "Importing, please wait...",
"74": "The kernel has not been fully booted [%d%%], please try again later",
"75": "Attempt to access file failed",
"76": "TODO",
"76": "The network connectivity verification of the cloud storage service provider is abnormal, please check the network configuration",
"77": "Invalid dir path [%s]",
"78": "The old and new paths are repeated",
"79": "Only supports importing Markdown document",

View file

@ -1026,7 +1026,7 @@
"73": "Importando, por favor espere...",
"74": "El kernel no ha sido arrancado completamente [%d%%], por favor, inténtelo de nuevo más tarde",
"75": "Error al intentar acceder al archivo",
"76": "TODO",
"76": "La verificaci\u00f3n de conectividad de red del proveedor de servicios de almacenamiento en la nube es anormal, verifique la configuraci\u00f3n de red",
"77": "Ruta inválida [%s]",
"78": "Los viejos y nuevos caminos se repiten",
"79": "Sólo admite la importación de documentos Markdown",

View file

@ -1026,7 +1026,7 @@
"73": "En cours d'importation, veuillez patienter...",
"74": "Le kernel n'a pas été complètement démarré [%d%%], veuillez réessayer plus tard.",
"75": "La tentative d'accès au fichier a échoué",
"76": "TODO",
"76": "La vérification de la connectivité réseau du fournisseur de service de stockage cloud est anormale, veuillez vérifier la configuration réseau",
"77": "Chemin d'accès invalide [%s]",
"78": "Les anciens et les nouveaux chemins sont répétés",
"79": "Prise en charge de l'importation de documents Markdown uniquement",

View file

@ -1026,7 +1026,7 @@
"73": "正在導入,請稍等...",
"74": "kernel尚未完全啟動 [%d%%],請稍後再試",
"75": "嘗試訪問資料檔失敗",
"76": "TODO",
"76": "雲端存儲服務提供商網絡連通性校驗異常,請檢查網絡配置",
"77": "不可用的目錄路徑 [%s]",
"78": "新老路徑重複",
"79": "僅支援導入 Markdown 文檔",

View file

@ -1026,7 +1026,7 @@
"73": "正在导入,请稍等...",
"74": "内核尚未完全启动 [%d%%],请稍后再试",
"75": "尝试访问文件失败",
"76": "TODO",
"76": "云端存储服务提供商网络连通性校验异常,请检查网络配置",
"77": "不可用的目录路径 [%s]",
"78": "新老路径重复",
"79": "仅支持导入 Markdown 文档",

View file

@ -566,15 +566,20 @@ func planSyncAfter(d time.Duration) {
syncPlanTime = time.Now().Add(d)
}
func isProviderOnline() bool {
func isProviderOnline() (ret bool) {
switch Conf.Sync.Provider {
case conf.ProviderSiYuan:
return util.IsOnline(util.SiYuanSyncServer)
ret = util.IsOnline(util.SiYuanSyncServer)
case conf.ProviderS3:
return util.IsOnline(Conf.Sync.S3.Endpoint)
ret = util.IsOnline(Conf.Sync.S3.Endpoint)
case conf.ProviderWebDAV:
return util.IsOnline(Conf.Sync.WebDAV.Endpoint)
ret = util.IsOnline(Conf.Sync.WebDAV.Endpoint)
default:
return util.IsOnline("")
ret = util.IsOnline("")
}
if !ret {
util.PushErrMsg(Conf.Language(76), 5000)
}
return
}