-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
b0afa91
commit 4b26855
Showing
114 changed files
with
148 additions
and
97 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { resolve } from 'path'; | ||
import { plugin } from './server/np_ready'; | ||
import { ServerShim } from './server/np_ready/plugin'; | ||
import { PLUGIN } from './common/constants'; | ||
|
||
export const pluginDefinition = { | ||
id: PLUGIN.ID, | ||
configPrefix: 'xpack.watcher', | ||
publicDir: resolve(__dirname, 'public'), | ||
require: ['kibana', 'elasticsearch', 'xpack_main'], | ||
uiExports: { | ||
styleSheetPaths: resolve(__dirname, 'public/np_ready/application/index.scss'), | ||
managementSections: ['plugins/watcher/legacy'], | ||
home: ['plugins/watcher/register_feature'], | ||
}, | ||
init(server: any) { | ||
const serverShim: ServerShim = server as any; | ||
plugin({} as any).setup(server.newPlatform.setup.core, { | ||
__LEGACY: { | ||
route: server.route.bind(server), | ||
plugins: { | ||
elasticsearch: server.plugins.elasticsearch, | ||
[PLUGIN.ID]: server.plugins[PLUGIN.ID], | ||
xpack_main: server.plugins.xpack_main, | ||
}, | ||
}, | ||
}); | ||
}, | ||
}; |
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 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,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { PluginInitializerContext } from 'src/core/server'; | ||
import { WatcherServerPlugin } from './plugin'; | ||
|
||
export const plugin = (ctx: PluginInitializerContext) => new WatcherServerPlugin(); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,56 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Plugin, CoreSetup, ElasticsearchServiceSetup } from 'src/core/server'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { XPackMainPlugin } from '../../../xpack_main/xpack_main'; | ||
import { PLUGIN } from '../../common/constants'; | ||
// @ts-ignore | ||
import { registerFieldsRoutes } from './routes/api/fields'; | ||
// @ts-ignore | ||
import { registerSettingsRoutes } from './routes/api/settings'; | ||
// @ts-ignore | ||
import { registerHistoryRoutes } from './routes/api/history'; | ||
// @ts-ignore | ||
import { registerIndicesRoutes } from './routes/api/indices'; | ||
// @ts-ignore | ||
import { registerLicenseRoutes } from './routes/api/license'; | ||
// @ts-ignore | ||
import { registerWatchesRoutes } from './routes/api/watches'; | ||
// @ts-ignore | ||
import { registerWatchRoutes } from './routes/api/watch'; | ||
import { registerLicenseChecker } from '../../../../server/lib/register_license_checker'; | ||
|
||
export interface ServerShim { | ||
route: any; | ||
plugins: { | ||
xpack_main: XPackMainPlugin; | ||
watcher: any; | ||
elasticsearch: ElasticsearchServiceSetup; | ||
}; | ||
} | ||
|
||
export class WatcherServerPlugin implements Plugin<void, void, any, any> { | ||
async setup(core: CoreSetup, { __LEGACY: serverShim }: { __LEGACY: ServerShim }) { | ||
// Register license checker | ||
registerLicenseChecker( | ||
serverShim as any, | ||
PLUGIN.ID, | ||
PLUGIN.getI18nName(i18n), | ||
PLUGIN.MINIMUM_LICENSE_REQUIRED | ||
); | ||
|
||
registerFieldsRoutes(serverShim); | ||
registerHistoryRoutes(serverShim); | ||
registerIndicesRoutes(serverShim); | ||
registerLicenseRoutes(serverShim); | ||
registerSettingsRoutes(serverShim); | ||
registerWatchesRoutes(serverShim); | ||
registerWatchRoutes(serverShim); | ||
} | ||
start() {} | ||
stop() {} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.