mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 08:26:01 +00:00
statusbar - show current database
This commit is contained in:
@@ -1,25 +1,11 @@
|
||||
import React from 'react';
|
||||
import { MicrosoftIcon, SqliteIcon, PostgreSqlIcon, MySqlIcon, ServerIcon } from '../icons';
|
||||
import { getEngineIcon } from '../icons';
|
||||
import { DropDownMenuItem } from '../modals/DropDownMenu';
|
||||
import showModal from '../modals/showModal';
|
||||
import ConnectionModal from '../modals/ConnectionModal';
|
||||
import axios from '../utility/axios';
|
||||
import { filterName } from '@dbgate/datalib';
|
||||
|
||||
function getIcon(engine) {
|
||||
switch (engine) {
|
||||
case 'mssql':
|
||||
return MicrosoftIcon;
|
||||
case 'sqlite':
|
||||
return SqliteIcon;
|
||||
case 'postgres':
|
||||
return PostgreSqlIcon;
|
||||
case 'mysql':
|
||||
return MySqlIcon;
|
||||
}
|
||||
return ServerIcon;
|
||||
}
|
||||
|
||||
function Menu({ data, makeAppObj }) {
|
||||
const handleEdit = () => {
|
||||
showModal(modalState => <ConnectionModal modalState={modalState} connection={data} />);
|
||||
@@ -38,7 +24,7 @@ function Menu({ data, makeAppObj }) {
|
||||
export default function connectionAppObject({ _id, server, displayName, engine }) {
|
||||
const title = displayName || server;
|
||||
const key = _id;
|
||||
const Icon = getIcon(engine);
|
||||
const Icon = getEngineIcon(engine);
|
||||
const matcher = filter => filterName(filter, displayName, server);
|
||||
|
||||
return { title, key, Icon, Menu, matcher };
|
||||
|
||||
Reference in New Issue
Block a user