server connections handling

This commit is contained in:
Jan Prochazka
2020-05-01 11:41:18 +02:00
parent 44c19ad277
commit ca7eea8a05
11 changed files with 284 additions and 71 deletions

View File

@@ -33,6 +33,12 @@ const databaseListLoader = ({ conid }) => ({
reloadTrigger: `database-list-changed-${conid}`,
});
const serverStatusLoader = () => ({
url: 'server-connections/server-status',
params: {},
reloadTrigger: `server-status-changed`,
});
const connectionListLoader = () => ({
url: 'connections/list',
params: {},
@@ -126,6 +132,13 @@ export function useDatabaseList(args) {
return useCore(databaseListLoader, args);
}
export function getServerStatus() {
return getCore(serverStatusLoader, {});
}
export function useServerStatus() {
return useCore(serverStatusLoader, {});
}
export function getConnectionList() {
return getCore(connectionListLoader, {});
}