mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 16:06:01 +00:00
introduced yarn workspace
This commit is contained in:
29
packages/web/src/appobj/databaseAppObject.js
Normal file
29
packages/web/src/appobj/databaseAppObject.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { DatabaseIcon } from '../icons';
|
||||
import { DropDownMenuItem } from '../modals/DropDownMenu';
|
||||
import showModal from '../modals/showModal';
|
||||
import ConnectionModal from '../modals/ConnectionModal';
|
||||
import axios from '../utility/axios';
|
||||
|
||||
function Menu({ data, makeAppObj }) {
|
||||
const handleEdit = () => {
|
||||
showModal(modalState => <ConnectionModal modalState={modalState} connection={data} />);
|
||||
};
|
||||
const handleDelete = () => {
|
||||
axios.post('connections/delete', data);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<DropDownMenuItem onClick={handleEdit}>Edit</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={handleDelete}>Delete</DropDownMenuItem>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function databaseAppObject({ name }) {
|
||||
const title = name;
|
||||
const key = name;
|
||||
const Icon = DatabaseIcon;
|
||||
|
||||
return { title, key, Icon, Menu };
|
||||
}
|
||||
Reference in New Issue
Block a user