-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated visualization to embeddables
- Loading branch information
1 parent
9a0a9a5
commit f67de9b
Showing
4 changed files
with
746 additions
and
1 deletion.
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
58 changes: 58 additions & 0 deletions
58
plugins/main/public/components/overview/amazon-web-services/dashboards/dashboard.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,58 @@ | ||
import React from 'react'; | ||
import { getPlugins } from '../../../../kibana-services'; | ||
import { ViewMode } from '../../../../../../../src/plugins/embeddable/public'; | ||
import { getDashboardPanels } from './dashboard_panels'; | ||
import { I18nProvider } from '@osd/i18n/react'; | ||
import useSearchBar from '../../../common/search-bar/use-search-bar'; | ||
import { WAZUH_ALERTS_PATTERN } from '../../../../../common/constants'; | ||
|
||
const plugins = getPlugins(); | ||
|
||
const SearchBar = getPlugins().data.ui.SearchBar; | ||
|
||
const DashboardByRenderer = plugins.dashboard.DashboardContainerByValueRenderer; | ||
|
||
export const DashboardAWS: React.FC = () => { | ||
const INDEX_PATTERN_ID = WAZUH_ALERTS_PATTERN; | ||
|
||
const { searchBarProps } = useSearchBar({ | ||
defaultIndexPatternID: INDEX_PATTERN_ID, | ||
filters: [], | ||
}); | ||
|
||
return ( | ||
<> | ||
<I18nProvider> | ||
<SearchBar | ||
appName='aws-searchbar' | ||
{...searchBarProps} | ||
showDatePicker={false} | ||
showQueryInput={true} | ||
showQueryBar={true} | ||
/> | ||
</I18nProvider> | ||
<DashboardByRenderer | ||
input={{ | ||
viewMode: ViewMode.VIEW, | ||
panels: getDashboardPanels(INDEX_PATTERN_ID), | ||
isFullScreenMode: false, | ||
filters: searchBarProps.filters ?? [], | ||
useMargins: true, | ||
id: 'aws-dashboard-tab', | ||
timeRange: { | ||
from: searchBarProps.dateRangeFrom, | ||
to: searchBarProps.dateRangeTo, | ||
}, | ||
title: 'AWS dashboard', | ||
description: 'Dashboard of the AWS', | ||
query: searchBarProps.query, | ||
refreshConfig: { | ||
pause: false, | ||
value: 15, | ||
}, | ||
hidePanelTitles: false, | ||
}} | ||
/> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.