Revert changes to Monitoring accidentally introduced in #27591 (#27830)

This commit is contained in:
Søren Louv-Jansen 2018-12-28 12:21:09 +01:00 committed by GitHub
parent e520f121c5
commit b034e9ceaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 20 deletions

View file

@ -82,27 +82,35 @@ uiModule.directive('monitoringMain', (breadcrumbs, license, kbnUrl, config) => {
link(scope, _element, attributes, controller) {
config.watch('k7design', (val) => scope.showPluginBreadcrumbs = !val);
controller.setup({
licenseService: license,
breadcrumbsService: breadcrumbs,
kbnUrlService: kbnUrl,
attributes: {
name: attributes.name,
product: attributes.product,
instance: attributes.instance,
resolver: attributes.resolver,
page: attributes.page,
tabIconClass: attributes.tabIconClass,
tabIconLabel: attributes.tabIconLabel,
pipelineId: attributes.pipelineId,
pipelineHash: attributes.pipelineHash,
pipelineVersions: get(scope, 'pageData.versions')
},
clusterName: get(scope, 'cluster.cluster_name')
});
function getSetupObj() {
return {
licenseService: license,
breadcrumbsService: breadcrumbs,
kbnUrlService: kbnUrl,
attributes: {
name: attributes.name,
product: attributes.product,
instance: attributes.instance,
resolver: attributes.resolver,
page: attributes.page,
tabIconClass: attributes.tabIconClass,
tabIconLabel: attributes.tabIconLabel,
pipelineId: attributes.pipelineId,
pipelineHash: attributes.pipelineHash,
pipelineVersions: get(scope, 'pageData.versions')
},
clusterName: get(scope, 'cluster.cluster_name')
};
}
attributes.$observe('instance', instance => controller.instance = instance);
attributes.$observe('resolver', resolver => controller.resolver = resolver);
const setupObj = getSetupObj();
controller.setup(setupObj);
Object.keys(setupObj.attributes).forEach(key => {
attributes.$observe(key, () => controller.setup(getSetupObj()));
});
scope.$watch('pageData.versions', versions => {
controller.pipelineVersions = versions;
});
}
};
});

View file

@ -98,6 +98,9 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', {
getPageData,
reactNodeId: 'monitoringLogstashPipelineApp',
$scope,
options: {
enableTimeFilter: false,
},
$injector
});