mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fixes
This commit is contained in:
parent
3f8ff91e2c
commit
218478c128
@ -38,12 +38,12 @@ export function findObjectLike(
|
||||
if (!dbinfo) return null;
|
||||
if (schemaName) {
|
||||
// @ts-ignore
|
||||
return dbinfo[objectTypeField].find(
|
||||
return dbinfo[objectTypeField]?.find(
|
||||
x => equalStringLike(x.pureName, pureName) && equalStringLike(x.schemaName, schemaName)
|
||||
);
|
||||
}
|
||||
// @ts-ignore
|
||||
return dbinfo[objectTypeField].find(x => equalStringLike(x.pureName, pureName));
|
||||
return dbinfo[objectTypeField]?.find(x => equalStringLike(x.pureName, pureName));
|
||||
}
|
||||
|
||||
export function findForeignKeyForColumn(table: TableInfo, column: ColumnInfo) {
|
||||
|
@ -19,6 +19,18 @@
|
||||
onConfirm: () => axiosInstance.post('connections/delete', data),
|
||||
});
|
||||
};
|
||||
const handleCreateDatabase = () => {
|
||||
showModal(InputTextModal, {
|
||||
header: 'Create database',
|
||||
value: 'newdb',
|
||||
label: 'Database name',
|
||||
onConfirm: name =>
|
||||
axiosInstance.post('server-connections/create-database', {
|
||||
conid: data._id,
|
||||
name,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
return [
|
||||
config.runAsPortal == false && [
|
||||
@ -44,6 +56,10 @@
|
||||
text: 'Disconnect',
|
||||
onClick: handleDisconnect,
|
||||
},
|
||||
$openedConnections.includes(data._id) && {
|
||||
text: 'Create database',
|
||||
onClick: handleCreateDatabase,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
@ -60,6 +76,7 @@
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import ConnectionModal from '../modals/ConnectionModal.svelte';
|
||||
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
||||
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||
|
||||
export let data;
|
||||
|
||||
|
@ -20,7 +20,7 @@ window.onunhandledrejection = async e => {
|
||||
window.location.reload();
|
||||
}
|
||||
} else {
|
||||
if (window.confirm('Sorry, DbGate has crashed.\nPress OK for reload application')) {
|
||||
if (window.confirm('Sorry, DbGate has crashed.\nPress OK for reload application\nPress Cancel and inspect Console in Developer tools for error details')) {
|
||||
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
|
||||
window.location.reload();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user