mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Sign in to use S3/WebDAV data sync https://github.com/siyuan-note/siyuan/issues/8779
This commit is contained in:
parent
38f15e5f59
commit
fa6212a8b4
7 changed files with 76 additions and 10 deletions
|
|
@ -1234,6 +1234,7 @@
|
|||
"210": "Verifying cloud data %v/%v",
|
||||
"211": "Cloud data verification complete",
|
||||
"212": "There are some defects in the current version of cloud data sync, please upgrade to the latest version. Sorry for the inconvenience",
|
||||
"213": "Cloud verification failed, please try to upgrade to the latest version and log in again before syncing"
|
||||
"213": "Cloud verification failed, please try to upgrade to the latest version and log in again before syncing",
|
||||
"214": "This function needs to be logged in to use"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@
|
|||
"210": "Verificando datos en la nube %v/%v",
|
||||
"211": "Verificaci\u00f3n de datos en la nube completada",
|
||||
"212": "Hay algunos defectos en la versi\u00f3n actual de sincronizaci\u00f3n de datos en la nube, actualice a la versi\u00f3n m\u00e1s reciente. Disculpe las molestias",
|
||||
"213": "La verificaci\u00f3n en la nube fall\u00f3, intente actualizar a la versi\u00f3n m\u00e1s reciente e inicie sesi\u00f3n de nuevo antes de sincronizar"
|
||||
"213": "La verificaci\u00f3n en la nube fall\u00f3, intente actualizar a la versi\u00f3n m\u00e1s reciente e inicie sesi\u00f3n de nuevo antes de sincronizar",
|
||||
"214": "Esta función requiere iniciar sesión en la cuenta antes de poder usarla"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@
|
|||
"210": "Vérification des données cloud %v/%v",
|
||||
"211": "Vérification des données cloud terminée",
|
||||
"212": "Il y a quelques défauts dans la version actuelle de la synchronisation des données cloud, veuillez mettre à niveau vers la dernière version. Désolé pour le désagrément",
|
||||
"213": "Échec de la vérification cloud, veuillez essayer de mettre à niveau vers la dernière version et de vous reconnecter avant de synchroniser"
|
||||
"213": "Échec de la vérification cloud, veuillez essayer de mettre à niveau vers la dernière version et de vous reconnecter avant de synchroniser",
|
||||
"214": "La fonctionnalité nécessite un numéro de compte de connexion avant de pouvoir être utilisée"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@
|
|||
"210": "正在校驗雲端數據 %v/%v",
|
||||
"211": "校驗雲端數據完畢",
|
||||
"212": "當前版本雲端數據同步存在一些缺陷,請升級到最新版,帶來不便,敬請諒解",
|
||||
"213": "雲端校驗失敗,請嘗試升級到最新版並重新登錄後再進行同步"
|
||||
"213": "雲端校驗失敗,請嘗試升級到最新版並重新登錄後再進行同步",
|
||||
"214": "該功能需要登錄賬號後才能使用"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@
|
|||
"210": "正在校验云端数据 %v/%v",
|
||||
"211": "校验云端数据完毕",
|
||||
"212": "当前版本云端数据同步存在一些缺陷,请升级到最新版,带来不便,敬请谅解",
|
||||
"213": "云端校验失败,请尝试升级到最新版并重新登录后再进行同步"
|
||||
"213": "云端校验失败,请尝试升级到最新版并重新登录后再进行同步",
|
||||
"214": "该功能需要登录账号后才能使用"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -627,6 +627,19 @@ func DownloadCloudSnapshot(tag, id string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
if !IsSubscriber() {
|
||||
util.PushErrMsg(Conf.Language(29), 5000)
|
||||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
defer util.PushClearProgress()
|
||||
|
||||
var downloadFileCount, downloadChunkCount int
|
||||
|
|
@ -656,6 +669,19 @@ func UploadCloudSnapshot(tag, id string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
if !IsSubscriber() {
|
||||
util.PushErrMsg(Conf.Language(29), 5000)
|
||||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
util.PushEndlessProgress(Conf.Language(116))
|
||||
defer util.PushClearProgress()
|
||||
uploadFileCount, uploadChunkCount, uploadBytes, err := repo.UploadTagIndex(tag, id, map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
|
||||
|
|
@ -689,6 +715,19 @@ func RemoveCloudRepoTag(tag string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
if !IsSubscriber() {
|
||||
util.PushErrMsg(Conf.Language(29), 5000)
|
||||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
err = repo.RemoveCloudRepoTag(tag)
|
||||
if nil != err {
|
||||
return
|
||||
|
|
@ -708,6 +747,19 @@ func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
if !IsSubscriber() {
|
||||
util.PushErrMsg(Conf.Language(29), 5000)
|
||||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
logs, err := repo.GetCloudRepoTagLogs(map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar})
|
||||
if nil != err {
|
||||
return
|
||||
|
|
@ -731,6 +783,19 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount i
|
|||
return
|
||||
}
|
||||
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
if !IsSubscriber() {
|
||||
util.PushErrMsg(Conf.Language(29), 5000)
|
||||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if 1 > page {
|
||||
page = 1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,11 +234,7 @@ func checkSync(boot, exit, byHand bool) bool {
|
|||
if !IsSubscriber() {
|
||||
return false
|
||||
}
|
||||
case conf.ProviderWebDAV:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
return false
|
||||
}
|
||||
case conf.ProviderS3:
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsThirdPartySyncPaid() {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue