fix: Broker 列表标识当前 Controller

This commit is contained in:
GraceWalk
2022-09-13 14:37:20 +08:00
parent 20756a3453
commit 8d22a0664a

View File

@@ -14,6 +14,7 @@ export const getBrokerListColumns = (arg?: any) => {
// eslint-disable-next-line react/display-name // eslint-disable-next-line react/display-name
render: (t: number, r: any) => { render: (t: number, r: any) => {
return r?.alive ? ( return r?.alive ? (
<>
<a <a
onClick={() => { onClick={() => {
window.location.hash = `brokerId=${t || t === 0 ? t : ''}&host=${r.host || ''}`; window.location.hash = `brokerId=${t || t === 0 ? t : ''}&host=${r.host || ''}`;
@@ -21,12 +22,41 @@ export const getBrokerListColumns = (arg?: any) => {
> >
{t} {t}
</a> </a>
{r?.kafkaRoleList?.includes('controller') && (
<Tag
style={{
color: '#556EE6',
padding: '2px 5px',
background: '#eff1fd',
marginLeft: '4px',
transform: 'scale(0.83,0.83)',
}}
>
Controller
</Tag>
)}
</>
) : ( ) : (
<>
<span>{t}</span> <span>{t}</span>
{r?.kafkaRoleList?.includes('controller') && (
<Tag
style={{
color: '#556EE6',
padding: '2px 5px',
background: '#eff1fd',
marginLeft: '4px',
transform: 'scale(0.83,0.83)',
}}
>
Controller
</Tag>
)}
</>
); );
}, },
fixed: 'left', fixed: 'left',
width: 120, width: 150,
}, },
// { // {
// title: 'Rack', // title: 'Rack',