优化样式

This commit is contained in:
limil 2026-02-17 22:11:54 +08:00
parent 1d4805fcd7
commit 9f6b860f5f
2 changed files with 41 additions and 4 deletions

View File

@ -115,6 +115,40 @@
font-weight: 500;
}
.subnet-list > *:not(label) {
padding-left: 16px;
/* 节点名称与 CIDR 区分样式 */
.subnet-node-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 6px 8px;
border-radius: 6px;
background: transparent;
}
.subnet-node-label {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
flex: 1;
}
.subnet-node-label .node-name {
font-weight: 600;
color: #0f172a;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
flex: 1 1 auto;
}
.subnet-node-label .cidr-tag {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
font-size: 12px;
color: #6b7280;
background: #f3f4f6;
padding: 2px 8px;
border-radius: 999px;
}

View File

@ -129,7 +129,10 @@ function SubnetItem({index, subnets, setSubnets} : SubnetProps) : ReactNode {
if(!node) return <></>
return (
<div className="subnet-node-item" key={nodeInfo.nodeId}>
<label className="subnet-node-label">{`${node.data.label}: ${nodeInfo.cidr?.toString()}`}</label>
<label className="subnet-node-label">
<span className="node-name" title={node.data.label}>{node.data.label}</span>
<span className="cidr-tag">{nodeInfo.cidr?.toString() || ''}</span>
</label>
<button className="btn-node-remove" onClick={_ => handleRemoveNodeSubnet(nodeInfo.nodeId)}></button>
</div>
)
@ -248,7 +251,7 @@ export default function SettingsEditor({
</div>
<div className="subnet-list">
<label></label>
{subnets.length > 0 && (<label></label>)}
{subnets.map((_, idx) =>
<SubnetItem
key={idx}