1- import { useEffect } from 'react' ;
1+ import React , { useEffect } from 'react' ;
22import { useDispatch , useSelector } from 'react-redux' ;
33import cn from 'bem-cn-lite' ;
44import { useHistory , useLocation } from 'react-router' ;
5+ import { Breadcrumbs , BreadcrumbsItem , Link } from '@yandex-cloud/uikit' ;
56
6- import { clusterName as clusterNameLocation } from '../../store' ;
7+ import Divider from '../../components/Divider/Divider' ;
8+ //@ts -ignore
9+ import Icon from '../../components/Icon/Icon' ;
10+
11+ import { clusterName as clusterNameLocation , backend , customBackend } from '../../store' ;
712import { getClusterInfo } from '../../store/reducers/cluster' ;
813import { getHostInfo } from '../../store/reducers/host' ;
14+ import { HeaderItemType } from '../../store/reducers/header' ;
915
1016import './Header.scss' ;
11- import { Breadcrumbs , BreadcrumbsItem } from '@yandex-cloud/uikit' ;
12- import { HeaderItemType } from '../../store/reducers/header' ;
1317
1418const b = cn ( 'header' ) ;
1519
@@ -49,6 +53,12 @@ function Header() {
4953 const renderHeader = ( ) => {
5054 const clusterNameFinal = singleClusterMode ? host . ClusterName : clusterName ;
5155
56+ let link = backend + '/internal' ;
57+
58+ if ( singleClusterMode && ! customBackend ) {
59+ link = `/internal` ;
60+ }
61+
5262 const breadcrumbItems = header . reduce ( ( acc , el ) => {
5363 acc . push ( { text : el . text , action : ( ) => history . push ( el . link ) } ) ;
5464 return acc ;
@@ -63,8 +73,20 @@ function Header() {
6373 firstDisplayedItemsCount = { 1 }
6474 />
6575 </ div >
66- < div >
67- { clusterNameFinal && < ClusterName name = { clusterNameFinal } /> }
76+
77+ < div className = { b ( 'cluster-name-wrapper' ) } >
78+ < Link href = { link } target = "_blank" >
79+ Internal viewer{ ' ' }
80+ < Icon name = "external" viewBox = { '0 0 16 16' } width = { 16 } height = { 16 } />
81+ </ Link >
82+ { clusterNameFinal && (
83+ < React . Fragment >
84+ < div className = { b ( 'divider' ) } >
85+ < Divider />
86+ </ div >
87+ < ClusterName name = { clusterNameFinal } />
88+ </ React . Fragment >
89+ ) }
6890 </ div >
6991 </ header >
7092 ) ;
0 commit comments