Dedupe if-intf/config_interface collects and allow idle manual collect.

Remap legacy if_intf items, skip duplicate CLI+metric work, hide aux command duplicates in the workbook, use profile titles for sheet tabs, sticky table headers, and let scheduled tasks trigger collect-now when idle.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-20 10:35:04 +08:00
parent 18a0c41196
commit 99cec1c324
7 changed files with 241 additions and 42 deletions

View file

@ -10051,6 +10051,25 @@ html.login-page--paused .login-page__flare {
flex: 1 1 auto;
min-height: 240px;
max-height: min(48vh, 520px);
overflow: auto;
border-collapse: separate;
}
.bs-workbook-modal .bs-sheet-table {
overflow: auto;
}
.bs-workbook-modal .bs-sheet-table table {
border-collapse: separate;
border-spacing: 0;
}
.bs-workbook-modal .bs-sheet-table thead th {
position: sticky;
top: 0;
z-index: 2;
background: rgba(15, 23, 42, 0.98) !important;
box-shadow: 0 1px 0 rgba(148, 163, 184, 0.22);
}
.bs-cmp-result-table.bs-sheet-table {

View file

@ -166,29 +166,13 @@ function columnsFromRows(rows: Record<string, unknown>[]): SheetCol[] {
return keys.map((k) => ({ key: k, header: k }));
}
function metricSheetTitle(metricId: string, t: (k: string) => string): string {
const map: Record<string, string> = {
lldp_neighbor: t("bizState.sheetLldp"),
isis_adjacency: t("bizState.sheetIsis"),
interface_brief: t("bizState.sheetIfaceBrief"),
interface_detail: t("bizState.sheetIfaceBrief"),
arp: t("bizState.sheetArp"),
nd6_cache: t("bizState.sheetNd6"),
bgp_peer: t("bizState.sheetBgpPeer"),
config_interface: t("bizState.sheetConfigIface"),
config_vrf: t("bizState.sheetConfigVrf"),
config_bgp_peer: t("bizState.sheetConfigBgp"),
};
return map[metricId] || metricId;
}
function buildSheetTabs(batch: any, t: (k: string) => string): SheetTab[] {
const tabs: SheetTab[] = [];
const cmds = (batch?.commands || []) as SheetCmd[];
if (cmds.length) {
tabs.push({
id: "commands",
title: t("bizState.sheetCommands"),
title: "Commands",
rowCount: cmds.length,
commands: cmds,
});
@ -196,9 +180,10 @@ function buildSheetTabs(batch: any, t: (k: string) => string): SheetTab[] {
for (const s of (batch?.sheets || []) as any[]) {
const mid = String(s?.metric_id || "").trim();
if (!mid || mid === "vrf_list") continue;
const title = String(s?.title || "").trim() || mid;
tabs.push({
id: mid,
title: metricSheetTitle(mid, t),
title,
rowCount: Number(s?.row_count || 0),
commands: Array.isArray(s?.commands) ? (s.commands as SheetCmd[]) : [],
});
@ -1451,7 +1436,12 @@ export function BizStatePage() {
)}
</Modal.Body>
<Modal.Footer>
<Button size="sm" variant="primary" isDisabled={busy} onPress={() => void collectNow()}>
<Button
size="sm"
variant="primary"
isDisabled={busy || Boolean(detail?.collect_running)}
onPress={() => void collectNow()}
>
{t("bizState.collectNow")}
</Button>
<Button size="sm" variant="danger" isDisabled={busy} onPress={() => void removeTask(taskId)}>