forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Slight update to filepicker style (center it)
- Loading branch information
1 parent
cc3717d
commit 5e0548a
Showing
23 changed files
with
345 additions
and
204 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,32 @@ | ||
/* | ||
* 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 './common/constants'; | ||
import { Legacy } from '../../../../kibana'; | ||
import { plugin } from './server/np_ready'; | ||
|
||
export function licenseManagement(kibana: any) { | ||
return new kibana.Plugin({ | ||
id: PLUGIN.ID, | ||
configPrefix: 'xpack.license_management', | ||
publicDir: resolve(__dirname, 'public'), | ||
require: ['kibana', 'elasticsearch'], | ||
uiExports: { | ||
styleSheetPaths: resolve(__dirname, 'public/np_ready/application/index.scss'), | ||
managementSections: ['plugins/license_management/legacy'], | ||
}, | ||
init: (server: Legacy.Server) => { | ||
plugin({} as any).setup(server.newPlatform.setup.core, { | ||
...server.newPlatform.setup.plugins, | ||
__LEGACY: { | ||
xpackMain: server.plugins.xpack_main, | ||
elasticsearch: server.plugins.elasticsearch, | ||
}, | ||
}); | ||
}, | ||
}); | ||
} |
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
27 changes: 0 additions & 27 deletions
27
x-pack/legacy/plugins/license_management/server/lib/license.js
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
x-pack/legacy/plugins/license_management/server/lib/start_basic.js
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
x-pack/legacy/plugins/license_management/server/lib/start_trial.js
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
33 changes: 33 additions & 0 deletions
33
x-pack/legacy/plugins/license_management/server/np_ready/lib/license.ts
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,33 @@ | ||
/* | ||
* 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 { KibanaRequest } from 'src/core/server'; | ||
import { ElasticsearchPlugin } from '../../../../../../../src/legacy/core_plugins/elasticsearch'; | ||
const getLicensePath = (acknowledge: boolean) => | ||
`/_license${acknowledge ? '?acknowledge=true' : ''}`; | ||
|
||
export async function putLicense( | ||
req: KibanaRequest<any, { acknowledge: string }, any>, | ||
elasticsearch: ElasticsearchPlugin, | ||
xpackInfo: any | ||
) { | ||
const { acknowledge } = req.query; | ||
const { callWithRequest } = elasticsearch.getCluster('admin'); | ||
const options = { | ||
method: 'POST', | ||
path: getLicensePath(Boolean(acknowledge)), | ||
body: req.body, | ||
}; | ||
try { | ||
const response = await callWithRequest(req as any, 'transport.request', options); | ||
const { acknowledged, license_status: licenseStatus } = response; | ||
if (acknowledged && licenseStatus === 'valid') { | ||
await xpackInfo.refreshNow(); | ||
} | ||
return response; | ||
} catch (error) { | ||
return error.body; | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
x-pack/legacy/plugins/license_management/server/np_ready/lib/start_basic.ts
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,34 @@ | ||
/* | ||
* 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 { KibanaRequest } from 'kibana/server'; | ||
import { ElasticsearchPlugin } from '../../../../../../../src/legacy/core_plugins/elasticsearch'; | ||
|
||
const getStartBasicPath = (acknowledge: boolean) => | ||
`/_license/start_basic${acknowledge ? '?acknowledge=true' : ''}`; | ||
|
||
export async function startBasic( | ||
req: KibanaRequest<any, { acknowledge: string }, any>, | ||
elasticsearch: ElasticsearchPlugin, | ||
xpackInfo: any | ||
) { | ||
const { acknowledge } = req.query; | ||
const { callWithRequest } = elasticsearch.getCluster('admin'); | ||
const options = { | ||
method: 'POST', | ||
path: getStartBasicPath(Boolean(acknowledge)), | ||
}; | ||
try { | ||
const response = await callWithRequest(req as any, 'transport.request', options); | ||
const { basic_was_started: basicWasStarted } = response; | ||
if (basicWasStarted) { | ||
await xpackInfo.refreshNow(); | ||
} | ||
return response; | ||
} catch (error) { | ||
return error.body; | ||
} | ||
} |
Oops, something went wrong.