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.
Work around elastic#11959 for now (elastic#12051)
* Fix use of KuiButtons in Clone Modal. * [scripts] stub scripts/languages api until elastic#11959 is fixed
- Loading branch information
Showing
2 changed files
with
3 additions
and
21 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
20 changes: 1 addition & 19 deletions
20
src/core_plugins/kibana/server/routes/api/scripts/register_languages.js
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,27 +1,9 @@ | ||
import _ from 'lodash'; | ||
import handleESError from '../../../lib/handle_es_error'; | ||
|
||
export function registerLanguages(server) { | ||
server.route({ | ||
path: '/api/kibana/scripts/languages', | ||
method: 'GET', | ||
handler: function (request, reply) { | ||
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data'); | ||
|
||
return callWithRequest(request, 'cluster.getSettings', { | ||
include_defaults: true, | ||
filter_path: '**.script.engine.*.inline' | ||
}) | ||
.then((esResponse) => { | ||
const langs = _.get(esResponse, 'defaults.script.engine', {}); | ||
const inlineLangs = _.pick(langs, (lang) => lang.inline === 'true'); | ||
const supportedLangs = _.omit(inlineLangs, 'mustache'); | ||
return _.keys(supportedLangs); | ||
}) | ||
.then(reply) | ||
.catch((error) => { | ||
reply(handleESError(error)); | ||
}); | ||
reply(['painless', 'expression']); | ||
} | ||
}); | ||
} |