diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json index 05215c239..5244a929f 100644 --- a/app/appearance/langs/ar_SA.json +++ b/app/appearance/langs/ar_SA.json @@ -1653,6 +1653,7 @@ "265": "خارج النطاق", "266": "Tesseract OCR غير مثبت أو غير مهيأ، يرجى الرجوع إلى دليل المستخدم - قسم ملفات الموارد لإجراء الإعداد", "267": "قاعدة بيانات غير مسماة", - "268": "يرجى ملاحظة أن الملف ‎[%s]‎ قد تجاوز بالفعل ‎[%d MB]‎، وقد يؤدي ذلك إلى انخفاض الأداء" + "268": "يرجى ملاحظة أن الملف ‎[%s]‎ قد تجاوز بالفعل ‎[%d MB]‎، وقد يؤدي ذلك إلى انخفاض الأداء", + "269": "تمت إضافة هذا المقطع بالفعل إلى قاعدة البيانات ‎[%s]‎" } } diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json index 940c6b105..f7531aa69 100644 --- a/app/appearance/langs/de_DE.json +++ b/app/appearance/langs/de_DE.json @@ -1653,6 +1653,7 @@ "265": "Außerhalb des Bereichs", "266": "Tesseract OCR ist nicht installiert oder konfiguriert, bitte lesen Sie das Benutzerhandbuch - Abschnitt Ressourcen-Dateien zur Konfiguration", "267": "Unbenannte Datenbank", - "268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann" + "268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann", + "269": "Dieser Block wurde bereits zur Datenbank [%s] hinzugefügt" } } diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 2a41c4d64..37a1349be 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1653,6 +1653,7 @@ "265": "Out of range", "266": "Tesseract OCR is not installed or configured, please refer to the User Guide - Assets section for configuration", "267": "Unnamed database", - "268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation" + "268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation", + "269": "This block has already been added to the database [%s]" } } diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 22a5186b3..4ce5df0a8 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1653,6 +1653,7 @@ "265": "Fuera de rango", "266": "Tesseract OCR no está instalado o configurado, consulte la Guía del Usuario - Sección de archivos de recursos para la configuración", "267": "Base de datos sin nombre", - "268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento" + "268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento", + "269": "Este bloque ya ha sido añadido a la base de datos [%s]" } } diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index ef22674ca..cabcf5c1f 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1653,6 +1653,7 @@ "265": "Hors de portée", "266": "Tesseract OCR n'est pas installé ou configuré, veuillez consulter le Guide de l'utilisateur - Section des fichiers de ressources pour la configuration", "267": "Base de données sans nom", - "268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances" + "268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances", + "269": "Ce bloc a déjà été ajouté à la base de données [%s]" } } diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json index 3a6088fd4..338c5daa5 100644 --- a/app/appearance/langs/he_IL.json +++ b/app/appearance/langs/he_IL.json @@ -1653,6 +1653,7 @@ "265": "מחוץ לטווח", "266": "Tesseract OCR לא הותקן או הוגדר, אנא עיין במדריך למשתמש - פרק קבצי משאבים לצורך הגדרה", "267": "מסד נתונים ללא שם", - "268": "שים לב שהקובץ ‎[%s]‎ כבר חרג מ-‎[%d MB]‎, דבר שעלול לגרום לירידה בביצועים" + "268": "שים לב שהקובץ ‎[%s]‎ כבר חרג מ-‎[%d MB]‎, דבר שעלול לגרום לירידה בביצועים", + "269": "הבלוק נוסף כבר למסד הנתונים ‎[%s]‎" } } diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json index 0b63b2690..12971630e 100644 --- a/app/appearance/langs/it_IT.json +++ b/app/appearance/langs/it_IT.json @@ -1653,6 +1653,7 @@ "265": "Fuori intervallo", "266": "Tesseract OCR non è installato o configurato, fare riferimento alla Guida utente - Sezione file di risorse per la configurazione", "267": "Database senza nome", - "268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni" + "268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni", + "269": "Questo blocco è già stato aggiunto al database [%s]" } } diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json index 84d35407e..4592526f5 100644 --- a/app/appearance/langs/ja_JP.json +++ b/app/appearance/langs/ja_JP.json @@ -1653,6 +1653,7 @@ "265": "範囲外", "266": "Tesseract OCR がインストールされていないか、設定されていません。ユーザーガイド - リソースファイルセクションを参照して設定してください", "267": "未命名のデータベース", - "268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります" + "268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります", + "269": "このブロックはすでにデータベース [%s] に追加されています" } } diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json index 0d2972d1c..58d87f85b 100644 --- a/app/appearance/langs/pl_PL.json +++ b/app/appearance/langs/pl_PL.json @@ -1653,6 +1653,7 @@ "265": "Poza zakresem", "266": "Tesseract OCR nie jest zainstalowany lub skonfigurowany, zapoznaj się z Podręcznikiem użytkownika - Sekcja plików zasobów, aby skonfigurować", "267": "Nienazwana baza danych", - "268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności" + "268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności", + "269": "Ten blok został już dodany do bazy danych [%s]" } } diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json index c484274e6..f138a36ef 100644 --- a/app/appearance/langs/pt_BR.json +++ b/app/appearance/langs/pt_BR.json @@ -1653,6 +1653,7 @@ "265": "Fora do intervalo", "266": "Tesseract OCR não está instalado ou configurado, consulte o Guia do Usuário - Seção de Arquivos de Recursos para configuração", "267": "Banco de dados sem nome", - "268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho" + "268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho", + "269": "Este bloco já foi adicionado ao banco de dados [%s]" } } diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json index 6930c7955..9ad43b3b7 100644 --- a/app/appearance/langs/ru_RU.json +++ b/app/appearance/langs/ru_RU.json @@ -1653,6 +1653,7 @@ "265": "Вне диапазона", "266": "Tesseract OCR не установлен или не настроен, пожалуйста, обратитесь к Руководству пользователя - Раздел ресурсов для настройки", "267": "База данных не названа", - "268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности" + "268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности", + "269": "Этот блок уже добавлен в базу данных [%s]" } } diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index d6f3f97e7..008bc1af5 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1653,6 +1653,7 @@ "265": "不在範圍內", "266": "Tesseract OCR 未安裝或未配置,請參考 用戶指南-資料文件 章節進行配置", "267": "未命名資料庫", - "268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降" + "268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降", + "269": "該塊已經添加到資料庫 [%s] 中" } } diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index de820395e..5d02ce44c 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1653,6 +1653,7 @@ "265": "不在范围内", "266": "Tesseract OCR 未安装或未配置,请参考 用户指南-资源文件 章节进行配置", "267": "未命名数据库", - "268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降" + "268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降", + "269": "该块已经添加到数据库 [%s] 中" } } diff --git a/kernel/api/av.go b/kernel/api/av.go index a242f0b65..43553c19f 100644 --- a/kernel/api/av.go +++ b/kernel/api/av.go @@ -351,7 +351,7 @@ func addAttributeViewBlocks(c *gin.Context) { ignoreDefaultFill = arg["ignoreDefaultFill"].(bool) } - err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill) + err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, nil) if err != nil { ret.Code = -1 ret.Msg = err.Error() diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 0bfec558d..b50ae0b31 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -2958,14 +2958,14 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) { } func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) { - err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill) + err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill, operation.Context) if err != nil { return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()} } return } -func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, dbBlockID, groupID, previousItemID string, ignoreDefaultFill bool) (err error) { +func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, dbBlockID, groupID, previousItemID string, ignoreDefaultFill bool, context map[string]interface{}) (err error) { slices.Reverse(srcs) // https://github.com/siyuan-note/siyuan/issues/11286 now := time.Now().UnixMilli() @@ -3000,14 +3000,18 @@ func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, if nil != src["content"] { srcContent = src["content"].(string) } - if avErr := addAttributeViewBlock(now, avID, dbBlockID, groupID, previousItemID, srcItemID, boundBlockID, srcContent, isDetached, ignoreDefaultFill, tree, tx); nil != avErr { + if avErr := addAttributeViewBlock(now, avID, dbBlockID, groupID, previousItemID, srcItemID, boundBlockID, srcContent, isDetached, ignoreDefaultFill, tree, tx, context); nil != avErr { return avErr } } return } -func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction) (err error) { +func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction, context map[string]interface{}) (err error) { + if nil == context { + context = map[string]any{} + } + var node *ast.Node if !isDetached { node = treenode.GetNodeInTree(tree, addingBoundBlockID) @@ -3051,6 +3055,9 @@ func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, blockValue.UpdatedAt = now err = av.SaveAttributeView(attrView) } + + msg := fmt.Sprintf(Conf.language(269), attrView.Name) + context["message"] = msg return } } diff --git a/kernel/model/file.go b/kernel/model/file.go index aa723d809..d5331504c 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -991,7 +991,7 @@ func DuplicateDoc(tree *parse.Tree) { AddAttributeViewBlock(nil, []map[string]interface{}{{ "id": n.ID, "isDetached": false, - }}, avID, "", "", "", false) + }}, avID, "", "", "", false, nil) ReloadAttrView(avID) } return ast.WalkContinue diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index 898591a86..61d161244 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -1099,7 +1099,7 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) { AddAttributeViewBlock(tx, []map[string]interface{}{{ "id": insertedNode.ID, "isDetached": false, - }}, avID, "", "", previousID, false) + }}, avID, "", "", previousID, false, nil) ReloadAttrView(avID) } @@ -1284,7 +1284,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) { AddAttributeViewBlock(tx, []map[string]interface{}{{ "id": insertedNode.ID, "isDetached": false, - }}, avID, "", "", previousID, false) + }}, avID, "", "", previousID, false, nil) ReloadAttrView(avID) }