mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
loaders
This commit is contained in:
parent
cfc44e4f2f
commit
d1766bf999
@ -22,7 +22,6 @@ module.exports = {
|
||||
(res, type) => ({
|
||||
...res,
|
||||
[type]: pickObjectNames(opened.structure[type]),
|
||||
status: opened.status,
|
||||
}),
|
||||
{}
|
||||
);
|
||||
|
@ -446,7 +446,15 @@ export default function DataGridCore(props) {
|
||||
}
|
||||
}, [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 rowCountNewIncluded = loadedRows.length + insertedRows.length;
|
||||
|
||||
|
@ -24,7 +24,7 @@ const connectionInfoLoader = ({ conid }) => ({
|
||||
const sqlObjectListLoader = ({ conid, database }) => ({
|
||||
url: 'metadata/list-objects',
|
||||
params: { conid, database },
|
||||
reloadTrigger: [`database-structure-changed-${conid}-${database}`, `database-status-changed-${conid}-${database}`],
|
||||
reloadTrigger: `database-structure-changed-${conid}-${database}`,
|
||||
});
|
||||
|
||||
const databaseStatusLoader = ({ conid, database }) => ({
|
||||
|
@ -7,7 +7,7 @@ import databaseAppObject from '../appobj/databaseAppObject';
|
||||
import { useSetCurrentDatabase, useCurrentDatabase, useOpenedConnections } from '../utility/globalState';
|
||||
import InlineButton from './InlineButton';
|
||||
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 axios from '../utility/axios';
|
||||
import LoadingInfo from './LoadingInfo';
|
||||
@ -69,7 +69,7 @@ function ConnectionList() {
|
||||
|
||||
function SqlObjectList({ conid, database }) {
|
||||
const objects = useSqlObjectList({ conid, database });
|
||||
const { status } = objects || {};
|
||||
const status = useDatabaseStatus({ conid, database });
|
||||
|
||||
const handleRefreshDatabase = () => {
|
||||
axios.post('database-connections/refresh', { conid, database });
|
||||
|
Loading…
Reference in New Issue
Block a user