mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 01:46:02 +00:00
loaders
This commit is contained in:
@@ -22,7 +22,6 @@ module.exports = {
|
|||||||
(res, type) => ({
|
(res, type) => ({
|
||||||
...res,
|
...res,
|
||||||
[type]: pickObjectNames(opened.structure[type]),
|
[type]: pickObjectNames(opened.structure[type]),
|
||||||
status: opened.status,
|
|
||||||
}),
|
}),
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -446,7 +446,15 @@ export default function DataGridCore(props) {
|
|||||||
}
|
}
|
||||||
}, [display && display.focusedColumn]);
|
}, [display && display.focusedColumn]);
|
||||||
|
|
||||||
if (!loadedRows || !columns) return null;
|
if (!loadedRows || !columns || columns.length == 0)
|
||||||
|
return (
|
||||||
|
<LoadingInfoWrapper>
|
||||||
|
<LoadingInfoBox>
|
||||||
|
<LoadingInfo message="Waiting for structure" />
|
||||||
|
</LoadingInfoBox>
|
||||||
|
</LoadingInfoWrapper>
|
||||||
|
);
|
||||||
|
|
||||||
const insertedRows = getChangeSetInsertedRows(changeSet, display.baseTable);
|
const insertedRows = getChangeSetInsertedRows(changeSet, display.baseTable);
|
||||||
const rowCountNewIncluded = loadedRows.length + insertedRows.length;
|
const rowCountNewIncluded = loadedRows.length + insertedRows.length;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const connectionInfoLoader = ({ conid }) => ({
|
|||||||
const sqlObjectListLoader = ({ conid, database }) => ({
|
const sqlObjectListLoader = ({ conid, database }) => ({
|
||||||
url: 'metadata/list-objects',
|
url: 'metadata/list-objects',
|
||||||
params: { conid, database },
|
params: { conid, database },
|
||||||
reloadTrigger: [`database-structure-changed-${conid}-${database}`, `database-status-changed-${conid}-${database}`],
|
reloadTrigger: `database-structure-changed-${conid}-${database}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
const databaseStatusLoader = ({ conid, database }) => ({
|
const databaseStatusLoader = ({ conid, database }) => ({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import databaseAppObject from '../appobj/databaseAppObject';
|
|||||||
import { useSetCurrentDatabase, useCurrentDatabase, useOpenedConnections } from '../utility/globalState';
|
import { useSetCurrentDatabase, useCurrentDatabase, useOpenedConnections } from '../utility/globalState';
|
||||||
import InlineButton from './InlineButton';
|
import InlineButton from './InlineButton';
|
||||||
import databaseObjectAppObject from '../appobj/databaseObjectAppObject';
|
import databaseObjectAppObject from '../appobj/databaseObjectAppObject';
|
||||||
import { useSqlObjectList, useDatabaseList, useConnectionList, useServerStatus } from '../utility/metadataLoaders';
|
import { useSqlObjectList, useDatabaseList, useConnectionList, useServerStatus, useDatabaseStatus } from '../utility/metadataLoaders';
|
||||||
import { SearchBoxWrapper, InnerContainer, Input, MainContainer, OuterContainer, WidgetTitle } from './WidgetStyles';
|
import { SearchBoxWrapper, InnerContainer, Input, MainContainer, OuterContainer, WidgetTitle } from './WidgetStyles';
|
||||||
import axios from '../utility/axios';
|
import axios from '../utility/axios';
|
||||||
import LoadingInfo from './LoadingInfo';
|
import LoadingInfo from './LoadingInfo';
|
||||||
@@ -69,7 +69,7 @@ function ConnectionList() {
|
|||||||
|
|
||||||
function SqlObjectList({ conid, database }) {
|
function SqlObjectList({ conid, database }) {
|
||||||
const objects = useSqlObjectList({ conid, database });
|
const objects = useSqlObjectList({ conid, database });
|
||||||
const { status } = objects || {};
|
const status = useDatabaseStatus({ conid, database });
|
||||||
|
|
||||||
const handleRefreshDatabase = () => {
|
const handleRefreshDatabase = () => {
|
||||||
axios.post('database-connections/refresh', { conid, database });
|
axios.post('database-connections/refresh', { conid, database });
|
||||||
|
|||||||
Reference in New Issue
Block a user