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

This commit is contained in:
Vanessa 2023-04-22 11:00:16 +08:00
commit 7d9ed4129d
19 changed files with 584 additions and 70 deletions

View file

@ -1,4 +1,6 @@
{
"onlySearchForDoc": "<code class='fn__code'>[[</code> only search documents",
"onlySearchForDocTip": "After enabling, [[ or 【【 to search for block references only in doc blocks",
"ocrResult": "OCR result text",
"reOCR": "Re OCR",
"continueReview1": "Continue Review",
@ -239,7 +241,7 @@
"turnToStatic": "Static anchor text",
"turnToDynamic": "Dynamic anchor text",
"sizeLimit": "Limit",
"trafficStat": "Traffic Statistics",
"trafficStat": "Traffic statistics",
"hideHeadingBelowBlocks": "Hide blocks below heading",
"matchDiacritics": "Match Diacritics",
"copyHPath": "Copy readable path",

View file

@ -1,4 +1,6 @@
{
"onlySearchForDoc": "<code class='fn__code'>[[</code> solo buscar documentos",
"onlySearchForDocTip": "Después de habilitar, [[ o 【【 para buscar referencias de bloque solo en bloques de documentos",
"ocrResult": "Texto de resultado de OCR",
"reOCR": "Re-OCR",
"continueReview1": "Continuar revisión",

View file

@ -1,4 +1,6 @@
{
"onlySearchForDoc": "<code class='fn__code'>[[</code> rechercher uniquement les documents",
"onlySearchForDocTip": "Après l'activation, [[ ou 【【 pour rechercher des références de bloc uniquement dans les blocs doc",
"reOCR": "ReOCR",
"continueReview1": "Continuer la révision",
"continueReview2": "Il reste encore des fiches <code class='fn__code'>${count}</code> à examiner, continuer ?",

View file

@ -1,4 +1,6 @@
{
"onlySearchForDoc": "<code class='fn__code'>[[</code> 僅搜索文檔",
"onlySearchForDocTip": "啟用後使用 [[ 或 【【 搜索塊引用時將只在文檔塊中進行搜索",
"ocrResult": "OCR 結果文本",
"reOCR": "重新 OCR",
"continueReview1": "繼續複習",

View file

@ -1,4 +1,6 @@
{
"onlySearchForDoc": "<code class='fn__code'>[[</code> 仅搜索文档",
"onlySearchForDocTip": "启用后使用 [[ 或 【【 搜索块引用时将只在文档块中进行搜索",
"ocrResult": "OCR 结果文本",
"reOCR": "重新 OCR",
"continueReview1": "继续复习",

View file

@ -5,7 +5,7 @@
"Properties": {
"id": "20210615213222-vs5tzbd",
"title": "Data history",
"updated": "20230403114455"
"updated": "20230422102255"
},
"Children": [
{
@ -1427,12 +1427,12 @@
"HeadingLevel": 3,
"Properties": {
"id": "20220615120602-nzrp6gt",
"updated": "20220615120602"
"updated": "20230422102109"
},
"Children": [
{
"Type": "NodeText",
"Data": "Browse data snapshots"
"Data": "Browse data snapshot"
}
]
},
@ -1485,35 +1485,200 @@
"HeadingLevel": 3,
"Properties": {
"id": "20220615120602-nhnnujh",
"updated": "20220615120602"
"updated": "20230422102056"
},
"Children": [
{
"Type": "NodeText",
"Data": "Clean data snapshot"
"Data": "Cleanup data snapshot"
}
]
},
{
"ID": "20220615120602-f90cll0",
"Type": "NodeParagraph",
"ID": "20230422101614-mdijztr",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220615120602-f90cll0",
"updated": "20220615120602"
"id": "20230422101614-mdijztr",
"updated": "20230422102255"
},
"Children": [
{
"Type": "NodeText",
"Data": "Manually deleting the "
"ID": "20230422101614-5lwp8u3",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101614-5lwp8u3",
"updated": "20230422102255"
},
"Children": [
{
"ID": "20230422101614-5kvwhn7",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101614-5kvwhn7",
"updated": "20230422102255"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Settings"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "About"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Data repo purge"
},
{
"Type": "NodeText",
"Data": " will delete all unreferenced snapshots and related data objects. \"Referenced snapshots\" refer to snapshots pointed to under repo/refs/:"
}
]
},
{
"ID": "20230422101614-ibwplih",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230422101614-ibwplih",
"updated": "20230422102025"
},
"Children": [
{
"ID": "20230422101614-wqxklla",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101614-wqxklla",
"updated": "20230422102025"
},
"Children": [
{
"ID": "20230422101614-uwv2229",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101614-uwv2229",
"updated": "20230422102025"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "latest"
},
{
"Type": "NodeText",
"Data": " points to the latest snapshot"
}
]
}
]
},
{
"ID": "20230422101614-tgrdynv",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101614-tgrdynv",
"updated": "20230422102023"
},
"Children": [
{
"ID": "20230422101614-tf542fs",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101614-tf542fs",
"updated": "20230422102023"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "tags/*"
},
{
"Type": "NodeText",
"Data": " point to manually tagged snapshots"
}
]
}
]
}
]
}
]
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "workspace/repo/"
},
{
"Type": "NodeText",
"Data": " folder will clear all data snapshots."
"ID": "20230422101614-ht2yhm0",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101614-ht2yhm0",
"updated": "20230422101614"
},
"Children": [
{
"ID": "20230422101614-lxjcg2j",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101614-lxjcg2j",
"updated": "20230422101614"
},
"Children": [
{
"Type": "NodeText",
"Data": "Manually delete the "
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "workspace/repo/"
},
{
"Type": "NodeText",
"Data": " folder to clear all data snapshots"
}
]
}
]
}
]
},

View file

@ -5,7 +5,7 @@
"Properties": {
"id": "20210615211733-v6rzowm",
"title": "数据历史",
"updated": "20230403114310"
"updated": "20230422102226"
},
"Children": [
{
@ -1498,24 +1498,193 @@
},
{
"ID": "20220615115758-ajl5l83",
"Type": "NodeParagraph",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220615115758-ajl5l83",
"updated": "20220615115831"
"updated": "20230422102226"
},
"Children": [
{
"Type": "NodeText",
"Data": "手动删除 "
"ID": "20230422101107-ihb3kxp",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101107-ihb3kxp",
"updated": "20230422102226"
},
"Children": [
{
"ID": "20230422101107-zxq6qh2",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101107-zxq6qh2",
"updated": "20230422102226"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "设置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "关于"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "数据仓库清理"
},
{
"Type": "NodeText",
"Data": " 将删除所有未引用的快照和相关数据对象。“引用的快照”指的是 repo/refs/ 下指向的快照:"
}
]
},
{
"ID": "20230422101343-wvt2y4r",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230422101343-wvt2y4r",
"updated": "20230422101936"
},
"Children": [
{
"ID": "20230422101343-obxopx6",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101343-obxopx6",
"updated": "20230422101934"
},
"Children": [
{
"ID": "20230422101343-f5w2p8p",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101343-f5w2p8p",
"updated": "20230422101934"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "latest"
},
{
"Type": "NodeText",
"Data": " 指向最新一个快照"
}
]
}
]
},
{
"ID": "20230422101357-4ugrbw1",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101357-4ugrbw1",
"updated": "20230422101936"
},
"Children": [
{
"ID": "20230422101357-istm02i",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101357-istm02i",
"updated": "20230422101936"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "tags/*"
},
{
"Type": "NodeText",
"Data": " 指向手动标记的快照"
}
]
}
]
}
]
}
]
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "工作空间/repo/"
},
{
"Type": "NodeText",
"Data": " 文件夹可以清空全部数据快照。"
"ID": "20230422101105-vdd9m4g",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422101105-vdd9m4g",
"updated": "20230422101105"
},
"Children": [
{
"ID": "20230422101105-0csmuf6",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422101105-0csmuf6",
"updated": "20230422101106"
},
"Children": [
{
"Type": "NodeText",
"Data": "手动删除 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "工作空间/repo/"
},
{
"Type": "NodeText",
"Data": " 文件夹可以清空全部"
},
{
"Type": "NodeText",
"Data": "数据快照"
}
]
}
]
}
]
},

View file

@ -5,7 +5,7 @@
"Properties": {
"id": "20211226122707-8cr09co",
"title": "數據歷史",
"updated": "20230403114139"
"updated": "20230422102220"
},
"Children": [
{
@ -1491,25 +1491,172 @@
]
},
{
"ID": "20220615120134-jrz9hxj",
"Type": "NodeParagraph",
"ID": "20230422102151-dz30xx1",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220615120134-jrz9hxj",
"updated": "20220615120134"
"id": "20230422102151-dz30xx1",
"updated": "20230422102220"
},
"Children": [
{
"Type": "NodeText",
"Data": "手動刪除 "
"ID": "20230422102151-cvrozwk",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422102151-cvrozwk",
"updated": "20230422102220"
},
"Children": [
{
"ID": "20230422102151-21jkic1",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422102151-21jkic1",
"updated": "20230422102220"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "設置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "關於"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "數據倉庫清理"
},
{
"Type": "NodeText",
"Data": " 將刪除所有未引用的快照和相關數據對象。“引用的快照”指的是 repo/refs/ 下指向的快照:"
}
]
},
{
"ID": "20230422102151-coegnkg",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230422102151-coegnkg",
"updated": "20230422102151"
},
"Children": [
{
"ID": "20230422102151-tp5gphi",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422102151-tp5gphi",
"updated": "20230422102151"
},
"Children": [
{
"ID": "20230422102151-patjhoy",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422102151-patjhoy",
"updated": "20230422102151"
},
"Children": [
{
"Type": "NodeText",
"Data": "latest 指向最新一個快照"
}
]
}
]
},
{
"ID": "20230422102151-juzvfzd",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422102151-juzvfzd",
"updated": "20230422102151"
},
"Children": [
{
"ID": "20230422102151-s1d7n8h",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422102151-s1d7n8h",
"updated": "20230422102151"
},
"Children": [
{
"Type": "NodeText",
"Data": "tags/* 指向手動標記的快照"
}
]
}
]
}
]
}
]
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "工作空間/repo/"
},
{
"Type": "NodeText",
"Data": " 文件夾可以清空全部數據快照。"
"ID": "20230422102151-m9pt89m",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230422102151-m9pt89m",
"updated": "20230422102151"
},
"Children": [
{
"ID": "20230422102151-9b7anw1",
"Type": "NodeParagraph",
"Properties": {
"id": "20230422102151-9b7anw1",
"updated": "20230422102151"
},
"Children": [
{
"Type": "NodeText",
"Data": "手動刪除 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "code",
"TextMarkTextContent": "工作空間/repo/"
},
{
"Type": "NodeText",
"Data": " 文件夾可以清空全部數據快照"
}
]
}
]
}
]
},

View file

@ -98,6 +98,14 @@ export const editor = {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="spellcheck" type="checkbox"${window.siyuan.config.editor.spellcheck ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.onlySearchForDoc}
<div class="b3-label__text">${window.siyuan.languages.onlySearchForDocTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="onlySearchForDoc" type="checkbox"${window.siyuan.config.editor.onlySearchForDoc ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.md31}
@ -280,6 +288,7 @@ export const editor = {
embedBlockBreadcrumb: (editor.element.querySelector("#embedBlockBreadcrumb") as HTMLInputElement).checked,
listLogicalOutdent: (editor.element.querySelector("#listLogicalOutdent") as HTMLInputElement).checked,
spellcheck: (editor.element.querySelector("#spellcheck") as HTMLInputElement).checked,
onlySearchForDoc: (editor.element.querySelector("#onlySearchForDoc") as HTMLInputElement).checked,
floatWindowMode: (editor.element.querySelector("#floatWindowMode") as HTMLInputElement).checked ? 0 : 1,
plantUMLServePath: (editor.element.querySelector("#plantUMLServePath") as HTMLInputElement).value,
katexMacros: (editor.element.querySelector("#katexMacros") as HTMLTextAreaElement).value,

View file

@ -19,7 +19,7 @@ export const initConfigSearch = (element: HTMLElement) => {
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip",
"editReadonly", "editReadonlyTip", "embedBlockBreadcrumb", "embedBlockBreadcrumbTip", "outlineOutdentTip",
"outdent", "floatWindowMode", "floatWindowModeTip", "justify", "justifyTip", "rtl", "rtlTip", "spellcheck",
"spellcheckTip", "backlinkExpand", "backlinkExpandTip"
"spellcheckTip", "backlinkExpand", "backlinkExpandTip", "onlySearchForDocTip"
]),
// 文档树

View file

@ -29,6 +29,7 @@ const setEditor = (modelMainElement: Element) => {
window.siyuan.config.editor.embedBlockBreadcrumb = (modelMainElement.querySelector("#embedBlockBreadcrumb") as HTMLInputElement).checked;
window.siyuan.config.editor.listLogicalOutdent = (modelMainElement.querySelector("#listLogicalOutdent") as HTMLInputElement).checked;
window.siyuan.config.editor.spellcheck = (modelMainElement.querySelector("#spellcheck") as HTMLInputElement).checked;
window.siyuan.config.editor.onlySearchForDoc = (modelMainElement.querySelector("#onlySearchForDoc") as HTMLInputElement).checked;
window.siyuan.config.editor.plantUMLServePath = (modelMainElement.querySelector("#plantUMLServePath") as HTMLInputElement).value;
window.siyuan.config.editor.katexMacros = (modelMainElement.querySelector("#katexMacros") as HTMLTextAreaElement).value;
window.siyuan.config.editor.codeLineWrap = (modelMainElement.querySelector("#codeLineWrap") as HTMLInputElement).checked;
@ -108,6 +109,14 @@ export const initEditor = () => {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="spellcheck" type="checkbox"${window.siyuan.config.editor.spellcheck ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.onlySearchForDoc}
<div class="b3-label__text">${window.siyuan.languages.onlySearchForDocTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="onlySearchForDoc" type="checkbox"${window.siyuan.config.editor.spellcheck ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.md31}

View file

@ -307,7 +307,7 @@ export const hintRef = (key: string, protyle: IProtyle, isQuick = false): IHintD
id: nodeElement ? nodeElement.getAttribute("data-node-id") : protyle.block.parentID,
beforeLen: Math.floor((Math.max(protyle.element.clientWidth / 2, 320) - 58) / 28.8),
rootID: protyle.block.rootID,
onlyDoc: ["[[", "【【"].includes(protyle.hint.splitChar)
isSquareBrackets: ["[[", "【【"].includes(protyle.hint.splitChar)
}, (response) => {
const dataList: IHintData[] = [];
if (response.data.newDoc) {

View file

@ -200,7 +200,7 @@ interface ISiyuan {
mobile?: {
editor?: import("../protyle").Protyle
popEditor?: import("../protyle").Protyle
files?: import("../mobile/util/MobileFiles").MobileFiles
files?: import("../mobile/dock/MobileFiles").MobileFiles
},
user?: {
userId: string
@ -332,6 +332,7 @@ declare interface IEditor {
readOnly: boolean;
listLogicalOutdent: boolean;
spellcheck: boolean;
onlySearchForDoc: boolean;
katexMacros: string;
fullWidth: boolean;
floatWindowMode: number;

View file

@ -191,16 +191,16 @@ func searchRefBlock(c *gin.Context) {
return
}
onlyDoc := false
if nil != arg["onlyDoc"] {
onlyDoc = arg["onlyDoc"].(bool)
isSquareBrackets := false
if isSquareBracketsArg := arg["isSquareBrackets"]; nil != isSquareBracketsArg {
isSquareBrackets = isSquareBracketsArg.(bool)
}
rootID := arg["rootID"].(string)
id := arg["id"].(string)
keyword := arg["k"].(string)
beforeLen := int(arg["beforeLen"].(float64))
blocks, newDoc := model.SearchRefBlock(id, rootID, keyword, beforeLen, onlyDoc)
blocks, newDoc := model.SearchRefBlock(id, rootID, keyword, beforeLen, isSquareBrackets)
ret.Data = map[string]interface{}{
"blocks": blocks,
"newDoc": newDoc,

View file

@ -43,6 +43,7 @@ type Editor struct {
Justify bool `json:"justify"` // 是否两端对齐
RTL bool `json:"rtl"` // 是否从右到左显示
Spellcheck bool `json:"spellcheck"` // 是否启用拼写检查
OnlySearchForDoc bool `json:"onlySearchForDoc"` // 是否启用 [[ 仅搜索文档块
BacklinkExpandCount int `json:"backlinkExpandCount"` // 反向链接默认展开数量
BackmentionExpandCount int `json:"backmentionExpandCount"` // 反链提及默认展开数量
}

View file

@ -44,7 +44,7 @@ require (
github.com/radovskyb/watcher v1.0.7
github.com/sashabaranov/go-gpt3 v1.4.0
github.com/shirou/gopsutil/v3 v3.23.2
github.com/siyuan-note/dejavu v0.0.0-20230421133029-69679a7f4e07
github.com/siyuan-note/dejavu v0.0.0-20230421144748-43d79a87c9f9
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20230216103454-41885eac6c2b
github.com/siyuan-note/filelock v0.0.0-20230417044524-125ee78b5cc9

View file

@ -277,8 +277,8 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
github.com/siyuan-note/dejavu v0.0.0-20230421133029-69679a7f4e07 h1:gSfQLXrr3hOriRP7r38fakauefBF/oRWvha9vG0n238=
github.com/siyuan-note/dejavu v0.0.0-20230421133029-69679a7f4e07/go.mod h1:R3PnH4Y9/0TollG4g0tX7jGW7lvhNIEL9hYi5zQ4+sI=
github.com/siyuan-note/dejavu v0.0.0-20230421144748-43d79a87c9f9 h1:vOGSTlJpei7tyVOpgwSXVChmf65NHkuL9GvMWPjfPgo=
github.com/siyuan-note/dejavu v0.0.0-20230421144748-43d79a87c9f9/go.mod h1:R3PnH4Y9/0TollG4g0tX7jGW7lvhNIEL9hYi5zQ4+sI=
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-20230216103454-41885eac6c2b h1:828lTUW2C0uNiolODqoACu7J8sDUzswD4Xo04mUombg=

View file

@ -392,12 +392,7 @@ func ImportRepoKey(base64Key string) (err error) {
return
}
time.Sleep(1 * time.Second)
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)
}
initDataRepo()
return
}
@ -479,12 +474,7 @@ func InitRepoKeyFromPassphrase(passphrase string) (err error) {
Conf.Repo.Key = key
Conf.Save()
time.Sleep(1 * time.Second)
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)
}
initDataRepo()
return
}
@ -520,13 +510,17 @@ func InitRepoKey() (err error) {
Conf.Repo.Key = key
Conf.Save()
initDataRepo()
return
}
func initDataRepo() {
time.Sleep(1 * time.Second)
util.PushMsg(Conf.Language(138), 3000)
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)
}
return
}
func CheckoutRepo(id string) {
@ -691,6 +685,10 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount i
return
}
if 1 > page {
page = 1
}
logs, pageCount, totalCount, err := repo.GetCloudRepoLogs(page)
if nil != err {
return

View file

@ -121,9 +121,14 @@ func searchEmbedBlock(embedBlockID, stmt string, excludeIDs []string, headingMod
return
}
func SearchRefBlock(id, rootID, keyword string, beforeLen int, onlyDoc bool) (ret []*Block, newDoc bool) {
func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets bool) (ret []*Block, newDoc bool) {
cachedTrees := map[string]*parse.Tree{}
onlyDoc := false
if isSquareBrackets {
onlyDoc = Conf.Editor.OnlySearchForDoc
}
if "" == keyword {
// 查询为空时默认的块引排序规则按最近使用优先 https://github.com/siyuan-note/siyuan/issues/3218
refs := sql.QueryRefsRecent(onlyDoc)