@@ -7,20 +7,9 @@ import { Table } from '@scality/core-ui/dist/next';
77import { NodeTab } from './style/CommonLayoutStyle' ;
88import { TooltipContent } from './TableRow' ;
99import { fromMilliSectoAge } from '../services/utils' ;
10- import {
11- STATUS_RUNNING ,
12- STATUS_PENDING ,
13- STATUS_FAILED ,
14- STATUS_UNKNOWN ,
15- GRAFANA_DASHBOARDS ,
16- } from '../constants' ;
10+ import { STATUS_RUNNING , STATUS_PENDING , STATUS_FAILED , STATUS_UNKNOWN , GRAFANA_DASHBOARDS } from '../constants' ;
1711import { useIntl } from 'react-intl' ;
18- const PodTableContainer = styled . div `
19- color: ${ ( props ) => props . theme . textPrimary } ;
20- padding-top: ${ spacing . r20 } ;
21- height: calc(100% - ${ spacing . r16 } );
22- width: 100%;
23- ` ;
12+
2413// Color specification:
2514// Pod Running + All Containers are ready => Green
2615// Pod Running + At least one container is not ready => Orange
@@ -34,10 +23,7 @@ const StatusText = styled.div<{ status; numContainer?; numContainerRunning? }>`
3423
3524 if ( status === STATUS_RUNNING && numContainer === numContainerRunning ) {
3625 return props . theme . statusHealthy ;
37- } else if (
38- status === STATUS_RUNNING &&
39- numContainer !== numContainerRunning
40- ) {
26+ } else if ( status === STATUS_RUNNING && numContainer !== numContainerRunning ) {
4127 return props . theme . statusWarning ;
4228 } else if ( status === STATUS_RUNNING || status === STATUS_PENDING ) {
4329 return props . theme . statusWarning ;
@@ -83,20 +69,14 @@ const NodePagePodsTab = React.memo((props) => {
8369 const {
8470 values : { status : statusB } ,
8571 } = rowb ;
86- const valueA =
87- statusA . status + statusA . numContainer + statusA . numContainerRunning ;
88- const valueB =
89- statusB . status + statusB . numContainer + statusB . numContainerRunning ;
72+ const valueA = statusA . status + statusA . numContainer + statusA . numContainerRunning ;
73+ const valueB = statusB . status + statusB . numContainer + statusB . numContainerRunning ;
9074 return valueA . localeCompare ( valueB ) ;
9175 } ,
9276 Cell : ( cellProps ) => {
9377 const { status, numContainer, numContainerRunning } = cellProps . value ;
9478 return status === STATUS_RUNNING ? (
95- < StatusText
96- status = { status }
97- numContainer = { numContainer }
98- numContainerRunning = { numContainerRunning }
99- >
79+ < StatusText status = { status } numContainer = { numContainer } numContainerRunning = { numContainerRunning } >
10080 { `${ status } (${ numContainerRunning } /${ numContainer } )` }
10181 </ StatusText >
10282 ) : (
@@ -127,37 +107,39 @@ const NodePagePodsTab = React.memo((props) => {
127107 marginRight : spacing . r8 ,
128108 } ,
129109 } ,
130- {
131- Header : 'Logs' ,
132- accessor : 'log' ,
133- cellStyle : {
134- minWidth : '3rem' ,
135- textAlign : 'center' ,
136- flex : 0.5 ,
137- marginRight : spacing . r16 ,
138- } ,
139- Cell : ( { value } ) => {
140- return (
141- < Tooltip
142- overlay = {
143- < TooltipContent >
144- { intl . formatMessage ( {
145- id : 'advanced_monitoring' ,
146- } ) }
147- </ TooltipContent >
148- }
149- >
150- < ExternalLink
151- href = { `${ config . api . url_grafana } /d/${ GRAFANA_DASHBOARDS . logs } ?orgId=1&var-logs=Loki&var-logmetrics=Prometheus&var-metrics=Prometheus&var-podlogs=.*&var-systemlogs=.%2B&var-deployment=calico-kube-controllers&var-pod=${ value } ` }
152- target = "_blank"
153- rel = "noopener noreferrer"
154- >
155- < Icon name = "Metrics" />
156- </ ExternalLink >
157- </ Tooltip >
158- ) ;
159- } ,
160- } ,
110+ // Loki need to be activate for this link to works. Since it's deactivated by default,
111+ // We decide to hide this column for now. See: https://scality.atlassian.net/browse/MK8S-178
112+ // {
113+ // Header: 'Logs',
114+ // accessor: 'log',
115+ // cellStyle: {
116+ // minWidth: '3rem',
117+ // textAlign: 'center',
118+ // flex: 0.5,
119+ // marginRight: spacing.r16,
120+ // },
121+ // Cell: ({ value }) => {
122+ // return (
123+ // <Tooltip
124+ // overlay={
125+ // <TooltipContent>
126+ // {intl.formatMessage({
127+ // id: 'advanced_monitoring',
128+ // }) }
129+ // </TooltipContent>
130+ // }
131+ // >
132+ // <ExternalLink
133+ // href={`${config.api.url_grafana}/d/${GRAFANA_DASHBOARDS.logs}?orgId=1&var-logs=Loki&var-logmetrics=Prometheus&var-metrics=Prometheus&var-podlogs=.*&var-systemlogs=.%2B&var-deployment=calico-kube-controllers&var-pod=${value}` }
134+ // target="_blank"
135+ // rel="noopener noreferrer"
136+ // >
137+ // <Icon name="Metrics" />
138+ // </ExternalLink>
139+ // </Tooltip>
140+ // );
141+ // },
142+ // },
161143 ] , // eslint-disable-next-line react-hooks/exhaustive-deps
162144 [ config ] ,
163145 ) ;
@@ -174,10 +156,7 @@ const NodePagePodsTab = React.memo((props) => {
174156 } ,
175157 } }
176158 >
177- < Table . SingleSelectableContent
178- rowHeight = "h48"
179- separationLineVariant = "backgroundLevel3"
180- />
159+ < Table . SingleSelectableContent rowHeight = "h48" separationLineVariant = "backgroundLevel3" />
181160 </ Table >
182161 </ NodeTab >
183162 ) ;
0 commit comments