2020-03-07 21:39:19 +00:00
|
|
|
import { DisplayColumn } from './GridDisplay';
|
2020-03-08 17:51:37 +00:00
|
|
|
import { TableInfo } from '@dbgate/types';
|
2020-03-07 21:39:19 +00:00
|
|
|
|
2020-03-12 07:02:13 +00:00
|
|
|
export interface GridConfigColumns {
|
2020-03-07 17:13:44 +00:00
|
|
|
hiddenColumns: string[];
|
2020-03-07 21:39:19 +00:00
|
|
|
expandedColumns: string[];
|
2020-03-08 13:58:32 +00:00
|
|
|
addedColumns: string[];
|
2020-03-07 21:39:19 +00:00
|
|
|
}
|
|
|
|
|
2020-03-12 07:02:13 +00:00
|
|
|
export interface GridConfig extends GridConfigColumns {
|
|
|
|
filters: { [uniqueName: string]: string };
|
|
|
|
}
|
|
|
|
|
2020-03-07 21:39:19 +00:00
|
|
|
export interface GridCache {
|
2020-03-08 17:51:37 +00:00
|
|
|
tables: { [uniqueName: string]: TableInfo };
|
|
|
|
refreshTime: number;
|
2020-03-07 21:39:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function createGridConfig(): GridConfig {
|
|
|
|
return {
|
|
|
|
hiddenColumns: [],
|
|
|
|
expandedColumns: [],
|
2020-03-08 13:58:32 +00:00
|
|
|
addedColumns: [],
|
2020-03-12 07:02:13 +00:00
|
|
|
filters: {},
|
2020-03-07 21:39:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function createGridCache(): GridCache {
|
|
|
|
return {
|
2020-03-08 17:51:37 +00:00
|
|
|
tables: {},
|
|
|
|
refreshTime: new Date().getTime(),
|
2020-03-07 21:39:19 +00:00
|
|
|
};
|
2020-03-05 10:42:16 +00:00
|
|
|
}
|