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

This commit is contained in:
Vanessa 2024-06-28 10:43:34 +08:00
commit 1dfdffa5a7
19 changed files with 130 additions and 110 deletions

View file

@ -14,10 +14,10 @@ Install pnpm: `npm install -g pnpm@9.1.1`
Set the Electron mirror environment variable and install Electron:
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@31.0.2 -D`
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@31.1.0 -D`
* Windows:
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install electron@31.0.2 -D`
* `pnpm install electron@31.1.0 -D`
NPM mirror:
@ -28,7 +28,7 @@ NPM mirror:
On the desktop, go to the app folder to run:
* `pnpm install electron@31.0.2 -D`
* `pnpm install electron@31.1.0 -D`
* `pnpm run dev`
* `pnpm run start`

View file

@ -16,11 +16,11 @@
* macOS/Linux:
```
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@31.0.2 -D
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@31.1.0 -D
```
* Windows:
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install electron@31.0.2 -D`
* `pnpm install electron@31.1.0 -D`
NPM 镜像:
@ -30,7 +30,7 @@ NPM 镜像:
桌面端进入 app 文件夹运行:
* `pnpm install electron@31.0.2 -D`
* `pnpm install electron@31.1.0 -D`
* `pnpm run dev`
* `pnpm run start`

View file

@ -1531,8 +1531,8 @@
"241": "Drag to its subheading is not supported",
"242": "TODO",
"243": "Only list the first [%d] tags (including subtags), if you need to adjust, please modify [Settings - Doc Tree - Maximum number to list]",
"244": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. In the future, please exit the program completely before shutting down the computer",
"245": "It did not exit normally after the last use. It is recommended to execute [Doc Tree - Rebuild Index]. In the future, please use [Exit Application] in the right panel to exit normally",
"244": "Data indexing was not completed after the last use. Please execute [Doc Tree - Rebuild Index]. Please exit the program completely before shutting down the computer",
"245": "Data indexing was not completed after the last use. Please execute [Doc Tree - Rebuild Index]. Please use [Exit Application] in the right column panel to exit normally",
"246": "The document title cannot contain / and has been replaced with _",
"247": "File [%s] is larger than the maximum limit [%s], and has been ignored for uploading to the cloud",
"248": "The target heading is located in the container block and cannot be used as a drop point"

View file

@ -1531,8 +1531,8 @@
"241": "No se admite arrastrar a su subtítulo",
"242": "TODO",
"243": "Enumere solo las primeras [%d] etiquetas (incluidas las subetiquetas), modifique [Configuración - Árbol de documentos - Número máximo a listar]",
"244": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. En el futuro, salga del programa por completo antes de apagar la computadora",
"245": "No salió normalmente después del último uso. Se recomienda ejecutar [Árbol de documentos - Reconstruir índice]. En el futuro, utilice [Salir de la aplicación] en el panel derecho para salir normalmente",
"244": "La indexación de datos no se ha completado desde el último uso. Ejecute [Árbol de documentos - Reconstruir índice] una vez. En el futuro, salga completamente del programa antes de apagar la computadora.",
"245": "La indexación de datos no se ha completado desde el último uso. Ejecute [Árbol de documentos - Reconstruir índice] una vez. Utilice [Salir de la aplicación] en el panel de la columna derecha para salir normalmente",
"246": "El título del documento no puede contener / y ha sido reemplazado por _",
"247": "El archivo [%s] es más grande que el límite máximo [%s] y se ha ignorado para cargarlo en la nube",
"248": "El rumbo de destino está ubicado en el bloque contenedor y no puede usarse como punto de entrega"

View file

@ -1531,8 +1531,8 @@
"241": "Le glisser vers son sous-titre n'est pas pris en charge",
"242": "TODO",
"243": "Répertorier uniquement les [%d] premières balises (y compris les sous-balises). veuillez modifier [Paramètres - Arbre des documents - Nombre maximum de documents à lister].",
"244": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Reconstruire l'index]. À l'avenir, veuillez quitter complètement le programme avant d'éteindre l'ordinateur",
"245": "Il ne s'est pas terminé normalement après la dernière utilisation. Il est recommandé d'exécuter [Doc Tree - Reconstruire l'index]. À l'avenir, veuillez utiliser [Quitter l'application] dans le panneau de droite pour quitter normalement",
"244": "L'indexation des données n'a pas été terminée depuis la dernière utilisation. Veuillez exécuter [Arborescence des documents - Reconstruire l'index] une fois. À l'avenir, veuillez quitter complètement le programme avant d'éteindre l'ordinateur.",
"245": "L'indexation des données n'a pas été terminée depuis la dernière utilisation. Veuillez exécuter [Arborescence des documents - Reconstruire l'index] une fois. Veuillez utiliser [Quitter l'application] dans le panneau de la colonne de droite pour quitter normalement",
"246": "Le titre du document ne peut pas contenir / et a été remplacé par _",
"247": "Le fichier [%s] est plus grand que la limite maximale [%s] et a été ignoré pour le téléchargement vers le cloud",
"248": "Le cap cible est situé dans le bloc conteneur et ne peut pas être utilisé comme point de dépôt"

View file

@ -1531,8 +1531,8 @@
"241": "小見出しへのドラッグはサポートされていません",
"242": "TODO",
"243": "最初の [%d] 個のタグ (サブタグを含む) のみを表示します。調整が必要な場合は [設定] - [ドキュメントツリー] - [リストする最大数] を変更してください",
"244": "前回の使用後に正常に終了しませんでした。[ドキュメントツリー] - [インデックスの再構築] を実行することをお勧めします。今後はコンピュータをシャットダウンする前にプログラムを完全に終了してください",
"245": "前回の使用後に正常に終了しませんでした。[ドキュメントツリー] - [インデックスの再構築] を実行することをお勧めします。今後は右パネルの [アプリケーションの終了] を使用して終了してください",
"244": "前回の使用以降、データのインデックス作成が完了していません。[ドキュメント ツリー - インデックスの再構築]を一度実行してください。今後は、コンピューターをシャットダウンする前にプログラムを完全に終了してください",
"245": "前回の使用以降、データのインデックス作成が完了していません。[ドキュメント ツリー - インデックスの再構築]を一度実行してください。正常に終了するには、右列パネルの[アプリケーションの終了]を使用してください。",
"246": "ドキュメントのタイトルに / を含めることはできません。_ に置き換えられました",
"247": "ファイル [%s] は制限サイズ [%s] を超えているためアップロードされませんでした",
"248": "目標の見出しがコンテナブロック内にあるためドロップできません"

View file

@ -1531,8 +1531,8 @@
"241": "不支持拖曳為自己的子標題",
"242": "TODO",
"243": "僅列出前 [%d] 個標籤(含子標籤),如需調整請修改 [設置 - 文檔樹 - 最大列出數量]",
"244": "上次使用後未正常退出,建議執行一次 [文檔樹 - 重建索引]。以後請完整退出程式後再關閉電腦",
"245": "上次使用後未正常退出,建議執行一次 [文檔樹 - 重建索引]。以後請使用右側欄面板中的 [退出應用] 進行正常退出",
"244": "上次使用後未完成資料索引,請執行一次 [文檔樹 - 重建索引]。以後請完整退出程式後再關閉電腦",
"245": "上次使用後未完成資料索引,請執行一次 [文檔樹 - 重建索引]。以後請使用右側欄面板中的 [退出應用] 進行正常退出",
"246": "文件標題不能包含 /,已經使用 _ 替換",
"247": "檔案 [%s] 大於最大限制 [%s],已忽略上傳至社群圖床",
"248": "目標標題位於容器區塊中,無法作為放置點"

View file

@ -1531,8 +1531,8 @@
"241": "不支持拖拽为自己的子标题",
"242": "TODO",
"243": "仅列出前 [%d] 个标签(含子标签),如需调整请修改 [设置 - 文档树 - 最大列出数量]",
"244": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引]。以后请完整退出程序后再关闭电脑",
"245": "上次使用后未正常退出,建议执行一次 [文档树 - 重建索引]。以后请使用右侧栏面板中的 [退出应用] 进行正常退出",
"244": "上次使用后未完成数据索引,请执行一次 [文档树 - 重建索引]。以后请完整退出程序后再关闭电脑",
"245": "上次使用后未完成数据索引,请执行一次 [文档树 - 重建索引]。以后请使用右侧栏面板中的 [退出应用] 进行正常退出",
"246": "文档标题不能包含 /,已经使用 _ 替换",
"247": "文件 [%s] 大于最大限制 [%s],已忽略上传到社区图床",
"248": "目标标题位于容器块中,无法作为放置点"

View file

@ -55,7 +55,7 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.1",
"dayjs": "^1.11.5",
"electron": "31.0.2",
"electron": "31.1.0",
"electron-builder": "24.9.1",
"encoding": "^0.1.13",
"esbuild-loader": "^3.0.1",

16
app/pnpm-lock.yaml generated
View file

@ -10,7 +10,7 @@ importers:
dependencies:
'@electron/remote':
specifier: ^2.1.2
version: 2.1.2(electron@31.0.2)
version: 2.1.2(electron@31.1.0)
devDependencies:
'@types/node':
specifier: ^18.13.0
@ -34,8 +34,8 @@ importers:
specifier: ^1.11.5
version: 1.11.5
electron:
specifier: 31.0.2
version: 31.0.2
specifier: 31.1.0
version: 31.1.0
electron-builder:
specifier: 24.9.1
version: 24.9.1
@ -925,8 +925,8 @@ packages:
electron-to-chromium@1.4.186:
resolution: {integrity: sha512-YoVeFrGd/7ROjz4R9uPoND1K/hSRC/xADy9639ZmIZeJSaBnKdYx3I6LMPsY7CXLpK7JFgKQVzeZ/dk2br6Eaw==}
electron@31.0.2:
resolution: {integrity: sha512-55efQ5yfLN+AQHcFC00AXQqtxC3iAGaxX2GQ3EDbFJ0ca9GHNOdSXkcrdBElLleiDrR2hpXNkQxN1bDn0oxe6w==}
electron@31.1.0:
resolution: {integrity: sha512-TBOwqLxSxnx6+pH6GMri7R3JPH2AkuGJHfWZS0p1HsmN+Qr1T9b0IRJnnehSd/3NZAmAre4ft9Ljec7zjyKFJA==}
engines: {node: '>= 12.20.55'}
hasBin: true
@ -2249,9 +2249,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@electron/remote@2.1.2(electron@31.0.2)':
'@electron/remote@2.1.2(electron@31.1.0)':
dependencies:
electron: 31.0.2
electron: 31.1.0
'@electron/universal@1.4.1':
dependencies:
@ -3142,7 +3142,7 @@ snapshots:
electron-to-chromium@1.4.186: {}
electron@31.0.2:
electron@31.1.0:
dependencies:
'@electron/get': 2.0.2
'@types/node': 20.14.5

View file

@ -12,7 +12,7 @@ require (
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732
github.com/ConradIrwin/font v0.0.0-20240627033111-8567075b2bfe
github.com/Masterminds/sprig/v3 v3.2.3
github.com/PuerkitoBio/goquery v1.9.2
github.com/Xuanwo/go-locale v1.1.0
@ -32,29 +32,29 @@ require (
github.com/gin-gonic/gin v1.10.0
github.com/go-ole/go-ole v1.3.0
github.com/goccy/go-json v0.10.3
github.com/gofrs/flock v0.8.1
github.com/gofrs/flock v0.9.0
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/gorilla/css v1.0.1
github.com/gorilla/websocket v1.5.1
github.com/gorilla/websocket v1.5.3
github.com/imroc/req/v3 v3.43.7
github.com/jinzhu/copier v0.4.0
github.com/json-iterator/go v1.1.12
github.com/klippa-app/go-pdfium v1.12.1
github.com/klippa-app/go-pdfium v1.12.2
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/mitchellh/go-ps v1.0.0
github.com/mssola/useragent v1.0.0
github.com/olahol/melody v1.2.1
github.com/open-spaced-repetition/go-fsrs v1.2.1
github.com/panjf2000/ants/v2 v2.9.1
github.com/panjf2000/ants/v2 v2.10.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/radovskyb/watcher v1.0.7
github.com/rqlite/sql v0.0.0-20240312185922-ffac88a740bd
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/sashabaranov/go-openai v1.24.1
github.com/sashabaranov/go-openai v1.26.1
github.com/shirou/gopsutil/v3 v3.24.5
github.com/siyuan-note/dejavu v0.0.0-20240626145351-e4f9b0821aaf
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4
github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97
github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257
github.com/siyuan-note/httpclient v0.0.0-20240626145026-29585d45a51c
github.com/siyuan-note/logging v0.0.0-20240505035402-6430d57006a2
@ -66,7 +66,7 @@ require (
github.com/vmihailenco/msgpack/v5 v5.4.1
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1
github.com/xuri/excelize/v2 v2.8.1
golang.org/x/image v0.17.0
golang.org/x/image v0.18.0
golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b
golang.org/x/mod v0.18.0
golang.org/x/text v0.16.0
@ -85,8 +85,8 @@ require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect
github.com/aws/aws-sdk-go v1.54.2 // indirect
github.com/bytedance/sonic v1.11.8 // indirect
github.com/aws/aws-sdk-go v1.54.9 // indirect
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
@ -100,7 +100,7 @@ require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.21.0 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/go-resty/resty/v2 v2.13.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
@ -110,19 +110,19 @@ require (
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/gorilla/context v1.1.2 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
github.com/gorilla/sessions v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hhrutter/lzw v1.0.0 // indirect
github.com/hhrutter/tiff v1.0.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jolestar/go-commons-pool/v2 v2.1.2 // indirect
github.com/juju/errors v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/levigross/exp-html v0.0.0-20120902181939-8df60c69a8f5 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
@ -151,7 +151,7 @@ require (
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
github.com/tetratelabs/wazero v1.7.2 // indirect
github.com/tetratelabs/wazero v1.7.3 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
@ -169,7 +169,7 @@ require (
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View file

@ -23,8 +23,8 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4 h1:r10k4+Lu1mDpiCKa1liAdGJUhB4BJHHJnMvtoli6Hts=
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4/go.mod h1:a3CzWIqeRxiODAscAIfZ4wbFRXxywBrdCwTENVAWB2g=
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732 h1:0EDePskeF4vNFCk70ATaFHQzjmwXsk+VImnMJttecNU=
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732/go.mod h1:krTLO7JWu6g8RMxG8sl+T1Hf8W93XQacBKJmqFZ2MFY=
github.com/ConradIrwin/font v0.0.0-20240627033111-8567075b2bfe h1:mtJy70dOPoXlIcNNZKPwK0vTqyABsD8Du0spzUy9W7A=
github.com/ConradIrwin/font v0.0.0-20240627033111-8567075b2bfe/go.mod h1:krTLO7JWu6g8RMxG8sl+T1Hf8W93XQacBKJmqFZ2MFY=
github.com/JalfResi/justext v0.0.0-20221106200834-be571e3e3052 h1:8T2zMbhLBbH9514PIQVHdsGhypMrsB4CxwbldKA9sBA=
github.com/JalfResi/justext v0.0.0-20221106200834-be571e3e3052/go.mod h1:0SURuH1rsE8aVWvutuMZghRNrNrYEUzibzJfhEYR8L0=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
@ -55,10 +55,10 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM=
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
github.com/aws/aws-sdk-go v1.54.2 h1:Wo6AVWcleNHrYa48YzfYz60hzxGRqsJrK5s/qePe+3I=
github.com/aws/aws-sdk-go v1.54.2/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bytedance/sonic v1.11.8 h1:Zw/j1KfiS+OYTi9lyB3bb0CFxPJVkM17k1wyDG32LRA=
github.com/bytedance/sonic v1.11.8/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/aws/aws-sdk-go v1.54.9 h1:e0Czh9AhrCVPuyaIUnibYmih3cYexJKlqlHSJ2eMKbI=
github.com/aws/aws-sdk-go v1.54.9/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bytedance/sonic v1.11.9 h1:LFHENlIY/SLzDWverzdOvgMztTxcfcF+cqNsz9pK5zg=
github.com/bytedance/sonic v1.11.9/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@ -141,8 +141,8 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.8.0/go.mod h1:9JhgTzTaE31GZDpH/HSvHiRJrJ3iKAgqqH0Bl/Ocjdk=
github.com/go-playground/validator/v10 v10.21.0 h1:4fZA11ovvtkdgaeev9RGWPgc1uj3H8W+rNYyH/ySBb0=
github.com/go-playground/validator/v10 v10.21.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-resty/resty/v2 v2.0.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8=
github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g=
github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0=
@ -152,8 +152,9 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.9.0 h1:QqEH0zKHPdEyY4YbJLleD9Il4ft7h6hn3gECO6Ss4rQ=
github.com/gofrs/flock v0.9.0/go.mod h1:O+L78Axre/Bc0Ya3RlNiGP+Rt0tFHWjtHTQ+B2uPZw8=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
@ -180,10 +181,10 @@ github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA=
github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=
github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY=
github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/gorilla/sessions v1.3.0 h1:XYlkq7KcpOB2ZhHBPv5WpjMIxrQosiZanfoy1HLZFzg=
github.com/gorilla/sessions v1.3.0/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@ -194,8 +195,8 @@ github.com/hhrutter/lzw v1.0.0/go.mod h1:2HC6DJSn/n6iAZfgM3Pg+cP1KxeWc3ezG8bBqW5
github.com/hhrutter/tiff v1.0.1 h1:MIus8caHU5U6823gx7C6jrfoEvfSTGtEFRiM8/LOzC0=
github.com/hhrutter/tiff v1.0.1/go.mod h1:zU/dNgDm0cMIa8y8YwcYBeuEEveI4B0owqHyiPpJPHc=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
@ -227,10 +228,10 @@ github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klippa-app/go-pdfium v1.12.1 h1:QJuT8ZTQAKINWpdkghzH4G6wGiMAeUEDE018K9oDsVg=
github.com/klippa-app/go-pdfium v1.12.1/go.mod h1:TO8vNHhjUzfJynaaFGQr1CFQ05fc4hFTPPyZJBfIw4k=
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klippa-app/go-pdfium v1.12.2 h1:0z9/njA0XwHbzicCHmRoGW32yeTwOfRPpGuxcZN2Arg=
github.com/klippa-app/go-pdfium v1.12.2/go.mod h1:Vw30mehpmosf+bOWjTAPi/ALhO4B5aBO7xZYC0fKH9c=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@ -290,8 +291,8 @@ github.com/otiai10/gosseract/v2 v2.4.1 h1:G8AyBpXEeSlcq8TI85LH/pM5SXk8Djy2GEXisg
github.com/otiai10/gosseract/v2 v2.4.1/go.mod h1:1gNWP4Hgr2o7yqWfs6r5bZxAatjOIdqWxJLWsTsembk=
github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs=
github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
github.com/panjf2000/ants/v2 v2.9.1 h1:Q5vh5xohbsZXGcD6hhszzGqB7jSSc2/CRr3QKIga8Kw=
github.com/panjf2000/ants/v2 v2.9.1/go.mod h1:7ZxyxsqE4vvW0M7LSD8aI3cKwgFhBHbxnlN8mDqHa1I=
github.com/panjf2000/ants/v2 v2.10.0 h1:zhRg1pQUtkyRiOFo2Sbqwjp0GfBNo9cUY2/Grpx1p+8=
github.com/panjf2000/ants/v2 v2.10.0/go.mod h1:7ZxyxsqE4vvW0M7LSD8aI3cKwgFhBHbxnlN8mDqHa1I=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
@ -337,8 +338,8 @@ github.com/rqlite/sql v0.0.0-20240312185922-ffac88a740bd h1:wW6BtayFoKaaDeIvXRE3
github.com/rqlite/sql v0.0.0-20240312185922-ffac88a740bd/go.mod h1:ib9zVtNgRKiGuoMyUqqL5aNpk+r+++YlyiVIkclVqPg=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/sashabaranov/go-openai v1.24.1 h1:DWK95XViNb+agQtuzsn+FyHhn3HQJ7Va8z04DQDJ1MI=
github.com/sashabaranov/go-openai v1.24.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sashabaranov/go-openai v1.26.1 h1:B5plrmc/r7hKgYX69oT2VSt5w0O6u9BJYTjB8lNCesI=
github.com/sashabaranov/go-openai v1.26.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
@ -356,8 +357,8 @@ github.com/siyuan-note/dejavu v0.0.0-20240626145351-e4f9b0821aaf h1:rul3+iFekIhj
github.com/siyuan-note/dejavu v0.0.0-20240626145351-e4f9b0821aaf/go.mod h1:fEgyP8xD6Do5ogMn9hFCz0e4IQQVamwM2uX96bOCpPQ=
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/evyW6LcB9IQT8PR4ppx8JVqOFP9Ix3rfwSrc=
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis=
github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025 h1:crQmKw5vZz3MljAP/xKMWY/rksMX634jJK9kcsOIbkw=
github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025/go.mod h1:1/nGgthl89FPA7GzAcEWKl6zRRnfgyTjzLZj9bW7kuw=
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97 h1:lM5v8BfNtbOL5jYwhCdMYBcYtr06IYBKjjSLAPMKTM8=
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97/go.mod h1:1/nGgthl89FPA7GzAcEWKl6zRRnfgyTjzLZj9bW7kuw=
github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257 h1:lA6qBehxciYKye8LpP59LHGC8DQkkJkg7AYA4VoF+g8=
github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257/go.mod h1:vUXGLmTVIg5trcnNWGkMCwc3EuIJaXXx3hQzgno1Hn4=
github.com/siyuan-note/httpclient v0.0.0-20240626145026-29585d45a51c h1:E6W4x2GL+7jHsfkPEldvosWNl7hxtRHJjgGVhHHywn4=
@ -396,8 +397,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/studio-b12/gowebdav v0.9.0 h1:1j1sc9gQnNxbXXM4M/CebPOX4aXYtr7MojAVcN4dHjU=
github.com/studio-b12/gowebdav v0.9.0/go.mod h1:bHA7t77X/QFExdeAnDzK6vKM34kEZAcE1OX4MfiwjkE=
github.com/tetratelabs/wazero v1.7.2 h1:1+z5nXJNwMLPAWaTePFi49SSTL0IMx/i3Fg8Yc25GDc=
github.com/tetratelabs/wazero v1.7.2/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y=
github.com/tetratelabs/wazero v1.7.3 h1:PBH5KVahrt3S2AHgEjKu4u+LlDbbk+nsGE3KLucy6Rw=
github.com/tetratelabs/wazero v1.7.3/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y=
github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU=
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
@ -446,8 +447,8 @@ golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5D
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY=
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.17.0 h1:nTRVVdajgB8zCMZVsViyzhnMKPwYeroEERRC64JuLco=
golang.org/x/image v0.17.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b h1:WX7nnnLfCEXg+FmdYZPai2XuP3VqCP1HZVMST0n9DF0=
golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b/go.mod h1:EiXZlVfUTaAyySFVJb9rsODuiO+WXu8HrUuySb7nYFw=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@ -537,8 +538,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View file

@ -81,7 +81,7 @@ type AppConf struct {
ShowChangelog bool `json:"showChangelog"` // 是否显示版本更新日志
CloudRegion int `json:"cloudRegion"` // 云端区域0中国大陆1北美
Snippet *conf.Snpt `json:"snippet"` // 代码片段
State int `json:"state"` // 运行状态0已经正常退出1运行中
DataIndexState int `json:"dataIndexState"` // 数据索引状态0已索引1未索引
m *sync.Mutex
}
@ -464,8 +464,8 @@ func InitConf() {
Conf.LocalIPs = util.GetLocalIPs()
if 1 == Conf.State {
// 上次未正常退出
if 1 == Conf.DataIndexState {
// 上次未正常完成数据索引
go func() {
util.WaitForUILoaded()
time.Sleep(2 * time.Second)
@ -477,7 +477,7 @@ func InitConf() {
}()
}
Conf.State = 1 // 运行中
Conf.DataIndexState = 0
Conf.Save()
logging.SetLogLevel(Conf.LogLevel)
@ -716,7 +716,6 @@ func (conf *AppConf) save0(data []byte) {
}
func (conf *AppConf) Close() {
conf.State = 0 // 已经正常退出
conf.Save()
}

View file

@ -429,4 +429,14 @@ func subscribeSQLEvents() {
util.SetBootDetails(msg)
util.ContextPushMsg(context, msg)
})
eventbus.Subscribe(eventbus.EvtSQLIndexChanged, func() {
Conf.DataIndexState = 1
Conf.Save()
})
eventbus.Subscribe(eventbus.EvtSQLIndexFlushed, func() {
Conf.DataIndexState = 0
Conf.Save()
})
}

View file

@ -321,7 +321,9 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets,
if "" == keyword {
// 查询为空时默认的块引排序规则按最近使用优先 https://github.com/siyuan-note/siyuan/issues/3218
refs := sql.QueryRefsRecent(onlyDoc)
ignoreLines := getRefSearchIgnoreLines()
refs := sql.QueryRefsRecent(onlyDoc, ignoreLines)
for _, ref := range refs {
tree := cachedTrees[ref.DefBlockRootID]
if nil == tree {

View file

@ -259,12 +259,6 @@ func checkSync(boot, exit, byHand bool) bool {
}
}
if isSyncing.Load() {
logging.LogWarnf("sync is in progress")
planSyncAfter(fixSyncInterval)
return false
}
if 7 < autoSyncErrCount && !byHand {
logging.LogErrorf("failed to auto-sync too many times, delay auto-sync 64 minutes")
util.PushErrMsg(Conf.Language(125), 1000*60*60)

View file

@ -17,6 +17,7 @@
package sql
import (
"bytes"
"database/sql"
"sort"
"strings"
@ -352,11 +353,21 @@ func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs, refTexts []
return
}
func QueryRefsRecent(onlyDoc bool) (ret []*Ref) {
func QueryRefsRecent(onlyDoc bool, ignoreLines []string) (ret []*Ref) {
stmt := "SELECT * FROM refs AS r"
if onlyDoc {
stmt = "SELECT r.* FROM refs AS r, blocks AS b WHERE b.type = 'd' AND b.id = r.def_block_id"
}
stmt += " WHERE 1 = 1"
if 0 < len(ignoreLines) {
// Support ignore search results https://github.com/siyuan-note/siyuan/issues/10089
notLike := bytes.Buffer{}
for _, line := range ignoreLines {
notLike.WriteString(" AND ")
notLike.WriteString(line)
}
stmt += notLike.String()
}
stmt += " GROUP BY r.def_block_id ORDER BY r.id DESC LIMIT 32"
rows, err := query(stmt)
if nil != err {

View file

@ -164,6 +164,8 @@ func FlushQueue() {
// Push database index commit event https://github.com/siyuan-note/siyuan/issues/8814
util.BroadcastByType("main", "databaseIndexCommit", 0, "", nil)
eventbus.Publish(eventbus.EvtSQLIndexFlushed)
}
func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (err error) {
@ -219,7 +221,7 @@ func IndexNodeQueue(id string) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func BatchRemoveAssetsQueue(hashes []string) {
@ -231,7 +233,7 @@ func BatchRemoveAssetsQueue(hashes []string) {
defer dbQueueLock.Unlock()
newOp := &dbQueueOperation{removeAssetHashes: hashes, inQueueTime: time.Now(), action: "delete_assets"}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func UpdateBlockContentQueue(block *Block) {
@ -245,7 +247,7 @@ func UpdateBlockContentQueue(block *Block) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func DeleteRefsTreeQueue(tree *parse.Tree) {
@ -259,7 +261,7 @@ func DeleteRefsTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func UpdateRefsTreeQueue(tree *parse.Tree) {
@ -273,7 +275,7 @@ func UpdateRefsTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func DeleteBoxRefsQueue(boxID string) {
@ -287,7 +289,7 @@ func DeleteBoxRefsQueue(boxID string) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func DeleteBoxQueue(boxID string) {
@ -301,7 +303,7 @@ func DeleteBoxQueue(boxID string) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func IndexTreeQueue(tree *parse.Tree) {
@ -315,7 +317,7 @@ func IndexTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func UpsertTreeQueue(tree *parse.Tree) {
@ -329,7 +331,7 @@ func UpsertTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func RenameTreeQueue(tree *parse.Tree) {
@ -347,7 +349,7 @@ func RenameTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func RenameSubTreeQueue(tree *parse.Tree) {
@ -365,7 +367,7 @@ func RenameSubTreeQueue(tree *parse.Tree) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func RemoveTreeQueue(rootID string) {
@ -379,7 +381,7 @@ func RemoveTreeQueue(rootID string) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func BatchRemoveTreeQueue(rootIDs []string) {
@ -391,7 +393,7 @@ func BatchRemoveTreeQueue(rootIDs []string) {
defer dbQueueLock.Unlock()
newOp := &dbQueueOperation{removeTreeIDs: rootIDs, inQueueTime: time.Now(), action: "delete_ids"}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func RemoveTreePathQueue(treeBox, treePathPrefix string) {
@ -405,7 +407,7 @@ func RemoveTreePathQueue(treeBox, treePathPrefix string) {
return
}
}
operationQueue = append(operationQueue, newOp)
appendOperation(newOp)
}
func getOperations() (ops []*dbQueueOperation) {
@ -416,3 +418,8 @@ func getOperations() (ops []*dbQueueOperation) {
operationQueue = nil
return
}
func appendOperation(op *dbQueueOperation) {
operationQueue = append(operationQueue, op)
eventbus.Publish(eventbus.EvtSQLIndexChanged)
}

View file

@ -49,10 +49,9 @@ func GetMirrorAttrViewBlockIDs(avID string) (ret []string) {
}
blockIDs := avBlocks[avID]
for _, blockID := range blockIDs {
if nil != GetBlockTree(blockID) {
ret = append(ret, blockID)
}
bts := GetBlockTrees(blockIDs)
for blockID := range bts {
ret = append(ret, blockID)
}
return
}
@ -87,11 +86,8 @@ func BatchGetMirrorAttrViewBlocks(avIDs []string) (ret []*AvBlock) {
for _, avID := range avIDs {
var blockIDs []string
for _, blockID := range avBlocks[avID] {
if nil == GetBlockTree(blockID) {
continue
}
bts := GetBlockTrees(avBlocks[avID])
for blockID := range bts {
blockIDs = append(blockIDs, blockID)
}
avBlock := &AvBlock{