Skip to content

Commit f2eaf07

Browse files
committed
Added single vs ccs condtion
1 parent 0492e27 commit f2eaf07

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

x-pack/plugins/monitoring/public/services/clusters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export function monitoringClustersProvider($injector) {
6969
if (Legacy.shims.isCloud) {
7070
return Promise.resolve();
7171
}
72-
72+
const css = window.location.hash.split('?')[0] === '#/home' ? 'css' : 'single';
7373
return $http
74-
.get('../api/monitoring/v1/elasticsearch_settings/check/internal_monitoring')
74+
.get(`../api/monitoring/v1/elasticsearch_settings/check/internal_monitoring/${css}`)
7575
.then(({ data }) => {
7676
showInternalMonitoringToast({
7777
legacyIndices: data.legacy_indices,

x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch_settings/check/internal_monitoring.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { schema } from '@kbn/config-schema';
78
import { RequestHandlerContext } from 'kibana/server';
89
import {
910
INDEX_PATTERN_ELASTICSEARCH,
@@ -73,21 +74,31 @@ export function internalMonitoringCheckRoute(
7374
) {
7475
npRoute.router.get(
7576
{
76-
path: '/api/monitoring/v1/elasticsearch_settings/check/internal_monitoring',
77-
validate: false,
77+
path: '/api/monitoring/v1/elasticsearch_settings/check/internal_monitoring/{ccs}',
78+
validate: {
79+
params: schema.object({
80+
ccs: schema.maybe(schema.string()),
81+
}),
82+
},
7883
},
79-
async (context, _request, response) => {
84+
async (context, request, response) => {
8085
try {
8186
const typeCount = {
8287
legacy_indices: 0,
8388
mb_indices: 0,
8489
};
8590

8691
const config = server.config();
87-
const ccs = '*';
88-
const esIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_ELASTICSEARCH, ccs, true);
89-
const kbnIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_KIBANA, ccs, true);
90-
const lsIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_LOGSTASH, ccs, true);
92+
const { ccs } = request.params;
93+
const ccsPrefix = ccs === 'ccs' ? '*' : null;
94+
const esIndexPattern = prefixIndexPattern(
95+
config,
96+
INDEX_PATTERN_ELASTICSEARCH,
97+
ccsPrefix,
98+
true
99+
);
100+
const kbnIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_KIBANA, ccsPrefix, true);
101+
const lsIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_LOGSTASH, ccsPrefix, true);
91102

92103
const indexCounts = await Promise.all([
93104
checkLatestMonitoringIsLegacy(context, esIndexPattern),

0 commit comments

Comments
 (0)