mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
better display engine
This commit is contained in:
@@ -10,6 +10,7 @@ import { useCurrentDatabase, useOpenedConnections, useSetOpenedConnections } fro
|
||||
import { AppObjectCore } from './AppObjectCore';
|
||||
import useShowModal from '../modals/showModal';
|
||||
import { useConfig } from '../utility/metadataLoaders';
|
||||
import useExtensions from '../utility/useExtensions';
|
||||
|
||||
function Menu({ data }) {
|
||||
const openedConnections = useOpenedConnections();
|
||||
@@ -68,6 +69,7 @@ function ConnectionAppObject({ data, commonProps }) {
|
||||
const openedConnections = useOpenedConnections();
|
||||
const setOpenedConnections = useSetOpenedConnections();
|
||||
const currentDatabase = useCurrentDatabase();
|
||||
const extensions = useExtensions();
|
||||
|
||||
const isBold = _.get(currentDatabase, 'connection._id') == _id;
|
||||
const onClick = () => setOpenedConnections((c) => [...c, _id]);
|
||||
@@ -83,7 +85,15 @@ function ConnectionAppObject({ data, commonProps }) {
|
||||
statusTitle = status.message;
|
||||
}
|
||||
}
|
||||
const extInfo = engine;
|
||||
let extInfo = null;
|
||||
if (extensions.drivers.find((x) => x.engine == engine)) {
|
||||
const match = (engine || '').match(/^([^@]*)@/);
|
||||
extInfo = match ? match[1] : engine;
|
||||
} else {
|
||||
extInfo = engine;
|
||||
statusIcon = 'img warn';
|
||||
statusTitle = `Engine driver ${engine} not found, review installed plugins and change engine in edit connection dialog`;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppObjectCore
|
||||
|
||||
@@ -47,6 +47,7 @@ const iconNames = {
|
||||
'img ok': 'mdi mdi-check-circle color-green-8',
|
||||
'img alert': 'mdi mdi-alert-circle color-blue-6',
|
||||
'img error': 'mdi mdi-close-circle color-red-7',
|
||||
'img warn': 'mdi mdi-alert color-gold-7',
|
||||
// 'img statusbar-ok': 'mdi mdi-check-circle color-on-statusbar-green',
|
||||
|
||||
'img archive': 'mdi mdi-table color-gold-7',
|
||||
|
||||
Reference in New Issue
Block a user