🎨 分屏

This commit is contained in:
Liang Ding 2022-07-04 11:22:19 +08:00
parent 310c5f7042
commit e12c004036
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 31 additions and 14 deletions

View file

@ -911,6 +911,7 @@
"146": "Failed to reset data repository: %s",
"147": "Created a new data snapshot, took %.2fs",
"148": "Checked the data snapshot and found no changes",
"149": "Data snapshot has been synchronized, took %.2fs"
"149": "Data snapshot has been synchronized, took %.2fs",
"150": "Uploaded files %d\nDownloaded files %d\nUploaded chunks %d\nDownloaded chunks %d\nSent bytes %s\nReceived bytes %s\n"
}
}

View file

@ -911,6 +911,7 @@
"146": "Fallo en el restablecimiento del repositorio de datos: %s",
"147": "Creó una nueva instantánea de datos, tomó %.2fs",
"148": "Se ha comprobado la instantánea de los datos y no se encontro ningún cambio",
"149": "La instantánea de datos ha sido sincronizada, ha tomado %.2fs"
"149": "La instantánea de datos ha sido sincronizada, ha tomado %.2fs",
"150": "Archivos cargados %d\nArchivos descargados %d\nPorciones cargadas %d\nPorciones descargadas %d\nBytes enviados %s\nBytes recibidos %s\n"
}
}

View file

@ -911,6 +911,7 @@
"146": "Échec de la réinitialisation du référentiel de données : %s",
"147": "Créé un nouvel instantané de données, a pris %.2fs",
"148": "Vérifié l'instantané des données et n'a trouvé aucun changement",
"149": "L'instantané des données a été synchronisé, a pris %.2fs"
"149": "L'instantané des données a été synchronisé, a pris %.2fs",
"150": "Fichiers téléchargés %d\nFichiers téléchargés %d\nBlocs téléchargés %d\nBlocs téléchargés %d\nOctets envoyés %s\nOctets reçus %s\n"
}
}

View file

@ -910,6 +910,7 @@
"146": "重置數據倉庫失敗:%s",
"147": "創建了一個新的數據快照,耗時 %.2fs",
"148": "檢查數據快照,沒有發現任何變化",
"149": "已經同步數據快照,耗時 %.2fs"
"149": "已經同步數據快照,耗時 %.2fs",
"150": "上傳文件 %d\n下載文件 %d\n上傳分塊 %d\n下載分塊 %d\n發送字節數 %s\n接收字節數 %s\n"
}
}

View file

@ -912,6 +912,7 @@
"146": "重置数据仓库失败:%s",
"147": "创建了一个新的数据快照,耗时 %.2fs",
"148": "检查数据快照,没有发现任何变化",
"149": "已经同步数据快照,耗时 %.2fs"
"149": "已经同步数据快照,耗时 %.2fs",
"150": "上传文件 %d\n下载文件 %d\n上传分块 %d\n下载分块 %d\n发送字节数 %s\n接收字节数 %s\n"
}
}

View file

@ -40,7 +40,7 @@ require (
github.com/qiniu/go-sdk/v7 v7.13.0
github.com/radovskyb/watcher v1.0.7
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/siyuan-note/dejavu v0.0.0-20220704005630-2c6fc0ab7992
github.com/siyuan-note/dejavu v0.0.0-20220704031858-e4eee44034c8
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f
github.com/siyuan-note/filelock v0.0.0-20220616063212-74cfba0754ee

View file

@ -421,8 +421,8 @@ github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJ
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/siyuan-note/dejavu v0.0.0-20220704005630-2c6fc0ab7992 h1:cVr7UqNcz1kq3Z435SIg8pqj/2xq62qHo1gxk4faw48=
github.com/siyuan-note/dejavu v0.0.0-20220704005630-2c6fc0ab7992/go.mod h1:0t+TpAdsrrv+6LkhDlJY2Gl92CQexgp8KWOBp5Ah9kU=
github.com/siyuan-note/dejavu v0.0.0-20220704031858-e4eee44034c8 h1:nPbcb+ZAbsqgE2q69wMmWQ/oNDOqPRaH5e2POrcSG6E=
github.com/siyuan-note/dejavu v0.0.0-20220704031858-e4eee44034c8/go.mod h1:0t+TpAdsrrv+6LkhDlJY2Gl92CQexgp8KWOBp5Ah9kU=
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676 h1:QB9TjJQFhXhZ6dAtPpY02DlzHAQm1C+WqZq6OadG8mI=
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f h1:JMobMNZ7AqaKKyEK+WeWFhix/2TDQXgPZDajU00IybU=

View file

@ -249,7 +249,7 @@ const (
CtxPushMsgToStatusBarAndProgress
)
func syncRepo(byHand bool) {
func syncRepo(boot, exit, byHand bool) {
if 1 > len(Conf.Repo.Key) {
msg := Conf.Language(26)
util.PushStatusBar(msg)
@ -284,21 +284,33 @@ func syncRepo(byHand bool) {
Server: util.AliyunServer,
}
syncContext := map[string]interface{}{CtxPushMsg: CtxPushMsgToStatusBar}
latest, mergeUpserts, mergeRemoves, _, err := repo.Sync(cloudInfo, syncContext)
_, mergeUpserts, mergeRemoves, _,
uploadFileCount, uploadChunkCount, downloadFileCount, downloadChunkCount,
uploadBytes, downloadBytes, err := repo.Sync(cloudInfo, syncContext)
elapsed := time.Since(start)
util.LogInfof("sync data repo elapsed [%.2fs], latest [%s]", elapsed.Seconds(), latest.ID)
if nil != err {
util.LogErrorf("sync data repo failed: %s", err)
msg := "Sync data repo failed: " + err.Error()
msg := fmt.Sprintf(Conf.Language(80), formatErrorMsg(err))
if errors.Is(err, dejavu.ErrSyncCloudStorageSizeExceeded) {
msg = fmt.Sprintf(Conf.Language(43), byteCountSI(int64(Conf.User.UserSiYuanRepoSize)))
}
Conf.Sync.Stat = msg
util.PushStatusBar(msg)
util.PushErrMsg(msg, 0)
if boot {
BootSyncSucc = 1
}
if exit {
ExitSyncSucc = 1
}
return
}
util.PushStatusBar(fmt.Sprintf(Conf.Language(149), elapsed.Seconds()))
Conf.Sync.Synced = util.CurrentTimeMillis()
msg := fmt.Sprintf(Conf.Language(150), uploadFileCount, uploadChunkCount, downloadFileCount, downloadChunkCount, byteCountSI(uploadBytes), byteCountSI(downloadBytes))
Conf.Sync.Stat = msg
if 1 > len(mergeUpserts) && 1 > len(mergeRemoves) { // 没有数据变更
syncSameCount++
@ -343,7 +355,7 @@ func indexRepoBeforeCloudSync(repo *dejavu.Repo) (err error) {
CtxPushMsg: CtxPushMsgToStatusBar,
})
if nil != err {
util.PushStatusBar(Conf.Language(140))
util.PushStatusBar(fmt.Sprintf(Conf.Language(140), err))
util.LogErrorf("index data repo before cloud sync failed: %s", err)
return
}

View file

@ -132,7 +132,7 @@ func SyncData(boot, exit, byHand bool) {
defer syncLock.Unlock()
if Conf.Sync.UseDataRepo {
syncRepo(byHand)
syncRepo(boot, exit, byHand)
return
}