mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55:59 +00:00
query - busy indicator, canceling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import _ from 'lodash'
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { showMenu } from '../modals/DropDownMenu';
|
||||
@@ -13,12 +13,12 @@ const AppObjectDiv = styled.div`
|
||||
}
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
font-weight: ${props => (props.isBold ? 'bold' : 'normal')};
|
||||
font-weight: ${(props) => (props.isBold ? 'bold' : 'normal')};
|
||||
`;
|
||||
|
||||
const AppObjectSpan = styled.span`
|
||||
white-space: nowrap;
|
||||
font-weight: ${props => (props.isBold ? 'bold' : 'normal')};
|
||||
font-weight: ${(props) => (props.isBold ? 'bold' : 'normal')};
|
||||
`;
|
||||
|
||||
const IconWrap = styled.span`
|
||||
@@ -33,13 +33,14 @@ export function AppObjectCore({
|
||||
makeAppObj,
|
||||
onClick,
|
||||
isBold,
|
||||
isBusy,
|
||||
component = 'div',
|
||||
prefix = null,
|
||||
...other
|
||||
}) {
|
||||
const appObjectParams = useAppObjectParams();
|
||||
|
||||
const handleContextMenu = event => {
|
||||
const handleContextMenu = (event) => {
|
||||
if (!Menu) return;
|
||||
|
||||
event.preventDefault();
|
||||
@@ -60,9 +61,7 @@ export function AppObjectCore({
|
||||
{...other}
|
||||
>
|
||||
{prefix}
|
||||
<IconWrap>
|
||||
<Icon />
|
||||
</IconWrap>
|
||||
<IconWrap>{isBusy ? <i className="fas fa-spinner fa-spin"></i> : <Icon />}</IconWrap>
|
||||
{title}
|
||||
</Component>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import _ from 'lodash';
|
||||
import { getIconImage } from '../icons';
|
||||
|
||||
const openedTabAppObject = () => ({ tabid, props, selected, icon, title }, { setOpenedTabs }) => {
|
||||
const openedTabAppObject = () => ({ tabid, props, selected, icon, title, busy }, { setOpenedTabs }) => {
|
||||
const key = tabid;
|
||||
const Icon = (props) => getIconImage(icon, props);
|
||||
const isBold = !!selected;
|
||||
@@ -16,7 +16,7 @@ const openedTabAppObject = () => ({ tabid, props, selected, icon, title }, { set
|
||||
);
|
||||
};
|
||||
|
||||
return { title, key, Icon, isBold, onClick };
|
||||
return { title, key, Icon, isBold, onClick, isBusy: busy };
|
||||
};
|
||||
|
||||
export default openedTabAppObject;
|
||||
|
||||
Reference in New Issue
Block a user