forked from dbeaver/cloudbeaver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core-app): CB-868 add log viewer info panel
- Loading branch information
Showing
18 changed files
with
364 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
webapp/packages/core-app/src/shared/ToolsPanel/LogViewTab/LogEntry/LogEntryController.ts
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
webapp/packages/core-app/src/shared/ToolsPanel/LogViewTab/LogEntry/LogEntryDetailsDialog.tsx
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
webapp/packages/core-app/src/shared/ToolsPanel/LogViewTab/LogViewTab.tsx
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
webapp/packages/core-app/src/shared/ToolsPanel/LogViewTab/LogViewTabController.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
webapp/packages/core-app/src/shared/ToolsPanel/LogViewer/LogViewer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2021 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
import { observer } from 'mobx-react-lite'; | ||
import styled, { css } from 'reshadow'; | ||
|
||
import { Pane, ResizerControls, Split, splitStyles } from '@cloudbeaver/core-blocks'; | ||
import { composes, useStyles } from '@cloudbeaver/core-theming'; | ||
|
||
import { LogViewerInfoPanel } from './LogViewerInfoPanel'; | ||
import { LogViewerTable } from './LogViewerTable'; | ||
import { useLogViewer } from './useLogViewer'; | ||
|
||
const styles = composes( | ||
css` | ||
pane-content { | ||
composes: theme-background-surface theme-text-on-surface from global; | ||
} | ||
`, | ||
css` | ||
log-view-wrapper, Pane, pane-content { | ||
position: relative; | ||
display: flex; | ||
flex: 1; | ||
flex-direction: column; | ||
overflow: hidden; | ||
} | ||
`); | ||
|
||
export const LogViewer = observer(function LogViewer() { | ||
const style = useStyles(styles, splitStyles); | ||
const logViewerState = useLogViewer(); | ||
|
||
if (!logViewerState.isActive) { | ||
return null; | ||
} | ||
|
||
return styled(style)( | ||
<log-view-wrapper as='div'> | ||
<Split mode={logViewerState.selectedItem ? undefined : 'maximize'} keepRatio> | ||
<Pane main> | ||
<pane-content as='div'> | ||
<LogViewerTable | ||
items={logViewerState.logItems} | ||
selectedItem={logViewerState.selectedItem} | ||
onClearTable={logViewerState.clearLog} | ||
onItemSelect={logViewerState.selectItem} | ||
/> | ||
</pane-content> | ||
</Pane> | ||
{logViewerState.selectedItem && ( | ||
<> | ||
<ResizerControls /> | ||
<Pane> | ||
<pane-content as='div'> | ||
<LogViewerInfoPanel | ||
selectedItem={logViewerState.selectedItem} | ||
onClose={logViewerState.closeInfoPanel} | ||
/> | ||
</pane-content> | ||
</Pane> | ||
</> | ||
)} | ||
</Split> | ||
</log-view-wrapper> | ||
); | ||
}); |
Oops, something went wrong.