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

This commit is contained in:
Vanessa 2024-10-17 18:01:26 +08:00
commit f1b77a059d
15 changed files with 67 additions and 39 deletions

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?",
"removeButKeepRelationField": "Entfernen, verknüpftes Feld behalten",
"exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut",
"exportConf": "Export-Einstellungen",
"exportConfTip": "Konto, Zugriffscode, Synchronisation, API-Token und Daten-Repo-Schlüssel werden nicht exportiert",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?",
"removeButKeepRelationField": "Remove, keep related field",
"exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again",
"exportConf": "Export settings",
"exportConfTip": "Account, access authorization code, synchronization, API token and data repo key will not be exported",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?",
"removeButKeepRelationField": "Eliminar, mantener el campo relacionado",
"exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar",
"exportConf": "Configuración de exportación",
"exportConfTip": "Las cuentas, los códigos de acceso, la sincronización, los tokens API y las claves del almacén de datos no se exportarán",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?",
"removeButKeepRelationField": "Supprimer, conserver le champ associé",
"exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter",
"exportConf": "Exporter les paramètres",
"exportConfTip": "Les comptes, codes d'accès, synchronisation, tokens API et clés d'entrepôt de données ne seront pas exportés",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?",
"removeButKeepRelationField": "מחק, שמור על שדה הקשר",
"exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא",
"exportConf": "הגדרות ייצוא",
"exportConfTip": "פרטי חשבון, קוד אישור גישה, סנכרון, אסימון API ומפתח מאגר נתונים לא ייוצאו",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?",
"removeButKeepRelationField": "Rimuovi, mantieni il campo correlato",
"exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare",
"exportConf": "Impostazioni di esportazione",
"exportConfTip": "Account, codici di accesso, sincronizzazione, token API e chiavi di data warehouse non verranno esportati",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "<b>${x}</b> に関連するフィールドを同時に削除してもよろしいですか?",
"removeButKeepRelationField": "削除して関連フィールドを保持",
"exportPDFLowMemory": "システムの利用可能なメモリが不足しているため、このPDFをエクスポートできません。内容を減らすか、利用可能なメモリを増やしてから再試行してください",
"exportConf": "設定のエクスポート",
"exportConfTip": "アカウント、アクセス コード、同期、API トークン、データ ウェアハウス キーはエクスポートされません",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?",
"removeButKeepRelationField": "Usuń, zachowaj powiązane pole",
"exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie",
"exportConf": "Ustawienia eksportu",
"exportConfTip": "Konto, kod autoryzacji dostępu, synchronizacja, token API i klucz repozytorium danych nie będą eksportowane",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?",
"removeButKeepRelationField": "Удалить, сохранить связанное поле",
"exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта",
"exportConf": "Экспорт настроек",
"exportConfTip": "Учетная запись, код авторизации доступа, синхронизация, API токен и ключ репозитория данных не будут экспортированы",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?",
"removeButKeepRelationField": "刪除,保留關聯字段",
"exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF請減少內容或者增加可用記憶體後再嘗試導出",
"exportConf": "匯出設定",
"exportConfTip": "帳號、存取授權碼、同步、API token 和資料倉儲金鑰不會被匯出",

View file

@ -1,4 +1,6 @@
{
"confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?",
"removeButKeepRelationField": "删除,保留关联字段",
"exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF请减少内容或者增加可用内存后再尝试导出",
"exportConf": "导出设置",
"exportConfTip": "账号、访问授权码、同步、API token 和数据仓库密钥不会被导出",

View file

@ -277,8 +277,12 @@ func removeAttributeViewKey(c *gin.Context) {
avID := arg["avID"].(string)
keyID := arg["keyID"].(string)
removeRelationDest := false
if nil != arg["removeRelationDest"] {
removeRelationDest = arg["removeRelationDest"].(bool)
}
err := model.RemoveAttributeViewKey(avID, keyID)
err := model.RemoveAttributeViewKey(avID, keyID, removeRelationDest)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()

View file

@ -2772,14 +2772,14 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
}
func (tx *Transaction) doRemoveAttrViewColumn(operation *Operation) (ret *TxErr) {
err := RemoveAttributeViewKey(operation.AvID, operation.ID)
err := RemoveAttributeViewKey(operation.AvID, operation.ID, operation.RemoveDest)
if err != nil {
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
}
return
}
func RemoveAttributeViewKey(avID, keyID string) (err error) {
func RemoveAttributeViewKey(avID, keyID string, removeRelationDest bool) (err error) {
attrView, err := av.ParseAttributeView(avID)
if err != nil {
return
@ -2796,47 +2796,47 @@ func RemoveAttributeViewKey(avID, keyID string) (err error) {
if nil != removedKey && av.KeyTypeRelation == removedKey.Type && nil != removedKey.Relation {
if removedKey.Relation.IsTwoWay {
// 删除双向关联的目标列
var destAv *av.AttributeView
if avID == removedKey.Relation.AvID {
destAv = attrView
} else {
destAv, _ = av.ParseAttributeView(removedKey.Relation.AvID)
}
if nil != destAv {
destAvRelSrcAv := false
for i, keyValues := range destAv.KeyValues {
if keyValues.Key.ID == removedKey.Relation.BackKeyID {
destAv.KeyValues = append(destAv.KeyValues[:i], destAv.KeyValues[i+1:]...)
continue
}
if av.KeyTypeRelation == keyValues.Key.Type && keyValues.Key.Relation.AvID == attrView.ID {
destAvRelSrcAv = true
}
if removeRelationDest { // 删除双向关联的目标列
var destAv *av.AttributeView
if avID == removedKey.Relation.AvID {
destAv = attrView
} else {
destAv, _ = av.ParseAttributeView(removedKey.Relation.AvID)
}
for _, view := range destAv.Views {
switch view.LayoutType {
case av.LayoutTypeTable:
for i, column := range view.Table.Columns {
if column.ID == removedKey.Relation.BackKeyID {
view.Table.Columns = append(view.Table.Columns[:i], view.Table.Columns[i+1:]...)
break
if nil != destAv {
destAvRelSrcAv := false
for i, keyValues := range destAv.KeyValues {
if keyValues.Key.ID == removedKey.Relation.BackKeyID {
destAv.KeyValues = append(destAv.KeyValues[:i], destAv.KeyValues[i+1:]...)
continue
}
if av.KeyTypeRelation == keyValues.Key.Type && keyValues.Key.Relation.AvID == attrView.ID {
destAvRelSrcAv = true
}
}
for _, view := range destAv.Views {
switch view.LayoutType {
case av.LayoutTypeTable:
for i, column := range view.Table.Columns {
if column.ID == removedKey.Relation.BackKeyID {
view.Table.Columns = append(view.Table.Columns[:i], view.Table.Columns[i+1:]...)
break
}
}
}
}
}
if destAv != attrView {
av.SaveAttributeView(destAv)
ReloadAttrView(destAv.ID)
}
if destAv != attrView {
av.SaveAttributeView(destAv)
ReloadAttrView(destAv.ID)
}
if !destAvRelSrcAv {
av.RemoveAvRel(destAv.ID, attrView.ID)
if !destAvRelSrcAv {
av.RemoveAvRel(destAv.ID, attrView.ID)
}
}
}

View file

@ -1415,6 +1415,7 @@ type Operation struct {
RowID string `json:"rowID"` // 属性视图行 ID
IsTwoWay bool `json:"isTwoWay"` // 属性视图关联列是否是双向关系
BackRelationKeyID string `json:"backRelationKeyID"` // 属性视图关联列回链关联列的 ID
RemoveDest bool `json:"removeDest"` // 属性视图删除关联目标
}
type Transaction struct {

View file

@ -413,9 +413,10 @@ func initMime() {
// https://github.com/siyuan-note/siyuan/issues/247
// https://github.com/siyuan-note/siyuan/issues/3813
mime.AddExtensionType(".css", "text/css")
mime.AddExtensionType(".js", "application/x-javascript")
mime.AddExtensionType(".json", "application/json")
mime.AddExtensionType(".js", "text/javascript")
mime.AddExtensionType(".mjs", "text/javascript")
mime.AddExtensionType(".html", "text/html")
mime.AddExtensionType(".json", "application/json")
// 某些系统上下载资源文件后打开是 zip https://github.com/siyuan-note/siyuan/issues/6347
mime.AddExtensionType(".doc", "application/msword")