raw data display #991 #962

This commit is contained in:
SPRINX0\prochazka
2025-01-09 16:49:26 +01:00
parent 5208a912a2
commit 183438d2b5
7 changed files with 16 additions and 5 deletions

View File

@@ -37,7 +37,8 @@ export class TableGridDisplay extends GridDisplay {
public displayOptions: any,
serverVersion,
public getDictionaryDescription: DictionaryDescriptionFunc = null,
isReadOnly = false
isReadOnly = false,
public isRawMode = false
) {
super(config, setConfig, cache, setCache, driver, dbinfo, serverVersion);
@@ -172,6 +173,9 @@ export class TableGridDisplay extends GridDisplay {
}
addHintsToSelect(select: Select): boolean {
if (this.isRawMode) {
return false;
}
let res = false;
const groupColumns = this.groupColumns;
for (const column of this.hintBaseColumns || this.getGridColumns()) {

View File

@@ -862,7 +862,7 @@
},
forceNewTab,
null,
null,
prefferedAction.icon,
data,
tabPreviewMode
);

View File

@@ -20,6 +20,7 @@ function getTableLikeActions(dataTab) {
tab: dataTab,
defaultActionId: 'openRawTable',
isRawMode: true,
icon: dataTab == 'ViewDataTab' ? 'img raw-view' : 'img raw-table',
},
// {
// label: 'Open form',

View File

@@ -16,6 +16,7 @@
export let preprocessLoadedRow = null;
export let setLoadedRows = null;
export let isRawMode = false;
// export let griderFactory;
@@ -65,7 +66,7 @@
if (nextRows.errorMessage) {
errorMessage = nextRows.errorMessage;
} else {
if (allRowCount == null) handleLoadRowCount();
if (allRowCount == null && !isRawMode) handleLoadRowCount();
loadedRows = [...loadedRows, ...(preprocessLoadedRow ? nextRows.map(preprocessLoadedRow) : nextRows)];
isLoadedAll = nextRows.length === 0;

View File

@@ -45,6 +45,8 @@
export let setCache;
export let multipleGridsOnTab = false;
export let isRawMode = false;
$: connection = useConnectionInfo({ conid });
$: dbinfo = useDatabaseInfo({ conid, database });
$: serverVersion = useDatabaseServerVersion({ conid, database });
@@ -71,7 +73,8 @@
{ showHintColumns: getBoolSettingsValue('dataGrid.showHintColumns', true) },
$serverVersion,
table => getDictionaryDescription(table, conid, database, $apps, $connections),
$connection?.isReadOnly
$connection?.isReadOnly,
isRawMode
)
: null;

View File

@@ -255,9 +255,11 @@
'img database': 'mdi mdi-database color-icon-gold',
'img sqlite-database': 'mdi mdi-database color-icon-blue',
'img table': 'mdi mdi-table color-icon-blue',
'img raw-table': 'mdi mdi-table-large color-icon-blue',
'img collection': 'mdi mdi-table color-icon-red',
'img query-data': 'mdi mdi-table color-icon-yellow',
'img view': 'mdi mdi-table color-icon-magenta',
'img raw-view': 'mdi mdi-table-large color-icon-magenta',
'img procedure': 'mdi mdi-cog color-icon-blue',
'img function': 'mdi mdi-function-variant',
'img table-structure': 'mdi mdi-tools color-icon-blue',

View File

@@ -55,7 +55,7 @@
onClick: () => getCurrentEditor().startAutoRefresh(),
});
export const matchingProps = ['conid', 'database', 'schemaName', 'pureName'];
export const matchingProps = ['conid', 'database', 'schemaName', 'pureName', 'isRawMode'];
export const allowAddToFavorites = props => true;
export const allowSwitchDatabase = props => true;
</script>