mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
handle disconnected database
This commit is contained in:
@@ -27,6 +27,12 @@ const sqlObjectListLoader = ({ conid, database }) => ({
|
||||
reloadTrigger: [`database-structure-changed-${conid}-${database}`, `database-status-changed-${conid}-${database}`],
|
||||
});
|
||||
|
||||
const databaseStatusLoader = ({ conid, database }) => ({
|
||||
url: 'database-connections/status',
|
||||
params: { conid, database },
|
||||
reloadTrigger: `database-status-changed-${conid}-${database}`,
|
||||
});
|
||||
|
||||
const databaseListLoader = ({ conid }) => ({
|
||||
url: 'server-connections/list-databases',
|
||||
params: { conid },
|
||||
@@ -125,6 +131,13 @@ export function useSqlObjectList(args) {
|
||||
return useCore(sqlObjectListLoader, args);
|
||||
}
|
||||
|
||||
export function getDatabaseStatus(args) {
|
||||
return getCore(databaseStatusLoader, args);
|
||||
}
|
||||
export function useDatabaseStatus(args) {
|
||||
return useCore(databaseStatusLoader, args);
|
||||
}
|
||||
|
||||
export function getDatabaseList(args) {
|
||||
return getCore(databaseListLoader, args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user