mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Support downloading cloud data snapshots to local on demand https://github.com/siyuan-note/siyuan/issues/8057
This commit is contained in:
parent
99407dcc1c
commit
566e26dcd9
1 changed files with 12 additions and 14 deletions
|
|
@ -392,12 +392,7 @@ func ImportRepoKey(base64Key string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
initDataRepo()
|
||||||
util.PushMsg(Conf.Language(138), 3000)
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
if initErr := IndexRepo("[Init] Init data repo"); nil != initErr {
|
|
||||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(140), initErr), 0)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -479,12 +474,7 @@ func InitRepoKeyFromPassphrase(passphrase string) (err error) {
|
||||||
Conf.Repo.Key = key
|
Conf.Repo.Key = key
|
||||||
Conf.Save()
|
Conf.Save()
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
initDataRepo()
|
||||||
util.PushMsg(Conf.Language(138), 3000)
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
if initErr := IndexRepo("[Init] Init data repo"); nil != initErr {
|
|
||||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(140), initErr), 0)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -520,13 +510,17 @@ func InitRepoKey() (err error) {
|
||||||
Conf.Repo.Key = key
|
Conf.Repo.Key = key
|
||||||
Conf.Save()
|
Conf.Save()
|
||||||
|
|
||||||
|
initDataRepo()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func initDataRepo() {
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
util.PushMsg(Conf.Language(138), 3000)
|
util.PushMsg(Conf.Language(138), 3000)
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
if initErr := IndexRepo("[Init] Init data repo"); nil != initErr {
|
if initErr := IndexRepo("[Init] Init local data repo"); nil != initErr {
|
||||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(140), initErr), 0)
|
util.PushErrMsg(fmt.Sprintf(Conf.Language(140), initErr), 0)
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckoutRepo(id string) {
|
func CheckoutRepo(id string) {
|
||||||
|
|
@ -691,6 +685,10 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount i
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 1 > page {
|
||||||
|
page = 1
|
||||||
|
}
|
||||||
|
|
||||||
logs, pageCount, totalCount, err := repo.GetCloudRepoLogs(page)
|
logs, pageCount, totalCount, err := repo.GetCloudRepoLogs(page)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue