Removed dead code (#39545)
* Removed dead code * Added missing translation
This commit is contained in:
parent
b57f808cdb
commit
4135823498
|
@ -68,3 +68,16 @@
|
|||
white-space: nowrap;
|
||||
margin-left: $euiSizeXS;
|
||||
}
|
||||
|
||||
.monChart__tooltipLabel,
|
||||
.monChart__tooltipValue {
|
||||
text-align: left;
|
||||
font-size: $euiFontSizeXS;
|
||||
padding: $euiSizeXS;
|
||||
word-wrap: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.monChart__tooltipLabel {
|
||||
font-weight: $euiFontWeightBold;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,14 @@ const getColumns = (kbnUrl, scope) => {
|
|||
field: 'status',
|
||||
render: (status, kibana) => (
|
||||
<div
|
||||
title={`Instance status: ${status}`}
|
||||
title={
|
||||
i18n.translate('xpack.monitoring.kibana.listing.instanceStatusTitle', {
|
||||
defaultMessage: 'Instance status: {kibanaStatus}',
|
||||
values: {
|
||||
kibanaStatus: status
|
||||
}
|
||||
})
|
||||
}
|
||||
className="monTableCell__status"
|
||||
>
|
||||
<KibanaStatusIcon status={status} availability={kibana.availability} />
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
*/
|
||||
|
||||
import './main';
|
||||
import './chart';
|
||||
import './sparkline';
|
||||
import './elasticsearch/cluster_status';
|
||||
import './elasticsearch/index_summary';
|
||||
import './elasticsearch/node_summary';
|
||||
import './elasticsearch/ml_job_listing';
|
||||
import './kibana/cluster_status';
|
||||
import './kibana/listing';
|
||||
import './kibana/summary';
|
||||
import './beats/overview';
|
||||
import './beats/beat';
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
.monChart__container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 0 auto;
|
||||
height: 200px;
|
||||
margin-bottom: $euiSize;
|
||||
}
|
||||
|
||||
.monChart__tooltipLabel,
|
||||
.monChart__tooltipValue {
|
||||
text-align: left;
|
||||
font-size: $euiFontSizeXS;
|
||||
padding: $euiSizeXS;
|
||||
word-wrap: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.monChart__tooltipLabel {
|
||||
font-weight: $euiFontWeightBold;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
@import 'chart';
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import moment from 'moment';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { timefilter } from 'ui/timefilter';
|
||||
import { MonitoringTimeseriesContainer } from '../../components/chart/monitoring_timeseries_container';
|
||||
import { EuiSpacer } from '@elastic/eui';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('plugins/monitoring/directives', []);
|
||||
uiModule.directive('monitoringChart', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
series: '='
|
||||
},
|
||||
link(scope, $elem) {
|
||||
scope.$on('$destroy', () => $elem && $elem[0] && unmountComponentAtNode($elem[0]));
|
||||
|
||||
function onBrush({ xaxis }) {
|
||||
timefilter.setTime({
|
||||
from: moment(xaxis.from),
|
||||
to: moment(xaxis.to),
|
||||
mode: 'absolute'
|
||||
});
|
||||
}
|
||||
|
||||
scope.$watch('series', series => {
|
||||
render(
|
||||
<I18nContext>
|
||||
<Fragment>
|
||||
<MonitoringTimeseriesContainer
|
||||
series={series}
|
||||
onBrush={onBrush}
|
||||
/>
|
||||
<EuiSpacer size="m"/>
|
||||
</Fragment>
|
||||
</I18nContext>,
|
||||
$elem[0]
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { ClusterStatus } from 'plugins/monitoring/components/elasticsearch/cluster_status';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringClusterStatusElasticsearch', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
status: '='
|
||||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
scope.$watch('status', status => {
|
||||
render(<I18nContext><ClusterStatus stats={status} /></I18nContext>, $el[0]);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { IndexDetailStatus } from 'plugins/monitoring/components/elasticsearch/index_detail_status';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringIndexSummary', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: { summary: '=' },
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
scope.$watch('summary', summary => {
|
||||
render(<I18nContext><IndexDetailStatus stats={summary} /></I18nContext>, $el[0]);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { NodeDetailStatus } from 'plugins/monitoring/components/elasticsearch/node_detail_status';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringNodeSummary', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
node: '='
|
||||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
scope.$watch('node', node => {
|
||||
render(<I18nContext><NodeDetailStatus stats={node} /></I18nContext>, $el[0]);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { ClusterStatus } from 'plugins/monitoring/components/kibana/cluster_status';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringClusterStatusKibana', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
status: '=',
|
||||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
scope.$watch('status', status => {
|
||||
render(<I18nContext><ClusterStatus stats={status} /></I18nContext>, $el[0]);
|
||||
});
|
||||
},
|
||||
};
|
||||
});
|
|
@ -1,180 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { capitalize, get } from 'lodash';
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import {
|
||||
KuiTableRowCell,
|
||||
KuiTableRow
|
||||
} from '@kbn/ui-framework/components';
|
||||
import { KibanaStatusIcon } from 'plugins/monitoring/components/kibana/status_icon';
|
||||
import { MonitoringTable } from 'plugins/monitoring/components/table';
|
||||
import { SORT_ASCENDING } from '../../../../common/constants';
|
||||
import {
|
||||
formatNumber,
|
||||
formatMetric,
|
||||
} from '../../../lib/format_number';
|
||||
import {
|
||||
EuiLink,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const filterFields = [ 'kibana.name', 'kibana.host', 'kibana.status', 'kibana.transport_address' ];
|
||||
const columns = [
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.nameColumnTitle', {
|
||||
defaultMessage: 'Name'
|
||||
}),
|
||||
sortKey: 'kibana.name',
|
||||
sortOrder: SORT_ASCENDING
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.statusColumnTitle', {
|
||||
defaultMessage: 'Status'
|
||||
}),
|
||||
sortKey: 'kibana.status'
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.loadAverageColumnTitle', {
|
||||
defaultMessage: 'Load Average'
|
||||
}),
|
||||
sortKey: 'os.load.1m'
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.memorySizeColumnTitle', {
|
||||
defaultMessage: 'Memory Size'
|
||||
}),
|
||||
sortKey: 'process.memory.resident_set_size_in_bytes'
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.requestsColumnTitle', {
|
||||
defaultMessage: 'Requests'
|
||||
}),
|
||||
sortKey: 'requests.total'
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.monitoring.kibana.listing.responseTimeColumnTitle', {
|
||||
defaultMessage: 'Response Times'
|
||||
}),
|
||||
sortKey: 'response_times.average'
|
||||
},
|
||||
];
|
||||
const instanceRowFactory = (scope, kbnUrl) => {
|
||||
const goToInstance = uuid => {
|
||||
scope.$evalAsync(() => {
|
||||
kbnUrl.changePath(`/kibana/instances/${uuid}`);
|
||||
});
|
||||
};
|
||||
|
||||
return function KibanaRow(props) {
|
||||
return (
|
||||
<KuiTableRow>
|
||||
<KuiTableRowCell>
|
||||
<div className="monTableCell__name">
|
||||
<EuiLink
|
||||
onClick={goToInstance.bind(null, get(props, 'kibana.uuid'))}
|
||||
data-test-subj={`kibanaLink-${props.kibana.name}`}
|
||||
>
|
||||
{ props.kibana.name }
|
||||
</EuiLink>
|
||||
</div>
|
||||
<div className="monTableCell__transportAddress">{ get(props, 'kibana.transport_address') }</div>
|
||||
</KuiTableRowCell>
|
||||
<KuiTableRowCell>
|
||||
<div
|
||||
className="monTableCell__status"
|
||||
title={
|
||||
i18n.translate('xpack.monitoring.kibana.listing.instanceStatusTitle', {
|
||||
defaultMessage: 'Instance status: {kibanaStatus}',
|
||||
values: {
|
||||
kibanaStatus: props.kibana.status
|
||||
}
|
||||
})
|
||||
}
|
||||
>
|
||||
<KibanaStatusIcon status={props.kibana.status} availability={props.availability} />
|
||||
{ !props.availability ? (
|
||||
<FormattedMessage
|
||||
id="xpack.monitoring.kibana.listing.instanceStatus.offlineLabel"
|
||||
defaultMessage="Offline"
|
||||
/>
|
||||
) : capitalize(props.kibana.status) }
|
||||
</div>
|
||||
</KuiTableRowCell>
|
||||
<KuiTableRowCell>
|
||||
<div className="monTableCell__number">
|
||||
{ formatMetric(get(props, 'os.load["1m"]'), '0.00') }
|
||||
</div>
|
||||
</KuiTableRowCell>
|
||||
<KuiTableRowCell>
|
||||
<div className="monTableCell__number">
|
||||
{ formatNumber(props.process.memory.resident_set_size_in_bytes, 'byte') }
|
||||
</div>
|
||||
</KuiTableRowCell>
|
||||
<KuiTableRowCell>
|
||||
<div className="monTableCell__number">
|
||||
{ formatNumber(props.requests.total, 'int_commas') }
|
||||
</div>
|
||||
</KuiTableRowCell>
|
||||
<KuiTableRowCell>
|
||||
<div className="monTableCell__splitNumber">
|
||||
{ props.response_times.average && (formatNumber(props.response_times.average, 'int_commas') + ' ms avg') }
|
||||
</div>
|
||||
<div className="monTableCell__splitNumber">
|
||||
{ formatNumber(props.response_times.max, 'int_commas') } ms max
|
||||
</div>
|
||||
</KuiTableRowCell>
|
||||
</KuiTableRow>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringKibanaListing', kbnUrl => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
instances: '=',
|
||||
pageIndex: '=',
|
||||
filterText: '=',
|
||||
sortKey: '=',
|
||||
sortOrder: '=',
|
||||
onNewState: '=',
|
||||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
const filterInstancesPlaceholder = i18n.translate('xpack.monitoring.kibana.listing.filterInstancesPlaceholder', {
|
||||
defaultMessage: 'Filter Instances…'
|
||||
});
|
||||
|
||||
scope.$watch('instances', (instances = []) => {
|
||||
const kibanasTable = (
|
||||
<I18nContext>
|
||||
<MonitoringTable
|
||||
className="kibanaInstancesTable"
|
||||
rows={instances}
|
||||
pageIndex={scope.pageIndex}
|
||||
filterText={scope.filterText}
|
||||
sortKey={scope.sortKey}
|
||||
sortOrder={scope.sortOrder}
|
||||
onNewState={scope.onNewState}
|
||||
placeholder={filterInstancesPlaceholder}
|
||||
filterFields={filterFields}
|
||||
columns={columns}
|
||||
rowComponent={instanceRowFactory(scope, kbnUrl)}
|
||||
/>
|
||||
</I18nContext>
|
||||
);
|
||||
render(kibanasTable, $el[0]);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { DetailStatus } from 'plugins/monitoring/components/kibana/detail_status';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const uiModule = uiModules.get('monitoring/directives', []);
|
||||
uiModule.directive('monitoringKibanaSummary', () => {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
kibana: '='
|
||||
},
|
||||
link(scope, $el) {
|
||||
scope.$on('$destroy', () => $el && $el[0] && unmountComponentAtNode($el[0]));
|
||||
scope.$watch('kibana', kibana => {
|
||||
render(<I18nContext><DetailStatus stats={kibana} /></I18nContext>, $el[0]);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { Sparkline } from 'plugins/monitoring/components/sparkline';
|
||||
import moment from 'moment';
|
||||
import { formatMetric } from '../../lib/format_number';
|
||||
import { timefilter } from 'ui/timefilter';
|
||||
|
||||
const uiModule = uiModules.get('plugins/monitoring/directives', []);
|
||||
uiModule.directive('sparkline', ($injector) => {
|
||||
const config = $injector.get('config');
|
||||
|
||||
const dateFormat = config.get('dateFormat');
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
// Monitoring series object (containing data, metric, and timeRange properties)
|
||||
series: '='
|
||||
},
|
||||
link(scope, $elem) {
|
||||
|
||||
function onBrush(xaxis) {
|
||||
timefilter.setTime({
|
||||
from: moment(xaxis.from),
|
||||
to: moment(xaxis.to),
|
||||
mode: 'absolute'
|
||||
});
|
||||
}
|
||||
|
||||
function tooltipXValueFormatter(xValue) {
|
||||
return moment(xValue).format(dateFormat);
|
||||
}
|
||||
|
||||
function tooltipYValueFormatter(yValue) {
|
||||
return formatMetric(yValue, scope.series.metric.format, scope.series.metric.units);
|
||||
}
|
||||
|
||||
scope.$watch('series', series => {
|
||||
const options = {
|
||||
xaxis: series.timeRange
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
<Sparkline
|
||||
series={series.data}
|
||||
onBrush={onBrush}
|
||||
options={options}
|
||||
tooltip={{
|
||||
xValueFormatter: tooltipXValueFormatter,
|
||||
yValueFormatter: tooltipYValueFormatter
|
||||
}}
|
||||
/>,
|
||||
$elem[0]
|
||||
);
|
||||
}, true);
|
||||
|
||||
scope.$on('$destroy', () => ReactDOM.unmountComponentAtNode($elem[0]));
|
||||
}
|
||||
};
|
||||
});
|
|
@ -19,5 +19,4 @@
|
|||
@import 'components/summary_status/index';
|
||||
@import 'components/table/index';
|
||||
@import 'components/logstash/pipeline_viewer/views/index';
|
||||
@import 'directives/chart/index';
|
||||
@import 'components/elasticsearch/shard_allocation/index';
|
||||
|
|
Loading…
Reference in a new issue