mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 22:55:59 +00:00
This commit is contained in:
@@ -376,6 +376,9 @@ export default function DataGridCore(props) {
|
||||
});
|
||||
};
|
||||
|
||||
const insertedRows = getChangeSetInsertedRows(changeSet, display.baseTable);
|
||||
const rowCountNewIncluded = loadedRows.length + insertedRows.length;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (
|
||||
!isLoadedAll &&
|
||||
@@ -472,9 +475,6 @@ export default function DataGridCore(props) {
|
||||
return <ErrorInfo message={errorMessage} />;
|
||||
}
|
||||
|
||||
const insertedRows = getChangeSetInsertedRows(changeSet, display.baseTable);
|
||||
const rowCountNewIncluded = loadedRows.length + insertedRows.length;
|
||||
|
||||
const handleRowScroll = (value) => {
|
||||
setFirstVisibleRowScrollIndex(value);
|
||||
};
|
||||
@@ -493,7 +493,7 @@ export default function DataGridCore(props) {
|
||||
revertRowChanges={revertRowChanges}
|
||||
deleteSelectedRows={deleteSelectedRows}
|
||||
insertNewRow={insertNewRow}
|
||||
reload={reload}
|
||||
reload={() => display.reload()}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -778,7 +778,7 @@ export default function DataGridCore(props) {
|
||||
function handleGridKeyDown(event) {
|
||||
if (event.keyCode == keycodes.f5) {
|
||||
event.preventDefault();
|
||||
reload();
|
||||
display.reload();
|
||||
}
|
||||
|
||||
if (event.keyCode == keycodes.s && event.ctrlKey) {
|
||||
@@ -1116,7 +1116,7 @@ export default function DataGridCore(props) {
|
||||
tabVisible &&
|
||||
ReactDOM.createPortal(
|
||||
<DataGridToolbar
|
||||
reload={reload}
|
||||
reload={() => display.reload()}
|
||||
save={handleSave}
|
||||
changeSetState={changeSetState}
|
||||
dispatchChangeSet={dispatchChangeSet}
|
||||
|
||||
@@ -11,11 +11,9 @@ import usePropsCompare from '../utility/usePropsCompare';
|
||||
import { useUpdateDatabaseForTab } from '../utility/globalState';
|
||||
|
||||
export default function TableDataTab({ conid, database, schemaName, pureName, tabVisible, toolbarPortalRef }) {
|
||||
const tableInfo = useTableInfo({ conid, database, schemaName, pureName });
|
||||
const [config, setConfig] = React.useState(createGridConfig());
|
||||
const [cache, setCache] = React.useState(createGridCache());
|
||||
const [changeSetState, dispatchChangeSet] = useUndoReducer(createChangeSet());
|
||||
|
||||
useUpdateDatabaseForTab(tabVisible, conid, database);
|
||||
const connection = useConnectionInfo({ conid });
|
||||
// console.log('GOT CONNECTION', connection);
|
||||
@@ -24,12 +22,18 @@ export default function TableDataTab({ conid, database, schemaName, pureName, ta
|
||||
|
||||
const display = React.useMemo(
|
||||
() =>
|
||||
tableInfo && connection
|
||||
? new TableGridDisplay(tableInfo, engines(connection), config, setConfig, cache, setCache, (name) =>
|
||||
getTableInfo({ conid, database, ...name })
|
||||
connection
|
||||
? new TableGridDisplay(
|
||||
{ schemaName, pureName },
|
||||
engines(connection),
|
||||
config,
|
||||
setConfig,
|
||||
cache,
|
||||
setCache,
|
||||
(name) => getTableInfo({ conid, database, ...name })
|
||||
)
|
||||
: null,
|
||||
[tableInfo, connection, config, cache]
|
||||
[connection, config, cache]
|
||||
);
|
||||
|
||||
if (!display) return null;
|
||||
|
||||
Reference in New Issue
Block a user