Improve topology discovery UX with review modals and live search.

Report unmatched/stub neighbors and matched links, move result lists into detail dialogs, deep-link edges to port traffic, and add fuzzy type-ahead canvas/palette NE search.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-01 13:35:52 +08:00
parent 2382cb8269
commit 8cf1696d8c
12 changed files with 1442 additions and 66 deletions

View file

@ -2265,6 +2265,79 @@ pre {
border-left: 1px solid #e2e8f0;
}
.topo-toolbar__group--find {
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.topo-find-suggest {
position: absolute;
top: calc(100% + 4px);
left: 0;
z-index: 30;
width: min(320px, 70vw);
max-height: 280px;
overflow: auto;
background: #fff;
border: 1px solid #cbd5e1;
border-radius: 8px;
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.topo-find-suggest__item {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
width: 100%;
padding: 8px 10px;
border: 0;
background: transparent;
text-align: left;
cursor: pointer;
}
.topo-find-suggest__item:hover,
.topo-find-suggest__item.is-active {
background: #eff6ff;
}
.topo-find-suggest__name {
font-size: 12px;
font-weight: 600;
color: #0f172a;
}
.topo-find-suggest__meta {
font-size: 11px;
color: #64748b;
}
.topo-find-suggest__empty,
.topo-find-suggest__more {
padding: 8px 10px;
font-size: 12px;
color: #94a3b8;
}
.topo-toolbar__find {
width: 150px;
max-width: 28vw;
height: 30px;
padding: 0 8px;
border: 1px solid #cbd5e1;
border-radius: 6px;
font-size: 12px;
background: #fff;
}
.topo-toolbar__find:disabled {
opacity: 0.55;
}
.topo-toolbar__title {
display: flex;
align-items: center;
@ -2653,7 +2726,7 @@ pre {
display: flex;
flex-direction: column;
gap: 8px;
max-height: 220px;
max-height: none;
padding: 10px 12px;
background: #f8fafc;
border-bottom: 1px solid #e2e8f0;
@ -2667,12 +2740,106 @@ pre {
gap: 8px;
}
.topo-discover__progress {
display: flex;
flex-direction: column;
gap: 4px;
}
.topo-discover__bar {
height: 6px;
border-radius: 999px;
background: #e2e8f0;
overflow: hidden;
}
.topo-discover__bar-fill {
height: 100%;
background: #2563eb;
transition: width 0.2s ease;
}
.topo-discover__progress-meta {
display: flex;
justify-content: space-between;
gap: 8px;
font-size: 12px;
color: #475569;
}
.topo-discover__summary {
margin: 0;
font-size: 13px;
color: #334155;
}
.topo-discover__filters {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.topo-discover__filter {
display: inline-flex;
align-items: center;
gap: 4px;
height: 26px;
padding: 0 8px;
border: 1px solid #cbd5e1;
border-radius: 999px;
background: #fff;
font-size: 12px;
color: #475569;
cursor: pointer;
}
.topo-discover__filter.is-active {
border-color: #2563eb;
background: #eff6ff;
color: #1d4ed8;
}
.topo-discover__filter--primary {
border-color: #2563eb;
background: #2563eb;
color: #fff;
}
.topo-discover__filter--primary .topo-discover__filter-count {
color: #fff;
}
.topo-discover__filter-count {
font-variant-numeric: tabular-nums;
font-weight: 600;
}
.topo-discover__empty-ok {
margin: 0;
font-size: 12px;
color: #166534;
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.topo-discover__link {
border: 0;
background: none;
padding: 0;
color: #2563eb;
cursor: pointer;
font-size: 12px;
text-decoration: underline;
}
.topo-discover__cap {
margin: 0;
font-size: 11px;
color: #94a3b8;
}
.topo-discover__error {
margin: 0;
font-size: 13px;
@ -2688,49 +2855,273 @@ pre {
min-height: 0;
}
.topo-discover__list li {
padding: 8px;
border-radius: 8px;
margin-bottom: 4px;
background: #fff;
.topo-discover__list--modal {
max-height: min(52vh, 480px);
border: 1px solid #e2e8f0;
border-radius: 8px;
padding: 4px;
background: #f8fafc;
}
.topo-discover__list li.is-fail {
.topo-discover-list-modal {
width: min(880px, 100%);
}
.topo-discover__list > li {
margin-bottom: 2px;
background: #fff;
border: 1px solid #e2e8f0;
border-radius: 6px;
}
.topo-discover__list > li.is-fail {
border-color: #fecaca;
background: #fff1f2;
}
.topo-discover__item-title {
.topo-discover__list > li.is-warn {
border-color: #fde68a;
background: #fffbeb;
}
.topo-discover__row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
width: 100%;
padding: 5px 8px;
border: 0;
background: transparent;
text-align: left;
cursor: pointer;
}
.topo-discover__row-main {
display: flex;
align-items: baseline;
gap: 8px;
min-width: 0;
flex: 1;
flex-wrap: wrap;
}
.topo-discover__row-name {
font-weight: 600;
font-size: 12px;
color: #0f172a;
}
.topo-discover__row-ip {
font-size: 12px;
color: #64748b;
font-variant-numeric: tabular-nums;
}
.topo-discover__row-meta {
font-size: 11px;
color: #94a3b8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.topo-discover__badge {
flex-shrink: 0;
font-size: 11px;
font-weight: 700;
color: #166534;
}
.topo-discover__list li.is-fail .topo-discover__badge {
.topo-discover__list > li.is-fail .topo-discover__badge {
color: #b91c1c;
}
.topo-discover__list > li.is-warn .topo-discover__badge {
color: #b45309;
}
.topo-discover__detail {
padding: 0 8px 6px;
border-top: 1px dashed #e2e8f0;
}
.topo-discover__item-meta,
.topo-discover__item-cmd {
.topo-discover__item-cmd,
.topo-discover__item-warn {
margin-top: 2px;
font-size: 12px;
color: #64748b;
}
.topo-discover__item-cmd {
.topo-discover__item-warn {
color: #b45309;
}
.topo-discover__unmatched {
margin: 6px 0 0;
padding-left: 1.1rem;
font-size: 11px;
color: #92400e;
}
.topo-discover__unmatched-more {
list-style: none;
margin-left: -1.1rem;
color: #a16207;
}
.topo-discover__row-actions {
display: inline-flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
.topo-discover__detail-btn {
font-size: 11px;
color: #2563eb;
white-space: nowrap;
}
.topo-discover__badge--lg {
font-size: 12px;
padding: 2px 8px;
border-radius: 999px;
background: #ecfdf5;
}
.topo-discover__badge--lg.is-fail {
background: #fff1f2;
color: #b91c1c;
}
.topo-discover__badge--lg.is-warn {
background: #fffbeb;
color: #b45309;
}
.topo-discover-modal {
display: block;
width: min(960px, 100%);
max-height: min(88vh, 900px);
overflow: auto;
}
.topo-discover-modal__head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.topo-discover-modal__head h3 {
margin: 0;
}
.topo-discover-modal__sub {
margin: 4px 0 0;
font-size: 13px;
color: #64748b;
}
.topo-discover-modal__stats {
margin-top: 8px;
font-size: 13px;
color: #334155;
}
.topo-discover-modal__section {
margin: 14px 0 8px;
font-size: 13px;
font-weight: 700;
color: #0f172a;
}
.topo-discover-modal__table-wrap {
overflow-x: auto;
overflow-y: visible;
max-height: none;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #fff;
}
.topo-discover-modal__table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
table-layout: auto;
}
.topo-discover-modal__table th,
.topo-discover-modal__table td {
padding: 8px 10px;
border-bottom: 1px solid #e2e8f0;
text-align: left;
vertical-align: top;
color: #0f172a;
background: #fff;
}
.topo-discover-modal__table th {
position: static;
background: #f8fafc;
color: #475569;
font-weight: 600;
white-space: nowrap;
}
.topo-discover-modal__table tbody tr:last-child td {
border-bottom: 0;
}
.topo-discover-modal__peer {
display: flex;
flex-direction: column;
gap: 2px;
}
.topo-discover-modal__peer span {
color: #64748b;
}
.topo-discover-action.is-added {
color: #166534;
font-weight: 600;
}
.topo-discover-action.is-updated {
color: #1d4ed8;
font-weight: 600;
}
.topo-discover-action.is-kept_manual {
color: #a16207;
font-weight: 600;
}
.topo-discover-modal__raw {
margin: 0;
padding: 10px 12px;
max-height: min(36vh, 360px);
overflow: auto;
background: #0f172a;
color: #e2e8f0;
border-radius: 8px;
font-size: 11px;
line-height: 1.45;
white-space: pre-wrap;
word-break: break-word;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.topo-discover-list-modal .topo-discover__list--modal {
max-height: min(52vh, 480px);
overflow: auto;
}
.topo-canvas {
position: relative;
flex: 1;
@ -2812,6 +3203,22 @@ pre {
margin: 0 auto;
}
.react-flow__node.is-search-hit .topo-node__glyph {
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.85);
border-radius: 10px;
animation: topo-search-pulse 0.85s ease 2;
}
@keyframes topo-search-pulse {
0%,
100% {
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.85);
}
50% {
box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.25);
}
}
.topo-node__handle {
width: 10px !important;
height: 10px !important;