- Specialist Editor Change (all components in same overview), modal editors to allow for more complex configuration of Agents, Tasks and Tools
- Strengthening dynamic forms
This commit is contained in:
@@ -28,3 +28,40 @@ if (typeof TabulatorFull.prototype.moduleRegistered !== 'function' ||
|
||||
TabulatorFull.modules.format = TabulatorFull.modules.format || {};
|
||||
TabulatorFull.modules.format.formatters = TabulatorFull.modules.format.formatters || {};
|
||||
}
|
||||
|
||||
// Registreer een universele formatter 'typeBadge' zodat string-formatters altijd werken
|
||||
try {
|
||||
if (typeof TabulatorFull.prototype.extendModule === 'function') {
|
||||
TabulatorFull.prototype.extendModule('format', 'formatters', {
|
||||
typeBadge: function(cell) {
|
||||
const raw = (cell.getValue() || '').toString();
|
||||
const val = raw.toLowerCase();
|
||||
const map = {
|
||||
'agent': { cls: 'badge text-bg-primary', label: raw || 'Agent' },
|
||||
'task': { cls: 'badge text-bg-warning', label: raw || 'Task' },
|
||||
'tool': { cls: 'badge text-bg-info', label: raw || 'Tool' },
|
||||
};
|
||||
const conf = map[val] || { cls: 'badge text-bg-secondary', label: raw };
|
||||
return `<span class="${conf.cls}">${conf.label}</span>`;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Fallback voor oudere Tabulator builds zonder extendModule
|
||||
TabulatorFull.modules = TabulatorFull.modules || {};
|
||||
TabulatorFull.modules.format = TabulatorFull.modules.format || {};
|
||||
TabulatorFull.modules.format.formatters = TabulatorFull.modules.format.formatters || {};
|
||||
TabulatorFull.modules.format.formatters.typeBadge = function(cell) {
|
||||
const raw = (cell.getValue() || '').toString();
|
||||
const val = raw.toLowerCase();
|
||||
const map = {
|
||||
'agent': { cls: 'badge text-bg-primary', label: raw || 'Agent' },
|
||||
'task': { cls: 'badge text-bg-warning', label: raw || 'Task' },
|
||||
'tool': { cls: 'badge text-bg-info', label: raw || 'Tool' },
|
||||
};
|
||||
const conf = map[val] || { cls: 'badge text-bg-secondary', label: raw };
|
||||
return `<span class="${conf.cls}">${conf.label}</span>`;
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Kon typeBadge formatter niet registreren:', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user