Skip to content

Commit

Permalink
[inspector] show cluster details tab in inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Sep 7, 2023
1 parent 3151aad commit 66c3f08
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React, { Component } from 'react';
import type { RequestDetailsProps } from '../../types';

export class Clusters extends Component<RequestDetailsProps> {
static shouldShow = (request: Request) =>
Boolean(request.response?.json);

render() {
return this.props.request.response?.json
? <div>Cluster details go here</div>
: null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
export { RequestDetailsRequest } from './req_details_request';
export { RequestDetailsResponse } from './req_details_response';
export { RequestDetailsStats } from './req_details_stats';
export { Clusters } from './clusters';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
import { i18n } from '@kbn/i18n';
import { EuiTab, EuiTabs } from '@elastic/eui';

import { RequestDetailsRequest, RequestDetailsResponse, RequestDetailsStats } from './details';
import { Clusters, RequestDetailsRequest, RequestDetailsResponse, RequestDetailsStats } from './details';
import { RequestDetailsProps } from './types';

interface RequestDetailsState {
Expand All @@ -33,6 +33,13 @@ const DETAILS: DetailViewData[] = [
}),
component: RequestDetailsStats,
},
{
name: 'clusters',
label: i18n.translate('inspector.requests.clustersTabLabel', {
defaultMessage: 'Clusters',
}),
component: Clusters,
},
{
name: 'Request',
label: i18n.translate('inspector.requests.requestTabLabel', {
Expand Down

0 comments on commit 66c3f08

Please sign in to comment.