mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 16:16:02 +00:00
add column to JSON view
This commit is contained in:
@@ -70,9 +70,14 @@ function getDisplayColumn(basePath, columnName, display) {
|
||||
|
||||
export function analyseCollectionDisplayColumns(rows, display) {
|
||||
const res = [];
|
||||
const addedColumns = display?.config?.addedColumns;
|
||||
for (const row of rows || []) {
|
||||
getColumnsForObject([], row, res, display);
|
||||
}
|
||||
for (const added of addedColumns || []) {
|
||||
if (res.find(x => x.uniqueName == added)) continue;
|
||||
res.push(getDisplayColumn([], added, display));
|
||||
}
|
||||
return (
|
||||
res.map(col => ({
|
||||
...col,
|
||||
|
||||
@@ -92,6 +92,10 @@ export abstract class GridDisplay {
|
||||
}
|
||||
}
|
||||
|
||||
addDynamicColumn(name: string) {
|
||||
this.includeInColumnSet('addedColumns', name, true);
|
||||
}
|
||||
|
||||
focusColumn(uniqueName: string) {
|
||||
this.setConfig(cfg => ({
|
||||
...cfg,
|
||||
|
||||
Reference in New Issue
Block a user