diff --git a/react/src/components/ComputeSessionNodeItems/ContainerLogModal.tsx b/react/src/components/ComputeSessionNodeItems/ContainerLogModal.tsx index b8a1b2cda0..05dba084c7 100644 --- a/react/src/components/ComputeSessionNodeItems/ContainerLogModal.tsx +++ b/react/src/components/ComputeSessionNodeItems/ContainerLogModal.tsx @@ -1,5 +1,6 @@ import { downloadBlob } from '../../helper/csv-util'; import { useSuspendedBackendaiClient } from '../../hooks'; +import { useCurrentUserRole } from '../../hooks/backendai'; import { useTanQuery } from '../../hooks/reactQueryAlias'; import { useMemoWithPrevious } from '../../hooks/useMemoWithPrevious'; import BAIModal, { BAIModalProps } from '../BAIModal'; @@ -33,6 +34,7 @@ const ContainerLogModal: React.FC = ({ }) => { const baiClient = useSuspendedBackendaiClient(); const { token } = theme.useToken(); + const userRole = useCurrentUserRole(); const session = useFragment( graphql` @@ -48,6 +50,7 @@ const ContainerLogModal: React.FC = ({ id row_id container_id + cluster_idx cluster_role } } @@ -170,13 +173,31 @@ const ContainerLogModal: React.FC = ({ resetPreviousLineNumber(); }} options={_.chain(session?.kernel_nodes?.edges) + .sortBy((e) => `${e?.node?.cluster_role} ${e?.node?.cluster_idx}`) .map((e) => { return { - label: e?.node?.cluster_role, + label: ( + <> + {e?.node?.cluster_role} + {e?.node?.cluster_role !== 'main' + ? e?.node?.cluster_idx + : ''} + {userRole === 'admin' || userRole === 'superadmin' ? ( + + ({(e?.node?.row_id || '').substring(0, 5)}) + + ) : null} + + ), value: e?.node?.row_id, }; }) - .sortBy('label') .value()} />