in src/routes/Plugin/Discovery/TcpCard.js [33:76]
render() {
const { updateSelector, data, handleDelete, handleRefresh } = this.props
const { createTime, updateTime, props: selectorProps, forwardPort, discovery} = this.props.data
const propsJson = JSON.stringify(JSON.parse(selectorProps!== null && selectorProps.length > 0? selectorProps:'{}'), null, 4) ;
const content = (
<div>
<Text>{`${getIntlContent("SHENYU.SYSTEM.CREATETIME") }: ${formatTimestamp(createTime)}`}</Text>
<br />
<Text>{`${getIntlContent("SHENYU.SYSTEM.UPDATETIME") }: ${formatTimestamp(updateTime)}`}</Text>
<hr />
<div>
{getIntlContent("SHENYU.DISCOVERY.SELECTOR.PROPS")}
<span style={{ marginLeft: '2px', fontWeight: '500' }}>:</span>
</div>
<div>
<pre><code>{propsJson}</code></pre>
</div>
</div>
);
const typeIconMap = {
local: <LocalIcon style={{ fontSize: '40px', color: '#354458' }} />,
zookeeper: <ZkIcon style={{ fontSize: '40px', color: '#354458' }} />,
nacos: <NacosIcon style={{ fontSize: '40px', color: '#354458' }} />,
consul: <ConsulIcon style={{ fontSize: '40px', color: '#354458' }} />,
etcd: <EtcdIcon style={{ fontSize: '40px', color: '#354458' }} />,
};
const getAvatarIcon = () => {
return typeIconMap[discovery.type] || null;
};
return (
<Popover placement="leftTop" content={content}>
<Card
title={<div style={{ fontSize: '17px', lineHeight: '1.5'}}>{data.name}</div>}
bordered={false}
className={tcpStyles.tcpCard}
actions={[
<AuthButton perms="plugin:tcp:modify">
<Icon type="reload" key="reload" style={{color: '#2E496E', fontSize: "17px"}} onClick={() => handleRefresh(data.discoveryHandlerId)} />
</AuthButton>,
<AuthButton perms="plugin:tcp:modify">
<Icon type="edit" key="edit" style={{color: "#1352A2", fontSize: "17px"}} onClick={() => updateSelector(data.id)} />