This commit is contained in:
Liang Ding 2022-07-19 01:28:46 +08:00
parent 43b0ee60cf
commit 20fe3affc1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 28 additions and 16 deletions

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-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

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-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=

View file

@ -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)