diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index dc79c89a9..4a1ec4f7e 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -917,8 +917,8 @@ "159": "Indexing data repo, getting the latest file %v", "160": "Indexing data repo, inserting file %v", "161": "Checking out of data repo, walking data %s", - "162": "Checking out data repo, inserting file %s", - "163": "Checking out data repo, deleting file %s", + "162": "Checking out data repo, inserting file %v", + "163": "Checking out data repo, deleting file %v", "164": "Downloading data repo snapshot %s", "165": "Downloading data repo file %v", "166": "Downloading data repo chunk %v", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 1c3c3ffb8..4fa21a7b1 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -917,8 +917,8 @@ "159": "Indexando repositorio de datos, obteniendo el último archivo %v", "160": "Indexando repositorio de datos, insertando archivo %v", "161": "Revisando el repositorio de datos, recorriendo datos %s", - "162": "Revisando el repositorio de datos, insertando el archivo %s", - "163": "Revisando el repositorio de datos, eliminando el archivo %s", + "162": "Revisando el repositorio de datos, insertando el archivo %v", + "163": "Revisando el repositorio de datos, eliminando el archivo %v", "164": "Descargando instantánea de repositorio de datos %s", "165": "Descargando archivo de repositorio de datos %v", "166": "Descargando parte de repositorio de datos %v", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 3b2f7d341..023b55bd1 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -917,8 +917,8 @@ "159": "Indexation du référentiel de données, obtention du dernier fichier %v", "160": "Indexation du référentiel de données, insertion du fichier %v", "161": "Vérification du référentiel de données, données piétonnes %s", - "162": "Vérification du référentiel de données, insertion du fichier %s", - "163": "Vérification du référentiel de données, suppression du fichier %s", + "162": "Vérification du référentiel de données, insertion du fichier %v", + "163": "Vérification du référentiel de données, suppression du fichier %v", "164": "Téléchargement du l'instantané du référentiel de données %s", "165": "Téléchargement du fichier de référentiel de données %v", "166": "Téléchargement du bloc de dépôt de données %v", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 8a6424afa..f9c3e3d2a 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -916,8 +916,8 @@ "159": "正在索引數據倉庫,獲取最新文件 %v", "160": "正在索引數據倉庫,插入文件 %v", "161": "正在遷出數據倉庫,遍歷數據 %s", - "162": "正在遷出數據倉庫,插入文件 %s", - "163": "正在遷出數據倉庫,刪除文件 %s", + "162": "正在遷出數據倉庫,插入文件 %v", + "163": "正在遷出數據倉庫,刪除文件 %v", "164": "正在下載數據倉庫快照 %s", "165": "正在下載數據倉庫文件 %v", "166": "正在下載數據倉庫分塊 %v", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index cd5023439..c48d21e02 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -918,8 +918,8 @@ "159": "正在索引数据仓库,获取最新文件 %v", "160": "正在索引数据仓库,插入文件 %v", "161": "正在迁出数据仓库,遍历数据 %s", - "162": "正在迁出数据仓库,插入文件 %s", - "163": "正在迁出数据仓库,删除文件 %s", + "162": "正在迁出数据仓库,插入文件 %v", + "163": "正在迁出数据仓库,删除文件 %v", "164": "正在下载数据仓库快照 %s", "165": "正在下载数据仓库文件 %v", "166": "正在下载数据仓库分块 %v", diff --git a/kernel/go.mod b/kernel/go.mod index 837f54134..1aa0cd887 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -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-20220717085949-1fcc8abe03a7 + github.com/siyuan-note/dejavu v0.0.0-20220718172206-7cf1bc791bdc 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 diff --git a/kernel/go.sum b/kernel/go.sum index 0068f460b..a551c97d2 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -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-20220717085949-1fcc8abe03a7 h1:fwArXZt5uFHIy7osjyn2iz+1j7gn4LEbCpcZDTdo+PE= -github.com/siyuan-note/dejavu v0.0.0-20220717085949-1fcc8abe03a7/go.mod h1:0VEmTSMPoFer5yCQ4ozkjC0YX1rpK7BEJ0IwXI2cqf0= +github.com/siyuan-note/dejavu v0.0.0-20220718172206-7cf1bc791bdc h1:zM32iRe7JPQVkzrQ/kRgJelmgJb5SST0w1S6Zxh70FA= +github.com/siyuan-note/dejavu v0.0.0-20220718172206-7cf1bc791bdc/go.mod h1:0VEmTSMPoFer5yCQ4ozkjC0YX1rpK7BEJ0IwXI2cqf0= 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= diff --git a/kernel/model/repository.go b/kernel/model/repository.go index 241eb3956..69095c8a4 100644 --- a/kernel/model/repository.go +++ b/kernel/model/repository.go @@ -643,19 +643,32 @@ func subscribeEvents() { contextPushMsg(context, msg) } }) + var bootProgressPart float64 + eventbus.Subscribe(dejavu.EvtCheckoutUpsertFiles, func(context map[string]interface{}, files []*entity.File) { + msg := fmt.Sprintf(Conf.Language(162), len(files)) + util.SetBootDetails(msg) + bootProgressPart = 10 / float64(len(files)) + contextPushMsg(context, msg) + }) eventbus.Subscribe(dejavu.EvtCheckoutUpsertFile, func(context map[string]interface{}, path string) { msg := fmt.Sprintf(Conf.Language(162), path) + util.IncBootProgress(bootProgressPart, msg) count++ if 0 == count%32 { - util.SetBootDetails(msg) contextPushMsg(context, msg) } }) + eventbus.Subscribe(dejavu.EvtCheckoutRemoveFiles, func(context map[string]interface{}, files []*entity.File) { + msg := fmt.Sprintf(Conf.Language(163), files) + util.SetBootDetails(msg) + bootProgressPart = 10 / float64(len(files)) + contextPushMsg(context, msg) + }) eventbus.Subscribe(dejavu.EvtCheckoutRemoveFile, func(context map[string]interface{}, path string) { msg := fmt.Sprintf(Conf.Language(163), path) + util.IncBootProgress(bootProgressPart, msg) count++ if 0 == count%32 { - util.SetBootDetails(msg) contextPushMsg(context, msg) } }) @@ -666,7 +679,6 @@ func subscribeEvents() { contextPushMsg(context, msg) }) - var bootProgressPart float64 eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadFiles, func(context map[string]interface{}, ids []string) { msg := fmt.Sprintf(Conf.Language(165), len(ids)) util.SetBootDetails(msg)