mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 18:55:59 +00:00
handle not found connection in ConnectionTab
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
} from '../stores';
|
} from '../stores';
|
||||||
import _, { Dictionary } from 'lodash';
|
import _, { Dictionary } from 'lodash';
|
||||||
import { apiCall } from '../utility/api';
|
import { apiCall } from '../utility/api';
|
||||||
import { showSnackbarSuccess } from '../utility/snackbar';
|
import { showSnackbarError, showSnackbarSuccess } from '../utility/snackbar';
|
||||||
import { changeTab } from '../utility/common';
|
import { changeTab } from '../utility/common';
|
||||||
import getConnectionLabel from '../utility/getConnectionLabel';
|
import getConnectionLabel from '../utility/getConnectionLabel';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
@@ -47,6 +47,9 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// $: console.log('ConnectionTab.$values', $values);
|
||||||
|
// $: console.log('ConnectionTab.driver', driver);
|
||||||
|
|
||||||
$: engine = $values.engine;
|
$: engine = $values.engine;
|
||||||
$: driver = $extensions.drivers.find(x => x.engine == engine);
|
$: driver = $extensions.drivers.find(x => x.engine == engine);
|
||||||
|
|
||||||
@@ -161,7 +164,12 @@
|
|||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if (conid) {
|
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}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user