Fix search profiler (#27326)
* fix logic for when license error shows * fix API route to work with latest hapi API
This commit is contained in:
parent
faa57fd7a9
commit
b0c6b52b45
|
@ -18,7 +18,7 @@
|
|||
</tabset>
|
||||
|
||||
<!-- License error notice -->
|
||||
<div class="kuiNotice" ng-hide="!licenseEnabled">
|
||||
<div class="kuiNotice" ng-hide="licenseEnabled">
|
||||
<h2
|
||||
class="kuiTitle kuiVerticalRhythmSmall"
|
||||
i18n-id="xpack.searchProfiler.licenseErrorMessageTitle"
|
||||
|
|
|
@ -21,7 +21,7 @@ export function profileRoute(server, commonRouteConfig) {
|
|||
}).required() //Joi validation
|
||||
}
|
||||
},
|
||||
handler: (request) => {
|
||||
handler: async (request) => {
|
||||
|
||||
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
|
||||
let parsed = request.payload.query;
|
||||
|
@ -33,18 +33,18 @@ export function profileRoute(server, commonRouteConfig) {
|
|||
type: request.payload.type,
|
||||
body: parsed
|
||||
};
|
||||
|
||||
callWithRequest(request, 'search', body).then((resp) => {
|
||||
try {
|
||||
const resp = await callWithRequest(request, 'search', body);
|
||||
return {
|
||||
ok: true,
|
||||
resp: resp
|
||||
};
|
||||
}).catch((err) => {
|
||||
} catch (err) {
|
||||
return {
|
||||
ok: false,
|
||||
err: err
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue