disabling UI for index management when enabled is false in kibana.yml
This commit is contained in:
parent
008d37c637
commit
45d4e8c51d
|
@ -21,7 +21,13 @@ export function indexManagement(kibana) {
|
|||
styleSheetPaths: `${__dirname}/public/index.scss`,
|
||||
managementSections: [
|
||||
'plugins/index_management',
|
||||
]
|
||||
],
|
||||
injectDefaultVars(server) {
|
||||
const config = server.config();
|
||||
return {
|
||||
indexManagementUiEnabled: config.get(`${PLUGIN.ID}.enabled`)
|
||||
};
|
||||
},
|
||||
},
|
||||
init: function (server) {
|
||||
server.expose('addIndexManagementDataEnricher', addIndexManagementDataEnricher);
|
||||
|
|
|
@ -7,12 +7,15 @@
|
|||
import { management } from 'ui/management';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { BASE_PATH } from '../common/constants';
|
||||
|
||||
const esSection = management.getSection('elasticsearch');
|
||||
esSection.register('index_management', {
|
||||
import chrome from 'ui/chrome';
|
||||
if (chrome.getInjected('indexManagementUiEnabled')) {
|
||||
const esSection = management.getSection('elasticsearch');
|
||||
esSection.register('index_management', {
|
||||
visible: true,
|
||||
display: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }),
|
||||
order: 1,
|
||||
url: `#${BASE_PATH}home`
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import routes from 'ui/routes';
|
|||
import template from './main.html';
|
||||
import { manageAngularLifecycle } from './lib/manage_angular_lifecycle';
|
||||
import { indexManagementStore } from './store';
|
||||
import chrome from 'ui/chrome';
|
||||
|
||||
const renderReact = async (elem) => {
|
||||
render(
|
||||
|
@ -32,8 +33,8 @@ const renderReact = async (elem) => {
|
|||
elem
|
||||
);
|
||||
};
|
||||
|
||||
routes.when(`${BASE_PATH}:view?/:id?`, {
|
||||
if (chrome.getInjected('indexManagementUiEnabled')) {
|
||||
routes.when(`${BASE_PATH}:view?/:id?`, {
|
||||
template: template,
|
||||
controllerAs: 'indexManagement',
|
||||
controller: class IndexManagementController {
|
||||
|
@ -49,4 +50,5 @@ routes.when(`${BASE_PATH}:view?/:id?`, {
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue