mirror of https://github.com/rancher/dashboard.git
Merge pull request #1628 from codyrancher/logging-output-providers
Add Providers to the list view of ClusterOutputs
This commit is contained in:
commit
a88bba5924
|
|
@ -667,6 +667,12 @@ logging:
|
|||
target: Target
|
||||
access: Access
|
||||
certificate: SSL
|
||||
outputProviders:
|
||||
elasticsearch: Elasticsearch
|
||||
splunkHec: Splunk
|
||||
kafka: Kafka
|
||||
forward: Fluentd
|
||||
unknown: Unknown
|
||||
overview:
|
||||
poweredBy: Banzai Cloud
|
||||
clusterLevel: Cluster-Level
|
||||
|
|
@ -1139,6 +1145,7 @@ tableHeaders:
|
|||
keys: Data
|
||||
lastUpdated: Last Updated
|
||||
lastSeen: Last Seen
|
||||
loggingOutputProviders: Providers
|
||||
matches: Matches
|
||||
message: Message
|
||||
name: Name
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
import { LOGGING } from '@/config/types';
|
||||
import { DSL } from '@/store/type-map';
|
||||
import {
|
||||
LOGGING_OUTPUT_PROVIDERS, STATE, NAME as NAME_COL, NAMESPACE as NAMESPACE_COL, AGE
|
||||
} from '@/config/table-headers';
|
||||
|
||||
export const NAME = 'logging';
|
||||
export const CHART_NAME = 'rancher-logging';
|
||||
|
||||
export function init(store) {
|
||||
const {
|
||||
headers,
|
||||
product,
|
||||
basicType,
|
||||
virtualType,
|
||||
|
|
@ -36,4 +40,7 @@ export function init(store) {
|
|||
route: { name: 'c-cluster-logging' },
|
||||
exact: true,
|
||||
});
|
||||
|
||||
headers(LOGGING.OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]);
|
||||
headers(LOGGING.CLUSTER_OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,15 @@ export const NAME = {
|
|||
canBeVariable: true,
|
||||
};
|
||||
|
||||
export const LOGGING_OUTPUT_PROVIDERS = {
|
||||
name: 'logging-output-providers',
|
||||
labelKey: 'tableHeaders.loggingOutputProviders',
|
||||
value: 'providersDisplay',
|
||||
sort: ['providersSortable'],
|
||||
width: '75%',
|
||||
formatter: 'List',
|
||||
};
|
||||
|
||||
export const SIMPLE_NAME = {
|
||||
name: 'name',
|
||||
labelKey: 'tableHeaders.simpleName',
|
||||
|
|
|
|||
|
|
@ -28,28 +28,28 @@ export default {
|
|||
const providers = [
|
||||
{
|
||||
name: 'elasticsearch',
|
||||
label: 'Elasticsearch',
|
||||
label: this.t('logging.outputProviders.elasticsearch'),
|
||||
enabled: false,
|
||||
default: {},
|
||||
logo: require(`~/assets/images/logo-color-elasticsearch.svg`)
|
||||
},
|
||||
{
|
||||
name: 'splunkHec',
|
||||
label: 'Splunk',
|
||||
label: this.t('logging.outputProviders.splunkHec'),
|
||||
enabled: false,
|
||||
default: {},
|
||||
logo: require(`~/assets/images/logo-color-splunk.svg`)
|
||||
},
|
||||
{
|
||||
name: 'kafka',
|
||||
label: 'Kafka',
|
||||
label: this.t('logging.outputProviders.kafka'),
|
||||
enabled: false,
|
||||
default: { format: { type: 'json' } },
|
||||
logo: require(`~/assets/images/logo-color-kafka.svg`)
|
||||
},
|
||||
{
|
||||
name: 'forward',
|
||||
label: 'Fluentd',
|
||||
label: this.t('logging.outputProviders.forward'),
|
||||
enabled: false,
|
||||
default: { servers: [{}] },
|
||||
logo: require(`~/assets/images/logo-color-fluentd.svg`)
|
||||
|
|
|
|||
|
|
@ -4,5 +4,21 @@ export default {
|
|||
|
||||
return Object.keys(spec)
|
||||
.filter(provider => provider !== 'loggingRef');
|
||||
}
|
||||
},
|
||||
|
||||
providersDisplay() {
|
||||
return this.providers.map((p) => {
|
||||
const translation = this.t(`logging.outputProviders.${ p }`);
|
||||
|
||||
return translation || this.t('logging.outputProviders.unknown');
|
||||
});
|
||||
},
|
||||
|
||||
providersSortable() {
|
||||
const copy = [...this.providersDisplay];
|
||||
|
||||
copy.sort();
|
||||
|
||||
return copy.join('');
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue