mirror of
https://github.com/dbgate/dbgate
synced 2024-11-21 23:39:46 +00:00
handle not found connection in ConnectionTab
This commit is contained in:
parent
4fb6b49b86
commit
f74e57bec2
@ -26,7 +26,7 @@
|
||||
} from '../stores';
|
||||
import _, { Dictionary } from 'lodash';
|
||||
import { apiCall } from '../utility/api';
|
||||
import { showSnackbarSuccess } from '../utility/snackbar';
|
||||
import { showSnackbarError, showSnackbarSuccess } from '../utility/snackbar';
|
||||
import { changeTab } from '../utility/common';
|
||||
import getConnectionLabel from '../utility/getConnectionLabel';
|
||||
import { onMount } from 'svelte';
|
||||
@ -47,6 +47,9 @@
|
||||
}
|
||||
);
|
||||
|
||||
// $: console.log('ConnectionTab.$values', $values);
|
||||
// $: console.log('ConnectionTab.driver', driver);
|
||||
|
||||
$: engine = $values.engine;
|
||||
$: driver = $extensions.drivers.find(x => x.engine == engine);
|
||||
|
||||
@ -161,7 +164,12 @@
|
||||
|
||||
onMount(async () => {
|
||||
if (conid) {
|
||||
$values = await apiCall('connections/get', { conid });
|
||||
const con = await apiCall('connections/get', { conid });
|
||||
if (con) {
|
||||
$values = con;
|
||||
} else {
|
||||
showSnackbarError(`Connection not found: ${conid}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user