File tree Expand file tree Collapse file tree 5 files changed +74
-0
lines changed Expand file tree Collapse file tree 5 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ xpack.uptime.indexPattern : alt-heartbeat-*
2+
13# Kibana is served by a back end server. This setting specifies the port to use.
24# server.port: 5601
35
Original file line number Diff line number Diff line change 55 */
66
77import { i18n } from '@kbn/i18n' ;
8+ import { Server } from 'hapi' ;
89import { resolve } from 'path' ;
910import { PluginInitializerContext } from 'src/core/server' ;
1011import { PLUGIN } from './common/constants' ;
@@ -32,6 +33,13 @@ export const uptime = (kibana: any) =>
3233 url : '/app/uptime#/' ,
3334 } ,
3435 home : [ 'plugins/uptime/register_feature' ] ,
36+ injectDefaultVars ( server : Server ) {
37+ const config = server . config ( ) ;
38+ console . log ( "INJECT INDEX PATTERN" , config . get ( 'xpack.uptime.indexPattern' ) ) ;
39+ return {
40+ uptimeIndexPattern : config . get ( 'uptime.indexPattern' )
41+ }
42+ }
3543 } ,
3644 init ( server : KibanaServer ) {
3745 const initializerContext = { } as PluginInitializerContext ;
Original file line number Diff line number Diff line change 1+ {
2+ "id" : " uptime" ,
3+ "version" : " 8.0.0" ,
4+ "server" : true
5+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ import { schema , TypeOf } from '@kbn/config-schema' ;
8+ import { PluginInitializerContext } from 'src/core/server' ;
9+ import { UptimePlugin } from './plugin' ;
10+
11+ export const config = {
12+ schema : schema . object ( {
13+ enabled : schema . maybe ( schema . boolean ( ) ) ,
14+ query : schema . object ( {
15+ indexName : schema . maybe ( schema . string ( ) ) ,
16+ } ) ,
17+ } ) ,
18+ } ;
19+
20+ export const plugin = ( initContext : PluginInitializerContext ) => new UptimePlugin ( initContext ) ;
21+
22+ export type UptimeConfig = TypeOf < typeof config . schema > ;
23+ export { UptimeSetup } from './plugin' ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ import { Plugin , PluginInitializerContext } from 'src/core/server' ;
8+
9+ export class UptimePlugin implements Plugin < UptimeSetup > {
10+ private readonly initContext : PluginInitializerContext ;
11+
12+ constructor ( initContext : PluginInitializerContext ) {
13+ this . initContext = initContext ;
14+ }
15+
16+ public setup ( ) {
17+ console . log ( "X" )
18+ console . log ( "SET IT UP" )
19+ console . log ( "X" )
20+ return {
21+ __legacy : {
22+ config : this . initContext . config ,
23+ } ,
24+ } ;
25+ }
26+
27+ public start ( ) { }
28+ public stop ( ) { }
29+ }
30+
31+ export interface UptimeSetup {
32+ /** @deprecated */
33+ __legacy : {
34+ config : PluginInitializerContext [ 'config' ] ;
35+ } ;
36+ }
You can’t perform that action at this time.
0 commit comments