mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 16:23:58 +00:00
fixes
This commit is contained in:
@@ -25,7 +25,10 @@
|
|||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'connection':
|
case 'connection':
|
||||||
const conn = await apiCall('connections/get', { conid: data.conid });
|
const conn = await apiCall('connections/get', { conid: data.conid });
|
||||||
$cloudConnectionsStore[data.conid] = conn;
|
$cloudConnectionsStore = {
|
||||||
|
...$cloudConnectionsStore,
|
||||||
|
[data.conid]: conn,
|
||||||
|
};
|
||||||
openConnection(conn);
|
openConnection(conn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -34,6 +37,7 @@
|
|||||||
|
|
||||||
{#if data.conid && $cloudConnectionsStore[data.conid]}
|
{#if data.conid && $cloudConnectionsStore[data.conid]}
|
||||||
<ConnectionAppObject
|
<ConnectionAppObject
|
||||||
|
{...$$restProps}
|
||||||
{passProps}
|
{passProps}
|
||||||
data={{
|
data={{
|
||||||
...$cloudConnectionsStore[data.conid],
|
...$cloudConnectionsStore[data.conid],
|
||||||
|
|||||||
@@ -14,12 +14,19 @@
|
|||||||
import InlineButton from '../buttons/InlineButton.svelte';
|
import InlineButton from '../buttons/InlineButton.svelte';
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import { apiCall } from '../utility/api';
|
import { apiCall } from '../utility/api';
|
||||||
import { cloudConnectionsStore, cloudSigninToken, expandedConnections, openedConnections } from '../stores';
|
import {
|
||||||
|
cloudConnectionsStore,
|
||||||
|
cloudSigninToken,
|
||||||
|
currentDatabase,
|
||||||
|
expandedConnections,
|
||||||
|
openedConnections,
|
||||||
|
} from '../stores';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { plusExpandIcon } from '../icons/expandIcons';
|
import { plusExpandIcon } from '../icons/expandIcons';
|
||||||
import { volatileConnectionMapStore } from '../utility/api';
|
import { volatileConnectionMapStore } from '../utility/api';
|
||||||
import SubCloudItemsList from '../appobj/SubCloudItemsList.svelte';
|
import SubCloudItemsList from '../appobj/SubCloudItemsList.svelte';
|
||||||
import DatabaseWidgetDetailContent from './DatabaseWidgetDetailContent.svelte';
|
import DatabaseWidgetDetailContent from './DatabaseWidgetDetailContent.svelte';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
let publicFilter = '';
|
let publicFilter = '';
|
||||||
let cloudFilter = '';
|
let cloudFilter = '';
|
||||||
@@ -52,6 +59,21 @@
|
|||||||
async function handleRefreshContent() {
|
async function handleRefreshContent() {
|
||||||
await apiCall('cloud/refresh-content');
|
await apiCall('cloud/refresh-content');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loadCloudConnection(conid) {
|
||||||
|
const conn = await apiCall('connections/get', { conid });
|
||||||
|
$cloudConnectionsStore = {
|
||||||
|
...$cloudConnectionsStore,
|
||||||
|
[conid]: conn,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
const currentConid = $currentDatabase?.connection?._id;
|
||||||
|
if (currentConid?.startsWith('cloud://') && !$cloudConnectionsStore[currentConid]) {
|
||||||
|
loadCloudConnection(currentConid);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<WidgetColumnBar>
|
<WidgetColumnBar>
|
||||||
|
|||||||
Reference in New Issue
Block a user