mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
575428ed86
commit
10665e0ffc
5 changed files with 16 additions and 7 deletions
|
@ -28,7 +28,6 @@
|
|||
</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
<span ng-repeat="tag in indexPattern.tags">
|
||||
<span class="euiBadge euiBadge--hollow">
|
||||
|
|
|
@ -181,7 +181,10 @@ uiModules.get('apps/management')
|
|||
$scope.kbnUrl = Private(KbnUrlProvider);
|
||||
$scope.indexPattern = $route.current.locals.indexPattern;
|
||||
$scope.indexPatternListProvider = indexPatternListProvider;
|
||||
$scope.indexPattern.tags = indexPatternListProvider.getIndexPatternTags($scope.indexPattern);
|
||||
$scope.indexPattern.tags = indexPatternListProvider.getIndexPatternTags(
|
||||
$scope.indexPattern,
|
||||
$scope.indexPattern.id === config.get('defaultIndex')
|
||||
);
|
||||
$scope.getFieldInfo = indexPatternListProvider.getFieldInfo;
|
||||
const docTitle = Private(DocTitleProvider);
|
||||
docTitle.change($scope.indexPattern.title);
|
||||
|
|
|
@ -132,7 +132,11 @@ uiModules.get('apps/management')
|
|||
id: id,
|
||||
title:
|
||||
<span>
|
||||
{pattern.get('title')}{$scope.defaultIndex === id && (<EuiBadge className="indexPatternList__badge">Default</EuiBadge>)}
|
||||
{pattern.get('title')} {tags && tags.length ? tags.map(({ key: tagKey, name: tagName }) => (
|
||||
<EuiBadge className="indexPatternList__badge" key={tagKey}>
|
||||
{tagName}
|
||||
</EuiBadge>
|
||||
)) : null}
|
||||
</span>,
|
||||
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
|
||||
active: $scope.editingId === id,
|
||||
|
|
|
@ -24,9 +24,9 @@ class IndexPatternList {
|
|||
this._plugins = registry.inOrder.map(Plugin => new Plugin());
|
||||
}
|
||||
|
||||
getIndexPatternTags = (indexPattern) => {
|
||||
getIndexPatternTags = (indexPattern, isDefault) => {
|
||||
return this._plugins.reduce((tags, plugin) => {
|
||||
return plugin.getIndexPatternTags ? tags.concat(plugin.getIndexPatternTags(indexPattern)) : tags;
|
||||
return plugin.getIndexPatternTags ? tags.concat(plugin.getIndexPatternTags(indexPattern, isDefault)) : tags;
|
||||
}, []);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,11 @@
|
|||
export class IndexPatternListConfig {
|
||||
static key = 'default';
|
||||
|
||||
getIndexPatternTags = () => {
|
||||
return [];
|
||||
getIndexPatternTags = (indexPattern, isDefault) => {
|
||||
return isDefault ? [{
|
||||
key: 'default',
|
||||
name: 'Default',
|
||||
}] : [];
|
||||
}
|
||||
|
||||
getFieldInfo = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue