Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-06-25 23:47:43 +08:00
commit c78ac2edc2
5 changed files with 67 additions and 66 deletions

View file

@ -4,7 +4,7 @@
"Properties": { "Properties": {
"id": "20210615213222-vs5tzbd", "id": "20210615213222-vs5tzbd",
"title": "Data history", "title": "Data history",
"updated": "20220615120852" "updated": "20220625231856"
}, },
"Children": [ "Children": [
{ {
@ -552,7 +552,7 @@
"ListData": {}, "ListData": {},
"Properties": { "Properties": {
"id": "20220501135308-3azjqzh", "id": "20220501135308-3azjqzh",
"updated": "20220615120419" "updated": "20220625231844"
}, },
"Children": [ "Children": [
{ {
@ -564,7 +564,7 @@
}, },
"Properties": { "Properties": {
"id": "20220501135308-itmzgsj", "id": "20220501135308-itmzgsj",
"updated": "20220615120419" "updated": "20220625231844"
}, },
"Children": [ "Children": [
{ {
@ -572,12 +572,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220501135308-yvsiton", "id": "20220501135308-yvsiton",
"updated": "20220615120419" "updated": "20220625231844"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "At the top " "Data": "Click the "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -588,7 +588,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "Data History"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -597,7 +597,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " menu or " "Data": " button on the top toolbar or "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1400,7 +1400,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615120602-5r3nl34", "id": "20220615120602-5r3nl34",
"updated": "20220615120840" "updated": "20220625231856"
}, },
"Children": [ "Children": [
{ {
@ -1414,7 +1414,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615120602-a20qin2", "id": "20220615120602-a20qin2",
"updated": "20220615120602" "updated": "20220625231856"
}, },
"Children": [ "Children": [
{ {
@ -1422,12 +1422,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220615120602-k0xs8n5", "id": "20220615120602-k0xs8n5",
"updated": "20220615120602" "updated": "20220625231856"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "On the top " "Data": "Click the "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1438,7 +1438,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "Data History"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -1447,7 +1447,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " menu or " "Data": " button on the top toolbar or "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",

View file

@ -4,7 +4,7 @@
"Properties": { "Properties": {
"id": "20210615211733-v6rzowm", "id": "20210615211733-v6rzowm",
"title": "数据历史", "title": "数据历史",
"updated": "20220615120214" "updated": "20220625231706"
}, },
"Children": [ "Children": [
{ {
@ -572,7 +572,7 @@
"ListData": {}, "ListData": {},
"Properties": { "Properties": {
"id": "20210104090742-8rmcz3i", "id": "20210104090742-8rmcz3i",
"updated": "20220615112450" "updated": "20220625231706"
}, },
"Children": [ "Children": [
{ {
@ -584,7 +584,7 @@
}, },
"Properties": { "Properties": {
"id": "20220501135052-k47n4ms", "id": "20220501135052-k47n4ms",
"updated": "20220615112450" "updated": "20220625231706"
}, },
"Children": [ "Children": [
{ {
@ -592,12 +592,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220501135052-o3r30jj", "id": "20220501135052-o3r30jj",
"updated": "20220615112450" "updated": "20220625231706"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "在顶部 " "Data": "点击顶部工具栏 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -608,7 +608,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "数据历史"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -617,7 +617,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " 菜单或者 " "Data": " 按钮或者 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1420,7 +1420,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615112933-zoh8iyg", "id": "20220615112933-zoh8iyg",
"updated": "20220615120214" "updated": "20220625231649"
}, },
"Children": [ "Children": [
{ {
@ -1434,7 +1434,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615114246-9or7h68", "id": "20220615114246-9or7h68",
"updated": "20220615114246" "updated": "20220625231649"
}, },
"Children": [ "Children": [
{ {
@ -1442,12 +1442,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220615114246-lr3ydl0", "id": "20220615114246-lr3ydl0",
"updated": "20220615114250" "updated": "20220625231649"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "在顶部 " "Data": "点击顶部工具栏 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1458,7 +1458,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "数据历史"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -1467,7 +1467,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " 菜单或者 " "Data": " 按钮或者 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",

View file

@ -4,7 +4,7 @@
"Properties": { "Properties": {
"id": "20211226122707-8cr09co", "id": "20211226122707-8cr09co",
"title": "數據歷史", "title": "數據歷史",
"updated": "20220615120430" "updated": "20220625231923"
}, },
"Children": [ "Children": [
{ {
@ -552,7 +552,7 @@
"ListData": {}, "ListData": {},
"Properties": { "Properties": {
"id": "20220501135134-lh5drjl", "id": "20220501135134-lh5drjl",
"updated": "20220615120430" "updated": "20220625231918"
}, },
"Children": [ "Children": [
{ {
@ -564,7 +564,7 @@
}, },
"Properties": { "Properties": {
"id": "20220501135134-nkzl4wl", "id": "20220501135134-nkzl4wl",
"updated": "20220615120430" "updated": "20220625231918"
}, },
"Children": [ "Children": [
{ {
@ -572,12 +572,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220501135134-n7t2zfn", "id": "20220501135134-n7t2zfn",
"updated": "20220615120430" "updated": "20220625231918"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "在頂部 " "Data": "點擊頂部工具欄 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -588,7 +588,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "數據歷史"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -597,7 +597,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " 菜單或者 " "Data": " 按鈕或者 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1400,7 +1400,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615120134-rfk9khd", "id": "20220615120134-rfk9khd",
"updated": "20220615120216" "updated": "20220625231923"
}, },
"Children": [ "Children": [
{ {
@ -1414,7 +1414,7 @@
}, },
"Properties": { "Properties": {
"id": "20220615120134-1uthigi", "id": "20220615120134-1uthigi",
"updated": "20220615120134" "updated": "20220625231923"
}, },
"Children": [ "Children": [
{ {
@ -1422,12 +1422,12 @@
"Type": "NodeParagraph", "Type": "NodeParagraph",
"Properties": { "Properties": {
"id": "20220615120134-7n3iucn", "id": "20220615120134-7n3iucn",
"updated": "20220615120134" "updated": "20220625231923"
}, },
"Children": [ "Children": [
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "在頂部 " "Data": "點擊頂部工具欄 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",
@ -1438,7 +1438,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": "..." "Data": "數據歷史"
}, },
{ {
"Type": "NodeKbdCloseMarker" "Type": "NodeKbdCloseMarker"
@ -1447,7 +1447,7 @@
}, },
{ {
"Type": "NodeText", "Type": "NodeText",
"Data": " 菜單或者 " "Data": " 按鈕或者 "
}, },
{ {
"Type": "NodeKbd", "Type": "NodeKbd",

View file

@ -286,16 +286,16 @@ const initBar = () => {
<use xlink:href="#iconMoon"></use> <use xlink:href="#iconMoon"></use>
</svg> </svg>
</div> </div>
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__se${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
<svg>
<use xlink:href="#iconSettings"></use>
</svg>
</div>
<div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.history.custom)}"> <div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.history.custom)}">
<svg> <svg>
<use xlink:href="#iconVideo"></use> <use xlink:href="#iconVideo"></use>
</svg> </svg>
</div> </div>
<div id="barSetting" class="toolbar__item b3-tooltips b3-tooltips__se${window.siyuan.config.readonly ? " fn__none" : ""}" aria-label="${window.siyuan.languages.config} ${updateHotkeyTip(window.siyuan.config.keymap.general.config.custom)}">
<svg>
<use xlink:href="#iconSettings"></use>
</svg>
</div>
<div id="barDebug" class="toolbar__item b3-tooltips b3-tooltips__se fn__none" aria-label="${window.siyuan.languages.debug}"> <div id="barDebug" class="toolbar__item b3-tooltips b3-tooltips__se fn__none" aria-label="${window.siyuan.languages.debug}">
<svg> <svg>
<use xlink:href="#iconBug"></use> <use xlink:href="#iconBug"></use>

View file

@ -35,7 +35,7 @@ import (
func init() { func init() {
eventbus.Subscribe(dejavu.EvtIndexWalkData, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtIndexWalkData, func(context map[string]interface{}, path string) {
msg := "Indexing repo [walk data " + path + "]" msg := "Indexing data repository [walk data " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -49,7 +49,7 @@ func init() {
} }
}) })
eventbus.Subscribe(dejavu.EvtIndexGetLatestFile, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtIndexGetLatestFile, func(context map[string]interface{}, path string) {
msg := "Indexing repo [get latest file " + path + "]" msg := "Indexing data repository [get latest file " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -63,7 +63,7 @@ func init() {
} }
}) })
eventbus.Subscribe(dejavu.EvtIndexUpsertFile, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtIndexUpsertFile, func(context map[string]interface{}, path string) {
msg := "Indexing repo [upsert file " + path + "]" msg := "Indexing data repository [upsert file " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -78,7 +78,7 @@ func init() {
}) })
eventbus.Subscribe(dejavu.EvtCheckoutWalkData, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtCheckoutWalkData, func(context map[string]interface{}, path string) {
msg := "Checkout repo [walk data " + path + "]" msg := "Checkout data repository [walk data " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -92,7 +92,7 @@ func init() {
} }
}) })
eventbus.Subscribe(dejavu.EvtCheckoutUpsertFile, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtCheckoutUpsertFile, func(context map[string]interface{}, path string) {
msg := "Checkout repo [upsert file " + path + "]" msg := "Checkout data repository [upsert file " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -106,7 +106,7 @@ func init() {
} }
}) })
eventbus.Subscribe(dejavu.EvtCheckoutRemoveFile, func(context map[string]interface{}, path string) { eventbus.Subscribe(dejavu.EvtCheckoutRemoveFile, func(context map[string]interface{}, path string) {
msg := "Checkout repo [remove file " + path + "]" msg := "Checkout data repository [remove file " + path + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -121,7 +121,7 @@ func init() {
}) })
eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudIndexes, func(context map[string]interface{}, latestSync string) { eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudIndexes, func(context map[string]interface{}, latestSync string) {
msg := "Downloading repo indexes..." msg := "Downloading data repository indexes..."
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -136,7 +136,7 @@ func init() {
}) })
eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudFile, func(context map[string]interface{}, id string) { eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudFile, func(context map[string]interface{}, id string) {
msg := "Downloading repo object [" + id + "]" msg := "Downloading data repository object [" + id + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -151,7 +151,7 @@ func init() {
}) })
eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudChunk, func(context map[string]interface{}, id string) { eventbus.Subscribe(dejavu.EvtSyncBeforeDownloadCloudChunk, func(context map[string]interface{}, id string) {
msg := "Downloading repo object [" + id + "]" msg := "Downloading data repository object [" + id + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -166,7 +166,7 @@ func init() {
}) })
eventbus.Subscribe(dejavu.EvtSyncBeforeUploadObject, func(context map[string]interface{}, id string) { eventbus.Subscribe(dejavu.EvtSyncBeforeUploadObject, func(context map[string]interface{}, id string) {
msg := "Uploading repo object [" + id + "]" msg := "Uploading data repository object [" + id + "]"
util.SetBootDetails(msg) util.SetBootDetails(msg)
switch context[CtxPushMsg].(int) { switch context[CtxPushMsg].(int) {
@ -189,7 +189,7 @@ func GetRepoIndexLogs(page int) (logs []*dejavu.Log, pageCount, totalCount int,
repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key) repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key)
if nil != err { if nil != err {
util.LogErrorf("init repo failed: %s", err) util.LogErrorf("init data repository failed: %s", err)
return return
} }
@ -201,7 +201,7 @@ func GetRepoIndexLogs(page int) (logs []*dejavu.Log, pageCount, totalCount int,
return return
} }
util.LogErrorf("get repo index logs failed: %s", err) util.LogErrorf("get data repo index logs failed: %s", err)
return return
} }
return return
@ -269,7 +269,7 @@ func InitRepoKey() (err error) {
randomBytes = make([]byte, 16) randomBytes = make([]byte, 16)
_, err = rand.Read(randomBytes) _, err = rand.Read(randomBytes)
if nil != err { if nil != err {
util.LogErrorf("init repo key failed: %s", err) util.LogErrorf("init data repo key failed: %s", err)
util.PushUpdateMsg(msgId, Conf.Language(137), 5000) util.PushUpdateMsg(msgId, Conf.Language(137), 5000)
return return
} }
@ -277,7 +277,7 @@ func InitRepoKey() (err error) {
key, err := encryption.KDF(password, salt) key, err := encryption.KDF(password, salt)
if nil != err { if nil != err {
util.LogErrorf("init repo key failed: %s", err) util.LogErrorf("init data repo key failed: %s", err)
util.PushUpdateMsg(msgId, Conf.Language(137), 5000) util.PushUpdateMsg(msgId, Conf.Language(137), 5000)
return return
} }
@ -301,7 +301,7 @@ func CheckoutRepo(id string) (err error) {
repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key) repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key)
if nil != err { if nil != err {
util.LogErrorf("init repo failed: %s", err) util.LogErrorf("init data repo failed: %s", err)
return return
} }
@ -351,7 +351,7 @@ func IndexRepo(memo string) (err error) {
repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key) repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key)
if nil != err { if nil != err {
util.LogErrorf("init repo failed: %s", err) util.LogErrorf("init data repo failed: %s", err)
return return
} }
@ -383,7 +383,7 @@ func indexRepoBeforeCloudSync() {
repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key) repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key)
if nil != err { if nil != err {
util.LogErrorf("init repo failed: %s", err) util.LogErrorf("init data repo failed: %s", err)
return return
} }
@ -393,7 +393,7 @@ func indexRepoBeforeCloudSync() {
CtxPushMsg: CtxPushMsgToStatusBar, CtxPushMsg: CtxPushMsgToStatusBar,
}) })
if nil != err { if nil != err {
util.LogErrorf("index repo before cloud sync failed: %s", err) util.LogErrorf("index data repo before cloud sync failed: %s", err)
return return
} }
elapsed := time.Since(start) elapsed := time.Since(start)
@ -402,12 +402,12 @@ func indexRepoBeforeCloudSync() {
index.Memo = fmt.Sprintf("[Auto] Cloud sync, completed in [%.2fs]", elapsed.Seconds()) index.Memo = fmt.Sprintf("[Auto] Cloud sync, completed in [%.2fs]", elapsed.Seconds())
err = repo.PutIndex(index) err = repo.PutIndex(index)
if nil != err { if nil != err {
util.LogErrorf("put index into repo before cloud sync failed: %s", err) util.LogErrorf("put index into data repo before cloud sync failed: %s", err)
return return
} }
} }
if 7000 < elapsed.Milliseconds() { if 7000 < elapsed.Milliseconds() {
util.LogWarnf("index repo before cloud sync elapsed [%dms]", elapsed.Milliseconds()) util.LogWarnf("index data repo before cloud sync elapsed [%dms]", elapsed.Milliseconds())
} }
} }
@ -418,7 +418,7 @@ func syncRepo() (err error) {
repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key) repo, err := dejavu.NewRepo(util.DataDir, util.RepoDir, Conf.Repo.Key)
if nil != err { if nil != err {
util.LogErrorf("init repo failed: %s", err) util.LogErrorf("init data repo failed: %s", err)
return return
} }
@ -427,6 +427,7 @@ func syncRepo() (err error) {
CtxPushMsg: CtxPushMsgToStatusBar, CtxPushMsg: CtxPushMsgToStatusBar,
}) })
elapsed := time.Since(start) elapsed := time.Since(start)
util.LogInfof("sync repo elapsed [%.2fs]", elapsed.Seconds()) util.LogInfof("sync data repo elapsed [%.2fs]", elapsed.Seconds())
util.PushStatusBar(fmt.Sprintf("Sync data data repo elapsed [%.2fs]", elapsed.Seconds()))
return return
} }