Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6288fb2
Some changes
milindk8 Feb 13, 2023
a1d7899
Fixed auto node bug
milindk8 Feb 14, 2023
aa05135
Added terminated state
milindk8 Feb 14, 2023
3c44988
Fixed errorReason
milindk8 Feb 14, 2023
ff649e3
constant messaging
milindk8 Feb 15, 2023
0f0dfcd
Removed shell sh
milindk8 Feb 15, 2023
cd7b75a
Minor fix
milindk8 Feb 16, 2023
6afd9ca
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Feb 16, 2023
0462ec4
Fixed race condition bug
milindk8 Feb 17, 2023
b873d44
fix polling when time out
milindk8 Feb 17, 2023
db03eca
fix sizing in edit mode
milindk8 Feb 20, 2023
0bdaa4c
Placeholder changes
milindk8 Feb 21, 2023
596d1ca
Fixed width issue
milindk8 Feb 21, 2023
d73b067
fixed socket resize issue
gireesh-naidu Feb 21, 2023
5cfbb38
format code
gireesh-naidu Feb 21, 2023
2c0c2d9
minor review changes
gireesh-naidu Feb 21, 2023
4fb74f5
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Feb 23, 2023
64471db
Added selected node label
milindk8 Feb 23, 2023
247f061
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Feb 24, 2023
9f4b403
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 1, 2023
0c01dac
comment changes
milindk8 Mar 1, 2023
1022083
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 1, 2023
5684b26
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 2, 2023
baf4787
constants added
milindk8 Mar 2, 2023
6560c75
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 2, 2023
82385a0
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 3, 2023
a6b2714
Comment changes
milindk8 Mar 3, 2023
331f355
const changes
milindk8 Mar 3, 2023
e5fed32
Minor fix
milindk8 Mar 3, 2023
93f21db
Merge branch 'main' into cluster-terminal-enhancement
milindk8 Mar 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/components/ClusterNodes/ClusterEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ import React, { useState, useEffect } from 'react'
import { MESSAGING_UI } from '../../config'
import { showError } from '../common'
import { EventsTable } from '../v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/EventsTable'
import { PodEventsType } from '../v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/node.type'
import MessageUI from '../v2/common/message.ui'
import { getClusterEvents } from './clusterNodes.service'

export default function ClusterEvents({ terminalAccessId }: { terminalAccessId: number }) {
const [events, setEvents] = useState([])
export default function ClusterEvents({
terminalAccessId,
reconnectStart,
}: {
terminalAccessId: number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to type

reconnectStart?: () => void
}) {
const [events, setEvents] = useState<PodEventsType>()
const [loading, setLoading] = useState<boolean>(true)
const [isResourceMissing, setResourceMissing] = useState(false)

Expand All @@ -15,12 +22,13 @@ export default function ClusterEvents({ terminalAccessId }: { terminalAccessId:
getClusterEvents(terminalAccessId)
.then((response) => {
setLoading(false)
const events = response.result?.events.items
const events = response.result
setEvents(events)
Copy link
Contributor

@vivek-devtron vivek-devtron Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can directly set the data into setEvents no need to create the variable. also please accommodate events?.eventsResponse?.events.items it here only and and not at the time of passing the props on line no 45

})
.catch((error) => {
showError(error)
}).finally(() => {
})
.finally(() => {
setLoading(false)
})
} else {
Expand All @@ -32,6 +40,11 @@ export default function ClusterEvents({ terminalAccessId }: { terminalAccessId:
return isResourceMissing ? (
<MessageUI msg={MESSAGING_UI.NO_EVENTS} size={24} />
) : (
<EventsTable loading={loading} eventsList={events} />
<EventsTable
loading={loading}
eventsList={events?.eventsResponse?.events.items}
errorValue={events}
reconnect={reconnectStart}
/>
)
}
6 changes: 3 additions & 3 deletions src/components/ClusterNodes/ClusterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouteMatch } from 'react-router'
import { ReactComponent as Search } from '../../assets/icons/ic-search.svg'
import { ReactComponent as Clear } from '../../assets/icons/ic-error.svg'
import { getClusterList } from './clusterNodes.service'
import { handleUTCTime, Progressing, filterImageList, showError } from '../common'
import { handleUTCTime, Progressing, filterImageList, showError, createGroupSelectList } from '../common'
import { ClusterDetail, ClusterListResponse, ClusterListType } from './types'
import PageHeader from '../common/header/PageHeader'
import { toast } from 'react-toastify'
Expand All @@ -31,7 +31,7 @@ export default function ClusterList({ imageList, isSuperAdmin, namespaceList }:
const [searchApplied, setSearchApplied] = useState(false)
const [showTerminalModal, setShowTerminal] = useState(false)
const [terminalclusterData, setTerminalCluster] = useState<ClusterDetail>()

const getData = () => {
setLoader(true)
getClusterList()
Expand Down Expand Up @@ -259,7 +259,7 @@ export default function ClusterList({ imageList, isSuperAdmin, namespaceList }:
<ClusterTerminal
clusterId={terminalclusterData.id}
clusterName={terminalclusterData.name}
nodeList={terminalclusterData.nodeNames}
nodeGroups={createGroupSelectList(terminalclusterData?.nodeDetails,'nodeName')}
closeTerminal={closeTerminal}
clusterImageList={nodeImageList}
namespaceList={namespaceList[terminalclusterData.name]}
Expand Down
Loading