🎨 改进云端数据同步

This commit is contained in:
Liang Ding 2022-07-17 00:47:45 +08:00
parent 412f6d0303
commit 3d514b6d31
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 18 additions and 14 deletions

View file

@ -778,7 +778,7 @@
"20": "Cannot be converted to heading when including sub-documents",
"21": "Please enter the captcha",
"22": "The captcha is incorrect",
"23": "TODO",
"23": "The data repo is damaged due to external changes (such as using a third-party real-time synchronization disk), please reset the data repo",
"24": "TODO",
"25": "The attribute name only supports English letters and digits",
"26": "Please initialize the data repo key first in [Settings - About - Data repo key]",
@ -839,7 +839,7 @@
"81": "Syncing data...",
"82": "Synced at %s",
"83": "The access authorization code is incorrect",
"84": "The metadata used for synchronization has been damaged, please refer to <a href=\"https://ld246.com/article/1627822637525\" target=\"_blank\">here</a> to resolve",
"84": "Backup failed: %s",
"85": "The file is occupied by other programs. Do not use the system file manager to open the workspace folder during operation; do not use a third-party real-time synchronization disk and check whether the workspace folder has write permissions",
"86": "Please configure [Settings - About - Access authorization code]",
"87": "Cannot move to this location",

View file

@ -778,7 +778,7 @@
"20": "No se puede convertir en título al incluir subdocumentos",
"21": "Por favor ingrese el captcha",
"22": "El captcha es incorrecto",
"23": "TODO",
"23": "El repositorio de datos está dañado debido a cambios externos (como el uso de un disco de sincronización en tiempo real de terceros), restablezca el repositorio de datos",
"24": "TODO",
"25": "El nombre del atributo sólo admite letras y dígitos en inglés",
"26": "Por favor, inicialice primero la clave de repositorio de datos en [Configuración - Acerca de - Clave de repositorio de datos]",
@ -839,7 +839,7 @@
"81": "Sincronizando datos...",
"82": "Sincronizado en %s",
"83": "El código de autorización de acceso es incorrecto",
"84": "Los metadatos utilizados para la sincronización se han dañado, consulte <a href=\"https://ld246.com/article/1627822637525\" target=\"_blank\">aquí</a> para resolver",
"84": "Copia de seguridad fallida: %s",
"85": "El archivo está ocupado por otros programas. No utilice el administrador de archivos del sistema para abrir la carpeta del área de trabajo durante el funcionamiento; no utilice un disco de sincronización en tiempo real de terceros y compruebe si la carpeta del área de trabajo tiene permisos de escritura",
"86": "Por favor, configure [Configuración - Acerca de - Código de autorización de acceso]",
"87": "No se puede mover a esta ubicación",

View file

@ -778,7 +778,7 @@
"20": "Ne peut pas être converti en titre lorsque des sous-documents sont inclus.",
"21": "Veuillez entrer le captcha",
"22": "Le captcha est incorrect",
"23": "TODO",
"23": "Le référentiel de données est endommagé en raison de modifications externes (comme l'utilisation d'un disque de synchronisation en temps réel tiers), veuillez réinitialiser le référentiel de données",
"24": "TODO",
"25": "Le nom de l'attribut ne supporte que les lettres et les chiffres anglais.",
"26": "Veuillez d'abord initialiser la clé du référentiel de données dans [Paramètres - À propos - Clé du référentiel de données]",
@ -839,7 +839,7 @@
"81": "Synchronisation des données...",
"82": "Synchronisé à %s",
"83": "Le code d'autorisation d'accès est incorrect",
"84": "Les métadonnées utilisées pour la synchronisation ont été endommagées, veuillez vous référer à <a href=\"https://ld246.com/article/1627822637525\" target=\"_blank\">ici</a> pour les résoudre.",
"84": "Échec de la sauvegarde : %s",
"85": "Le fichier est occupé par d'autres programmes. N'utilisez pas le gestionnaire de fichiers système pour ouvrir le dossier de l'espace de travail pendant le fonctionnement ; n'utilisez pas de disque de synchronisation en temps réel tiers et vérifiez si le dossier de l'espace de travail dispose des autorisations d'écriture",
"86": "Veuillez configurer [Paramètres - A propos de - Code d'autorisation d'accès]",
"87": "Impossible de se déplacer vers cet endroit",

View file

@ -778,7 +778,7 @@
"20": "包含子文檔時無法轉換為標題",
"21": "請輸入驗證碼",
"22": "驗證碼不正確",
"23": "TODO",
"23": "數據倉庫因為外部變更損壞(比如使用第三方實時同步盤),請重置數據倉庫",
"24": "TODO",
"25": "屬性名僅支援英文字母和阿拉伯數字",
"26": "請先在 [設置 - 關於 - 數據倉庫密鑰] 中初始化數據倉庫密鑰",
@ -839,7 +839,7 @@
"81": "數據同步中...",
"82": "同步於 %s",
"83": "存取授權碼不正確",
"84": "用於同步的中繼資料已被損壞,請參考 <a href=\"https://ld246.com/article/1627822637525\" target=\"_blank\">這裡</a> 進行解決",
"84": "備份失敗:%s",
"85": "檔被其他程式佔用。運行期間請勿使用系統文件管理器打開工作空間文件夾;請勿使用第三方實時同步碟並檢查工作空間文件夾是否有寫入權限",
"86": "請先配置 [設置 - 關於 - 存取授權碼]",
"87": "無法移動到該位置",

View file

@ -779,7 +779,7 @@
"20": "包含子文档时无法转换为标题",
"21": "请输入验证码",
"22": "验证码不正确",
"23": "TODO",
"23": "数据仓库因为外部变更损坏(比如使用第三方实时同步盘),请重置数据仓库",
"24": "TODO",
"25": "属性名仅支持英文字母和阿拉伯数字",
"26": "请先在 [设置 - 关于 - 数据仓库密钥] 中初始化数据仓库密钥",
@ -840,7 +840,7 @@
"81": "数据同步中...",
"82": "同步于 %s",
"83": "访问授权码不正确",
"84": "用于同步的元数据已被损坏,请参考 <a href=\"https://ld246.com/article/1627822637525\" target=\"_blank\">这里</a> 进行解决",
"84": "备份失败:%s",
"85": "文件被其他程序占用。运行期间请勿使用系统文件管理器打开工作空间文件夹;请勿使用第三方实时同步盘并检查工作空间文件夹是否有写入权限",
"86": "请先配置 [设置 - 关于 - 访问授权码]",
"87": "无法移动到该位置",

View file

@ -39,7 +39,7 @@ require (
github.com/panjf2000/ants/v2 v2.5.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/radovskyb/watcher v1.0.7
github.com/siyuan-note/dejavu v0.0.0-20220716091807-656dabf873a2
github.com/siyuan-note/dejavu v0.0.0-20220716164152-fe0371110dcb
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f
github.com/siyuan-note/filelock v0.0.0-20220704090116-54dfb035283f

View file

@ -514,8 +514,8 @@ github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYED
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/siyuan-note/dejavu v0.0.0-20220716091807-656dabf873a2 h1:cTMm2dWIs5Er68NWWY+IyK2UA4gG6+GeLEiA6R97F6Q=
github.com/siyuan-note/dejavu v0.0.0-20220716091807-656dabf873a2/go.mod h1:cri+XyZAqmK5fJ98En9aOHB+YkuU8+XQcJdQ31EUhis=
github.com/siyuan-note/dejavu v0.0.0-20220716164152-fe0371110dcb h1:2E/kpgD8QXdu9vaN/1clMatxOcmqd6al6oQ7QRW6ORI=
github.com/siyuan-note/dejavu v0.0.0-20220716164152-fe0371110dcb/go.mod h1:cri+XyZAqmK5fJ98En9aOHB+YkuU8+XQcJdQ31EUhis=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f h1:JMobMNZ7AqaKKyEK+WeWFhix/2TDQXgPZDajU00IybU=

View file

@ -253,8 +253,10 @@ func UploadCloudSnapshot(tag, id string) (err error) {
uploadFileCount, uploadChunkCount, uploadBytes, err := repo.UploadTagIndex(tag, id, cloudInfo, map[string]interface{}{dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBarAndProgress})
if nil != err {
if errors.Is(err, dejavu.ErrCloudBackupCountExceeded) {
err = errors.New(Conf.Language(154))
err = fmt.Errorf(Conf.Language(84), Conf.Language(154))
return
}
err = errors.New(fmt.Sprintf(Conf.Language(84), formatErrorMsg(err)))
return
}
msg := fmt.Sprintf(Conf.Language(152), uploadFileCount, uploadChunkCount, humanize.Bytes(uint64(uploadBytes)))

View file

@ -296,6 +296,8 @@ func formatErrorMsg(err error) string {
msg = Conf.Language(85) + " " + err.Error()
} else if strings.Contains(msg, "cipher: message authentication failed") {
msg = Conf.Language(172) + " " + err.Error()
} else if strings.Contains(msg, "repo fatal error") {
msg = Conf.Language(23) + " " + err.Error()
}
msg = msg + " v" + util.Ver
return msg