mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 15:33:57 +00:00
fixes
This commit is contained in:
@@ -38,12 +38,12 @@ export function findObjectLike(
|
|||||||
if (!dbinfo) return null;
|
if (!dbinfo) return null;
|
||||||
if (schemaName) {
|
if (schemaName) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return dbinfo[objectTypeField].find(
|
return dbinfo[objectTypeField]?.find(
|
||||||
x => equalStringLike(x.pureName, pureName) && equalStringLike(x.schemaName, schemaName)
|
x => equalStringLike(x.pureName, pureName) && equalStringLike(x.schemaName, schemaName)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @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) {
|
export function findForeignKeyForColumn(table: TableInfo, column: ColumnInfo) {
|
||||||
|
|||||||
@@ -19,6 +19,18 @@
|
|||||||
onConfirm: () => axiosInstance.post('connections/delete', data),
|
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 [
|
return [
|
||||||
config.runAsPortal == false && [
|
config.runAsPortal == false && [
|
||||||
@@ -44,6 +56,10 @@
|
|||||||
text: 'Disconnect',
|
text: 'Disconnect',
|
||||||
onClick: handleDisconnect,
|
onClick: handleDisconnect,
|
||||||
},
|
},
|
||||||
|
$openedConnections.includes(data._id) && {
|
||||||
|
text: 'Create database',
|
||||||
|
onClick: handleCreateDatabase,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -60,6 +76,7 @@
|
|||||||
import { showModal } from '../modals/modalTools';
|
import { showModal } from '../modals/modalTools';
|
||||||
import ConnectionModal from '../modals/ConnectionModal.svelte';
|
import ConnectionModal from '../modals/ConnectionModal.svelte';
|
||||||
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
||||||
|
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ window.onunhandledrejection = async e => {
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
} else {
|
} 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()));
|
localStorage.setItem('lastDbGateCrash', JSON.stringify(new Date().getTime()));
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user