-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Empty View and Side Bar (#1154)
* Added Metrics Home Page and date picker Signed-off-by: Sean Li <[email protected]> * Minor changes Signed-off-by: Sean Li <[email protected]> * Adding empty view and sidebar Signed-off-by: Sean Li <[email protected]> Signed-off-by: Sean Li <[email protected]>
- Loading branch information
Showing
4 changed files
with
151 additions
and
16 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
dashboards-observability/public/components/metrics/index.scss
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,24 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#opensearch-dashboards-body { | ||
overflow-y: hidden; | ||
} | ||
|
||
.liveStream { | ||
margin : 8px; | ||
height: 40px; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: row; | ||
display: flex; | ||
flex-grow: 1; | ||
vertical-align: baseline; | ||
} | ||
|
||
.mainContentTabs .euiResizableContainer { | ||
height: calc(100vh - 298px); | ||
} | ||
|
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
57 changes: 57 additions & 0 deletions
57
dashboards-observability/public/components/metrics/sidebar/sidebar.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,57 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
import { isEmpty } from 'lodash'; | ||
import { EuiTitle, EuiSpacer, EuiFieldSearch, EuiAccordion } from '@elastic/eui'; | ||
import { I18nProvider } from '@osd/i18n/react'; | ||
|
||
interface ISidebarProps { | ||
// recentlyCreatedFields: any; | ||
// selectedFields: any; | ||
// availableFields: any; | ||
} | ||
|
||
export const Sidebar = (props: ISidebarProps) => { | ||
// const { recentlyCreatedFields } = props; | ||
const [showFields, setShowFields] = useState<boolean>(false); | ||
const [searchTerm, setSearchTerm] = useState<string>(''); | ||
|
||
return ( | ||
<I18nProvider> | ||
<section className="sidebar-list"> | ||
<EuiAccordion | ||
initialIsOpen | ||
id="recentlyCreatedMetricsSelector" | ||
buttonContent={ | ||
<EuiTitle size="xxxs"> | ||
<span>Recently Created Fields</span> | ||
</EuiTitle> | ||
} | ||
paddingSize="xs" | ||
/> | ||
<EuiSpacer size="s" /> | ||
<EuiAccordion | ||
initialIsOpen | ||
id="selectedMetricsSelector" | ||
buttonContent={ | ||
<EuiTitle size="xxxs"> | ||
<span>Selected Metrics</span> | ||
</EuiTitle> | ||
} | ||
/><EuiSpacer size="s" /> | ||
<EuiAccordion | ||
initialIsOpen | ||
id="selectedMetricsSelector" | ||
buttonContent={ | ||
<EuiTitle size="xxxs"> | ||
<span>Available Metrics</span> | ||
</EuiTitle> | ||
} | ||
/> | ||
</section> | ||
</I18nProvider> | ||
); | ||
}; |
24 changes: 24 additions & 0 deletions
24
dashboards-observability/public/components/metrics/view/empty_view.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,24 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { EuiSpacer, EuiText, EuiIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import React, { useState } from 'react'; | ||
|
||
export const EmptyMetricsView = () => { | ||
return ( | ||
<div> | ||
<EuiSpacer size="xxl" /> | ||
<EuiText textAlign="center"> | ||
<EuiIcon type="minusInCircle" size="xxl" /> | ||
<EuiSpacer size="s" /> | ||
<h2>No Metrics Selected</h2> | ||
<EuiSpacer size="m" /> | ||
<EuiText color="subdued" size="m"> | ||
Select a metric from the left sidepanel to view results. | ||
</EuiText> | ||
</EuiText> | ||
</div> | ||
); | ||
}; |