This commit is contained in:
2025-12-08 00:29:43 +01:00
parent 0af308ee1b
commit 0190bf99e0

View File

@@ -287,10 +287,15 @@
log('PLACEHOLDER INFO', 'Keine Tabellen DB Placeholder Block wird nicht angezeigt.', '#888'); log('PLACEHOLDER INFO', 'Keine Tabellen DB Placeholder Block wird nicht angezeigt.', '#888');
return; return;
} }
const firstTable = tables[0] || {};
const tableName = firstTable.name || 'tabelle';
const columns = Array.isArray(firstTable.columns) ? firstTable.columns : [];
const firstColumn = columns.length ? columns[0].name : 'feld';
const placeholderLabel = `${tableName}.${firstColumn}`.toUpperCase();
addOnce(bm, 'cust-placeholder-db', { addOnce(bm, 'cust-placeholder-db', {
id: 'cust-placeholder-db', id: 'cust-placeholder-db',
label: '🗄️ Placeholder (DB)', label: '🗄️ Placeholder (DB)',
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tables[0].name}" data-placeholder-column="${tables[0].columns?.[0]?.name || ''}">{{${(tables[0].name + '.' + (tables[0].columns?.[0]?.name || '')).toUpperCase()}}}</span>` content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tableName}" data-placeholder-column="${firstColumn}">{{${placeholderLabel}}}</span>`
}); });
}) })
.catch(() => { .catch(() => {