-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b092309
commit 96635c7
Showing
8 changed files
with
97 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{md,asciidoc}] | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
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 |
---|---|---|
|
@@ -62,6 +62,7 @@ typings/ | |
|
||
package-lock.json | ||
|
||
target/ | ||
build/ | ||
|
||
yarn.lock | ||
yarn.lock |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { AppMountParameters, CoreStart } from 'kibana/public'; | ||
import { AppPluginStartDependencies } from './types'; | ||
|
||
export const renderApp = ( | ||
{ notifications, http }: CoreStart, | ||
{ navigation }: AppPluginStartDependencies, | ||
{ appBasePath, element }: AppMountParameters | ||
) => { | ||
|
||
ReactDOM.render( | ||
<div> | ||
Hello world! | ||
</div>, | ||
element | ||
) | ||
|
||
return () => ReactDOM.unmountComponentAtNode(element); | ||
} |
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,12 @@ | ||
import React, { useState } from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
import { CoreStart } from 'kibana/public'; | ||
import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public'; | ||
|
||
interface TestPluginAppDeps { | ||
basename: string; | ||
notifications: CoreStart['notifications']; | ||
http: CoreStart['http']; | ||
navigation: NavigationPublicPluginStart; | ||
} |
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,11 @@ | ||
import { PluginInitializer, PluginInitializerContext } from 'kibana/server'; | ||
import { WazuhSetup, WazuhStart, WazuhSetupDeps, WazuhStartDeps, WazuhPlugin } from './plugin'; | ||
|
||
export const plugin = ( | ||
initializerContext: PluginInitializerContext | ||
) => { | ||
return new WazuhPlugin(); | ||
}; | ||
|
||
// These are your public types & static code | ||
export { WazuhSetup, WazuhStart }; |
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,31 @@ | ||
import { AppMountParameters, CoreSetup, CoreStart, Plugin } from 'kibana/public'; | ||
import { AppPluginStartDependencies } from './types'; | ||
|
||
export type WazuhSetupDeps = {} | ||
export type WazuhStartDeps = {} | ||
|
||
export type WazuhSetup = {} | ||
export type WazuhStart = {} | ||
|
||
export class WazuhPlugin implements Plugin<WazuhSetup, WazuhStart, WazuhSetupDeps, WazuhStartDeps> { | ||
|
||
public setup(core: CoreSetup, plugins: WazuhStartDeps): WazuhSetup { | ||
core.application.register({ | ||
id: `wazuh`, | ||
title: 'Wazuh', | ||
async mount(params: AppMountParameters) { | ||
// Load application bundle | ||
const { renderApp } = await import('./application'); | ||
// Get start services as specified in kibana.json | ||
const [coreStart, depsStart] = await core.getStartServices(); | ||
// Render the application | ||
return renderApp(coreStart, depsStart as AppPluginStartDependencies, params); | ||
} | ||
}) | ||
return {}; | ||
} | ||
|
||
public start(core: CoreStart, plugins: WazuhStartDeps): WazuhStart { | ||
return {}; | ||
} | ||
} |
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,5 @@ | ||
import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; | ||
|
||
export interface AppPluginStartDependencies { | ||
navigation: NavigationPublicPluginStart; | ||
} |