diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 79bb394cdb..4714548c68 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -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 diff --git a/config/product/logging.js b/config/product/logging.js index 421bbc3c0f..fde1ccf8b6 100644 --- a/config/product/logging.js +++ b/config/product/logging.js @@ -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]); } diff --git a/config/table-headers.js b/config/table-headers.js index 4fb028a325..7913aef756 100644 --- a/config/table-headers.js +++ b/config/table-headers.js @@ -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', diff --git a/edit/logging.banzaicloud.io.output/index.vue b/edit/logging.banzaicloud.io.output/index.vue index be805f87ab..65532fc3ba 100644 --- a/edit/logging.banzaicloud.io.output/index.vue +++ b/edit/logging.banzaicloud.io.output/index.vue @@ -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`) diff --git a/models/logging.banzaicloud.io.output.js b/models/logging.banzaicloud.io.output.js index 8bf4a86a82..4f8a942786 100644 --- a/models/logging.banzaicloud.io.output.js +++ b/models/logging.banzaicloud.io.output.js @@ -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(''); + }, };