mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 23:05:59 +00:00
connection list refresh
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
import * as connectionAppObject from '../appobj/ConnectionAppObject.svelte';
|
import * as connectionAppObject from '../appobj/ConnectionAppObject.svelte';
|
||||||
import SubDatabaseList from '../appobj/SubDatabaseList.svelte';
|
import SubDatabaseList from '../appobj/SubDatabaseList.svelte';
|
||||||
import { openedConnections } from '../stores';
|
import { openedConnections } from '../stores';
|
||||||
|
import axiosInstance from '../utility/axiosInstance';
|
||||||
|
|
||||||
const connections = useConnectionList();
|
const connections = useConnectionList();
|
||||||
const serverStatus = useServerStatus();
|
const serverStatus = useServerStatus();
|
||||||
@@ -19,11 +20,17 @@
|
|||||||
$connections && $serverStatus
|
$connections && $serverStatus
|
||||||
? $connections.map(conn => ({ ...conn, status: $serverStatus[conn._id] }))
|
? $connections.map(conn => ({ ...conn, status: $serverStatus[conn._id] }))
|
||||||
: $connections;
|
: $connections;
|
||||||
|
|
||||||
|
const handleRefreshConnections = () => {
|
||||||
|
for (const conid of $openedConnections) {
|
||||||
|
axiosInstance.post('server-connections/refresh', { conid });
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SearchBoxWrapper>
|
<SearchBoxWrapper>
|
||||||
<SearchInput placeholder="Search connection" bind:value={filter} />
|
<SearchInput placeholder="Search connection" bind:value={filter} />
|
||||||
<InlineButton>Refresh</InlineButton>
|
<InlineButton on:click={handleRefreshConnections}>Refresh</InlineButton>
|
||||||
</SearchBoxWrapper>
|
</SearchBoxWrapper>
|
||||||
<WidgetsInnerContainer>
|
<WidgetsInnerContainer>
|
||||||
<AppObjectList
|
<AppObjectList
|
||||||
|
|||||||
Reference in New Issue
Block a user