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>
|
</tabset>
|
||||||
|
|
||||||
<!-- License error notice -->
|
<!-- License error notice -->
|
||||||
<div class="kuiNotice" ng-hide="!licenseEnabled">
|
<div class="kuiNotice" ng-hide="licenseEnabled">
|
||||||
<h2
|
<h2
|
||||||
class="kuiTitle kuiVerticalRhythmSmall"
|
class="kuiTitle kuiVerticalRhythmSmall"
|
||||||
i18n-id="xpack.searchProfiler.licenseErrorMessageTitle"
|
i18n-id="xpack.searchProfiler.licenseErrorMessageTitle"
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function profileRoute(server, commonRouteConfig) {
|
||||||
}).required() //Joi validation
|
}).required() //Joi validation
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handler: (request) => {
|
handler: async (request) => {
|
||||||
|
|
||||||
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
|
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
|
||||||
let parsed = request.payload.query;
|
let parsed = request.payload.query;
|
||||||
|
@ -33,18 +33,18 @@ export function profileRoute(server, commonRouteConfig) {
|
||||||
type: request.payload.type,
|
type: request.payload.type,
|
||||||
body: parsed
|
body: parsed
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
callWithRequest(request, 'search', body).then((resp) => {
|
const resp = await callWithRequest(request, 'search', body);
|
||||||
return {
|
return {
|
||||||
ok: true,
|
ok: true,
|
||||||
resp: resp
|
resp: resp
|
||||||
};
|
};
|
||||||
}).catch((err) => {
|
} catch (err) {
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
err: err
|
err: err
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue