mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -1768,6 +1768,7 @@
|
||||
"282": "إغلاق النافذة",
|
||||
"283": "كلمة المرور",
|
||||
"284": "الوصول محظور",
|
||||
"285": "كلمة المرور غير صحيحة"
|
||||
"285": "كلمة المرور غير صحيحة",
|
||||
"286": "[%s] تم التراجع عنه بالفعل"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Fenster schließen",
|
||||
"283": "Passwort",
|
||||
"284": "Zugriff verweigert",
|
||||
"285": "Passwort ist falsch"
|
||||
"285": "Passwort ist falsch",
|
||||
"286": "[%s] wurde bereits zurückgesetzt"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Close window",
|
||||
"283": "Password",
|
||||
"284": "Access denied",
|
||||
"285": "Password is incorrect"
|
||||
"285": "Password is incorrect",
|
||||
"286": "[%s] has already been rolled back"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Cerrar ventana",
|
||||
"283": "Contraseña",
|
||||
"284": "Acceso denegado",
|
||||
"285": "La contraseña es incorrecta"
|
||||
"285": "La contraseña es incorrecta",
|
||||
"286": "[%s] ya ha sido revertido"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Fermer la fenêtre",
|
||||
"283": "Mot de passe",
|
||||
"284": "Accès refusé",
|
||||
"285": "Le mot de passe est incorrect"
|
||||
"285": "Le mot de passe est incorrect",
|
||||
"286": "[%s] a déjà été restauré"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "סגור חלון",
|
||||
"283": "סיסמה",
|
||||
"284": "הגישה אסורה",
|
||||
"285": "הסיסמה שגויה"
|
||||
"285": "הסיסמה שגויה",
|
||||
"286": "[%s] כבר הוחזר"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Chiudi finestra",
|
||||
"283": "Password",
|
||||
"284": "Accesso negato",
|
||||
"285": "La password è errata"
|
||||
"285": "La password è errata",
|
||||
"286": "[%s] è già stato ripristinato"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "ウィンドウを閉じる",
|
||||
"283": "パスワード",
|
||||
"284": "アクセスが禁止されています",
|
||||
"285": "パスワードが正しくありません"
|
||||
"285": "パスワードが正しくありません",
|
||||
"286": "[%s] は既にロールバックされました"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "창 닫기",
|
||||
"283": "비밀번호",
|
||||
"284": "접근 금지됨",
|
||||
"285": "비밀번호가 올바르지 않습니다"
|
||||
"285": "비밀번호가 올바르지 않습니다",
|
||||
"286": "[%s] 이미 롤백되었습니다"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Zamknij okno",
|
||||
"283": "Hasło",
|
||||
"284": "Dostęp zabroniony",
|
||||
"285": "Hasło jest nieprawidłowe"
|
||||
"285": "Hasło jest nieprawidłowe",
|
||||
"286": "[%s] został cofnięty"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Fechar janela",
|
||||
"283": "Senha",
|
||||
"284": "Acesso negado",
|
||||
"285": "A senha está incorreta"
|
||||
"285": "A senha está incorreta",
|
||||
"286": "[%s] já foi revertido"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Закрыть окно",
|
||||
"283": "Пароль",
|
||||
"284": "Доступ запрещён",
|
||||
"285": "Пароль неверный"
|
||||
"285": "Пароль неверный",
|
||||
"286": "[%s] уже откатён"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Zavrieť okno",
|
||||
"283": "Heslo",
|
||||
"284": "Prístup zakázaný",
|
||||
"285": "Nesprávne heslo"
|
||||
"285": "Nesprávne heslo",
|
||||
"286": "[%s] bol vrátený"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "Pencereyi Kapat",
|
||||
"283": "Şifre",
|
||||
"284": "Erişim yasaklandı",
|
||||
"285": "Şifre yanlış"
|
||||
"285": "Şifre yanlış",
|
||||
"286": "[%s] geri alındı"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "關閉視窗",
|
||||
"283": "密碼",
|
||||
"284": "禁止訪問",
|
||||
"285": "密碼不正確"
|
||||
"285": "密碼不正確",
|
||||
"286": "[%s] 已經回滾完畢"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1768,6 +1768,7 @@
|
||||
"282": "关闭窗口",
|
||||
"283": "密码",
|
||||
"284": "禁止访问",
|
||||
"285": "密码不正确"
|
||||
"285": "密码不正确",
|
||||
"286": "[%s] 已经回滚完毕"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,9 +240,11 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
||||
rootID := util.GetTreeID(historyPath)
|
||||
workingDoc := treenode.GetBlockTree(rootID)
|
||||
if nil != workingDoc && "d" == workingDoc.Type {
|
||||
if err = filelock.Remove(filepath.Join(util.DataDir, boxID, workingDoc.Path)); err != nil {
|
||||
workingDocPath := filepath.Join(util.DataDir, boxID, workingDoc.Path)
|
||||
if err = filelock.Remove(workingDocPath); err != nil {
|
||||
return
|
||||
}
|
||||
logging.LogInfof("removed working doc file [%s]", workingDocPath)
|
||||
}
|
||||
|
||||
destPath, parentHPath, err = getRollbackDockPath(boxID, historyPath, workingDoc)
|
||||
@@ -319,8 +321,12 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
||||
}
|
||||
ReloadFiletree()
|
||||
ReloadProtyle(rootID)
|
||||
util.PushMsg(Conf.Language(102), 3000)
|
||||
|
||||
msg := fmt.Sprintf(Conf.Language(286), destPath)
|
||||
if box := Conf.GetBox(boxID); nil != box {
|
||||
msg = fmt.Sprintf(Conf.Language(286), path.Join(box.Name, tree.HPath))
|
||||
}
|
||||
util.PushMsg(msg, 3000)
|
||||
IncSync()
|
||||
|
||||
// 刷新属性视图
|
||||
|
||||
+23
-10
@@ -222,12 +222,6 @@ func RollbackRepoSnapshotFile(fileID string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
to := filepath.Join(util.DataDir, file.Path)
|
||||
if err = filelock.CopyNewtimes(from, to); nil != err {
|
||||
logging.LogErrorf("copy file [%s] to [%s] failed: %s", from, to, err)
|
||||
return
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Path, ".sy") {
|
||||
var destPath, parentHPath string
|
||||
rootID := util.GetTreeID(file.Path)
|
||||
@@ -239,9 +233,9 @@ func RollbackRepoSnapshotFile(fileID string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
tree, _ := loadTree(to, util.NewLute())
|
||||
tree, _ := loadTree(from, util.NewLute())
|
||||
if nil == tree {
|
||||
msg := fmt.Sprintf("no such file or directory: %s", to)
|
||||
msg := fmt.Sprintf("no such file or directory: %s", from)
|
||||
logging.LogErrorf(msg)
|
||||
err = errors.New(msg)
|
||||
return
|
||||
@@ -250,7 +244,13 @@ func RollbackRepoSnapshotFile(fileID string) (err error) {
|
||||
tree.Box = boxID
|
||||
tree.Path = filepath.ToSlash(strings.TrimPrefix(destPath, util.DataDir+string(os.PathSeparator)+boxID))
|
||||
tree.HPath = parentHPath + "/" + tree.Root.IALAttr("title")
|
||||
|
||||
if nil != workingDoc && "d" == workingDoc.Type {
|
||||
workingDocPath := filepath.Join(util.DataDir, boxID, workingDoc.Path)
|
||||
if err = filelock.Remove(workingDocPath); err != nil {
|
||||
return
|
||||
}
|
||||
logging.LogInfof("removed working doc file [%s]", workingDocPath)
|
||||
}
|
||||
if nil != workingDoc {
|
||||
treenode.RemoveBlockTreesByRootID(rootID)
|
||||
}
|
||||
@@ -261,10 +261,23 @@ func RollbackRepoSnapshotFile(fileID string) (err error) {
|
||||
}
|
||||
ReloadFiletree()
|
||||
ReloadProtyle(rootID)
|
||||
|
||||
if box := Conf.GetBox(boxID); nil != box {
|
||||
msg := fmt.Sprintf(Conf.Language(286), path.Join(box.Name, tree.HPath))
|
||||
util.PushMsg(msg, 7000)
|
||||
}
|
||||
} else {
|
||||
to := filepath.Join(util.DataDir, file.Path)
|
||||
if err = filelock.CopyNewtimes(from, to); nil != err {
|
||||
logging.LogErrorf("copy file [%s] to [%s] failed: %s", from, to, err)
|
||||
return
|
||||
}
|
||||
|
||||
msg := fmt.Sprintf(Conf.Language(286), to)
|
||||
util.PushMsg(msg, 3000)
|
||||
}
|
||||
|
||||
IncSync()
|
||||
util.PushMsg(Conf.Language(102), 3000)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user