mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
842132614d
commit
057cc75980
6 changed files with 28 additions and 9 deletions
|
@ -28,7 +28,6 @@
|
|||
</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
<span ng-repeat="tag in indexPattern.tags">
|
||||
<span class="euiBadge euiBadge--hollow">
|
||||
|
|
|
@ -180,7 +180,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;
|
||||
docTitle.change($scope.indexPattern.title);
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ uiModules.get('apps/management')
|
|||
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
|
||||
active: $scope.editingId === id,
|
||||
default: isDefault,
|
||||
tag: tags && tags.length ? tags[0] : null,
|
||||
tags,
|
||||
//the prepending of 0 at the default pattern takes care of prioritization
|
||||
//so the sorting will but the default index on top
|
||||
//or on bottom of a the table
|
||||
|
|
|
@ -39,10 +39,24 @@ const columns = [
|
|||
{
|
||||
field: 'title',
|
||||
name: 'Pattern',
|
||||
render: (name: string, index: { id: string; default: boolean }) => (
|
||||
render: (
|
||||
name: string,
|
||||
index: {
|
||||
id: string;
|
||||
tags?: Array<{
|
||||
key: string;
|
||||
name: string;
|
||||
}>;
|
||||
}
|
||||
) => (
|
||||
<EuiButtonEmpty size="xs" href={`#/management/kibana/index_patterns/${index.id}`}>
|
||||
{name}
|
||||
{index.default && <EuiBadge className="indexPatternList__badge">Default</EuiBadge>}
|
||||
{index.tags &&
|
||||
index.tags.map(({ key: tagKey, name: tagName }) => (
|
||||
<EuiBadge className="indexPatternList__badge" key={tagKey}>
|
||||
{tagName}
|
||||
</EuiBadge>
|
||||
))}
|
||||
</EuiButtonEmpty>
|
||||
),
|
||||
dataType: 'string',
|
||||
|
|
|
@ -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