mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* translate InfraOps visualization component (Part 4 - server part) * update translation of Infra Ops vizualization component (Part 4) * remove unnessesary translations * change some ids * change some ids * change one id
This commit is contained in:
parent
c4fd5d341a
commit
278405b66b
2 changed files with 26 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { flatten } from 'lodash';
|
||||
import { InfraMetric, InfraMetricData, InfraNodeType } from '../../../../common/graphql/types';
|
||||
import { InfraBackendFrameworkAdapter, InfraFrameworkRequest } from '../framework';
|
||||
|
@ -44,7 +45,14 @@ export class KibanaMetricsAdapter implements InfraMetricsAdapter {
|
|||
|
||||
const validNode = await checkValidNode(search, indexPattern, nodeField, options.nodeId);
|
||||
if (!validNode) {
|
||||
throw new Error(`${options.nodeId} does not exist.`);
|
||||
throw new Error(
|
||||
i18n.translate('xpack.infra.kibanaMetrics.nodeDoesNotExistErrorMessage', {
|
||||
defaultMessage: '{nodeId} does not exist.',
|
||||
values: {
|
||||
nodeId: options.nodeId,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const requests = options.metrics.map(metricId => {
|
||||
|
@ -59,7 +67,14 @@ export class KibanaMetricsAdapter implements InfraMetricsAdapter {
|
|||
return metricIds.map((id: string) => {
|
||||
const infraMetricId: InfraMetric = (InfraMetric as any)[id];
|
||||
if (!infraMetricId) {
|
||||
throw new Error(`${id} is not a valid InfraMetric`);
|
||||
throw new Error(
|
||||
i18n.translate('xpack.infra.kibanaMetrics.invalidInfraMetricErrorMessage', {
|
||||
defaultMessage: '{id} is not a valid InfraMetric',
|
||||
values: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
const panel = result[infraMetricId];
|
||||
return {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export class InfraSources {
|
||||
constructor(private readonly adapter: InfraSourcesAdapter) {}
|
||||
|
@ -12,7 +13,14 @@ export class InfraSources {
|
|||
const requestedSourceConfiguration = sourceConfigurations[sourceId];
|
||||
|
||||
if (!requestedSourceConfiguration) {
|
||||
throw new Error(`Failed to find source '${sourceId}'`);
|
||||
throw new Error(
|
||||
i18n.translate('xpack.infra.infraSources.failedToFindSourceErrorMessage', {
|
||||
defaultMessage: 'Failed to find source {sourceId}',
|
||||
values: {
|
||||
sourceId: `'${sourceId}'`,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return requestedSourceConfiguration;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue