Skip to content

Commit

Permalink
Add setup button to monitoring toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
estermv committed Sep 3, 2021
1 parent 3ed7ab9 commit 3961c51
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,7 @@ export const PageTemplate: React.FC<PageTemplateProps> = ({ title, pageTitle, ta

return (
<div className="app-container">
<EuiFlexGroup gutterSize="l" justifyContent="spaceBetween" responsive>
<EuiFlexItem>
<EuiFlexGroup
gutterSize="none"
justifyContent="spaceEvenly"
direction="column"
responsive
>
<EuiFlexItem>
<div id="setupModeNav">{/* HERE GOES THE SETUP BUTTON */}</div>
</EuiFlexItem>
<EuiFlexItem className="monTopNavSecondItem">
{pageTitle && (
<div data-test-subj="monitoringPageTitle">
<EuiTitle size="xs">
<h1>{pageTitle}</h1>
</EuiTitle>
</div>
)}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>

<EuiFlexItem>
<MonitoringToolbar />
</EuiFlexItem>
</EuiFlexGroup>

<MonitoringToolbar pageTitle={pageTitle} />
{tabs && (
<EuiTabs>
{tabs.map((item, idx) => {
Expand Down
54 changes: 41 additions & 13 deletions x-pack/plugins/monitoring/public/components/shared/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem, EuiSuperDatePicker, OnRefreshChangeProps } from '@elastic/eui';
import {
EuiFlexGroup,
EuiFlexItem,
EuiSuperDatePicker,
EuiTitle,
OnRefreshChangeProps,
} from '@elastic/eui';
import React, { useContext, useCallback } from 'react';
import { MonitoringTimeContainer } from '../../application/pages/use_monitoring_time';

export const MonitoringToolbar = () => {
interface MonitoringToolbarProps {
pageTitle?: string;
}

export const MonitoringToolbar: React.FC<MonitoringToolbarProps> = ({ pageTitle }) => {
const {
currentTimerange,
handleTimeChange,
Expand Down Expand Up @@ -38,18 +48,36 @@ export const MonitoringToolbar = () => {
);

return (
<EuiFlexGroup gutterSize={'xl'} justifyContent={'spaceBetween'}>
<EuiFlexItem>Setup Button</EuiFlexItem>
<EuiFlexGroup gutterSize="l" justifyContent="spaceBetween" responsive>
<EuiFlexItem>
<EuiFlexGroup gutterSize="none" justifyContent="spaceEvenly" direction="column" responsive>
<EuiFlexItem>
<div id="setupModeNav">{/* HERE GOES THE SETUP BUTTON */}</div>
</EuiFlexItem>
<EuiFlexItem className="monTopNavSecondItem">
{pageTitle && (
<div data-test-subj="monitoringPageTitle">
<EuiTitle size="xs">
<h1>{pageTitle}</h1>
</EuiTitle>
</div>
)}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiSuperDatePicker
start={currentTimerange.from}
end={currentTimerange.to}
onTimeChange={onTimeChange}
onRefresh={() => {}}
isPaused={isPaused}
refreshInterval={refreshInterval}
onRefreshChange={onRefreshChange}
/>
<div style={{ padding: 8 }}>
<EuiSuperDatePicker
start={currentTimerange.from}
end={currentTimerange.to}
onTimeChange={onTimeChange}
onRefresh={() => {}}
isPaused={isPaused}
refreshInterval={refreshInterval}
onRefreshChange={onRefreshChange}
/>
</div>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down

0 comments on commit 3961c51

Please sign in to comment.