-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add 2 tabs to home screen Signed-off-by: Emily Guo <[email protected]> * two tabs for query insights and configuration Signed-off-by: Emily Guo <[email protected]> * Breadcrumbs + restructuring Signed-off-by: Emily Guo <[email protected]> * Top n queries table + search Signed-off-by: Emily Guo <[email protected]> * search in general Signed-off-by: Emily Guo <[email protected]> * Search includes indices and time selection fully works Signed-off-by: Emily Guo <[email protected]> * Fix tabs display Signed-off-by: Emily Guo <[email protected]> * Remove unnecessary parts Signed-off-by: Emily Guo <[email protected]> * More cleanups Signed-off-by: Emily Guo <[email protected]> * Linted Signed-off-by: Emily Guo <[email protected]> * Unused import Signed-off-by: Emily Guo <[email protected]> * Update plugin version to be compatible with openSearchDashboards Signed-off-by: Emily Guo <[email protected]> * Resolving comments Signed-off-by: Emily Guo <[email protected]> * Switch to typescript Signed-off-by: Emily Guo <[email protected]> * Finish typescript updates Signed-off-by: Emily Guo <[email protected]> * Comments addressed with constants Signed-off-by: Emily Guo <[email protected]> * Restructuring changes Signed-off-by: Emily Guo <[email protected]> * linting issues and ensure working on no data Signed-off-by: Emily Guo <[email protected]> * Added all relevant changes to overview page Signed-off-by: Emily Guo <[email protected]> * Remove unnecessary parts Signed-off-by: Emily Guo <[email protected]> * Fix unit test Signed-off-by: Emily Guo <[email protected]> --------- Signed-off-by: Emily Guo <[email protected]> Signed-off-by: Emily Guo <[email protected]> Signed-off-by: Emily Guo <[email protected]>
- Loading branch information
1 parent
ea632fc
commit 4987001
Showing
9 changed files
with
373 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ yarn-error.log | |
.DS_Store | ||
/cypress/screenshots/ | ||
/cypress/videos/ | ||
target | ||
target | ||
.eslintcache |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,8 @@ | ||
import React, { useState } from 'react'; | ||
import { i18n } from '@osd/i18n'; | ||
import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
import { | ||
EuiButton, | ||
EuiHorizontalRule, | ||
EuiPage, | ||
EuiPageBody, | ||
EuiPageContent, | ||
EuiPageContentBody, | ||
EuiPageContentHeader, | ||
EuiPageHeader, | ||
EuiTitle, | ||
EuiText, | ||
} from '@elastic/eui'; | ||
|
||
import React from 'react'; | ||
import { Route } from 'react-router-dom'; | ||
import TopNQueries from '../pages/TopNQueries/TopNQueries'; | ||
import { CoreStart } from '../../../../src/core/public'; | ||
import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public'; | ||
|
||
import { PLUGIN_ID, PLUGIN_NAME } from '../../common'; | ||
|
||
interface QueryInsightsDashboardsAppDeps { | ||
basename: string; | ||
notifications: CoreStart['notifications']; | ||
http: CoreStart['http']; | ||
navigation: NavigationPublicPluginStart; | ||
} | ||
|
||
export const QueryInsightsDashboardsApp = ({ | ||
basename, | ||
notifications, | ||
http, | ||
navigation, | ||
}: QueryInsightsDashboardsAppDeps) => { | ||
// Use React hooks to manage state. | ||
const [timestamp, setTimestamp] = useState<string | undefined>(); | ||
|
||
const onClickHandler = () => { | ||
// Use the core http service to make a response to the server API. | ||
http.get('/api/query_insights_dashboards/example').then((res) => { | ||
setTimestamp(res.time); | ||
// Use the core notifications service to display a success message. | ||
notifications.toasts.addSuccess( | ||
i18n.translate('queryInsightsDashboards.dataUpdated', { | ||
defaultMessage: 'Data updated', | ||
}) | ||
); | ||
}); | ||
}; | ||
|
||
// Render the application DOM. | ||
// Note that `navigation.ui.TopNavMenu` is a stateful component exported on the `navigation` plugin's start contract. | ||
return ( | ||
<Router basename={basename}> | ||
<I18nProvider> | ||
<> | ||
<navigation.ui.TopNavMenu | ||
appName={PLUGIN_ID} | ||
showSearchBar={true} | ||
useDefaultBehaviors={true} | ||
/> | ||
<EuiPage restrictWidth="1000px"> | ||
<EuiPageBody component="main"> | ||
<EuiPageHeader> | ||
<EuiTitle size="l"> | ||
<h1> | ||
<FormattedMessage | ||
id="queryInsightsDashboards.helloWorldText" | ||
defaultMessage="{name}" | ||
values={{ name: PLUGIN_NAME }} | ||
/> | ||
</h1> | ||
</EuiTitle> | ||
</EuiPageHeader> | ||
<EuiPageContent> | ||
<EuiPageContentHeader> | ||
<EuiTitle> | ||
<h2> | ||
<FormattedMessage | ||
id="queryInsightsDashboards.congratulationsTitle" | ||
defaultMessage="Congratulations, you have successfully created a new OpenSearch Dashboards Plugin!" | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
</EuiPageContentHeader> | ||
<EuiPageContentBody> | ||
<EuiText> | ||
<p> | ||
<FormattedMessage | ||
id="queryInsightsDashboards.content" | ||
defaultMessage="Look through the generated code and check out the plugin development documentation." | ||
/> | ||
</p> | ||
<EuiHorizontalRule /> | ||
<p> | ||
<FormattedMessage | ||
id="queryInsightsDashboards.timestampText" | ||
defaultMessage="Last timestamp: {time}" | ||
values={{ time: timestamp ? timestamp : 'Unknown' }} | ||
/> | ||
</p> | ||
<EuiButton type="primary" size="s" onClick={onClickHandler}> | ||
<FormattedMessage | ||
id="queryInsightsDashboards.buttonText" | ||
defaultMessage="Get data" | ||
/> | ||
</EuiButton> | ||
</EuiText> | ||
</EuiPageContentBody> | ||
</EuiPageContent> | ||
</EuiPageBody> | ||
</EuiPage> | ||
</> | ||
</I18nProvider> | ||
</Router> | ||
); | ||
export const QueryInsightsDashboardsApp = ({ core }: { core: CoreStart }) => { | ||
return <Route render={() => <TopNQueries core={core} />} />; | ||
}; |
Oops, something went wrong.