mirror of
https://github.com/hansjone/netx.git
synced 2026-10-10 09:50:44 +08:00
Add named multi-panel traffic boards with dedicated wall tabs.
Persist board/panel layouts server-side, open each board outside the network shell so workbench reloads do not refresh walls, and fix mapped-baseline chart overlay plus fullscreen fit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
214bc56774
commit
00d3e95e2d
22 changed files with 1923 additions and 345 deletions
|
|
@ -14,6 +14,8 @@ export type ModuleDefinition = {
|
|||
iconTone: ModuleIconTone;
|
||||
titleKey: string;
|
||||
adminOnly?: boolean;
|
||||
/** Hide from workbench launcher; still used for module window registration. */
|
||||
workbenchHidden?: boolean;
|
||||
};
|
||||
|
||||
export const MODULES: readonly ModuleDefinition[] = [
|
||||
|
|
@ -62,6 +64,16 @@ export const MODULES: readonly ModuleDefinition[] = [
|
|||
iconTone: "slate",
|
||||
titleKey: "layout.titleWebcrt",
|
||||
},
|
||||
{
|
||||
moduleId: "port-traffic-wall",
|
||||
path: "/port-traffic/wall",
|
||||
section: "operations",
|
||||
labelKey: "workbench.cards.portTrafficWall",
|
||||
descKey: "workbench.cards.portTrafficWallDesc",
|
||||
iconTone: "amber",
|
||||
titleKey: "layout.titlePortTrafficWall",
|
||||
workbenchHidden: true,
|
||||
},
|
||||
{
|
||||
moduleId: "users",
|
||||
path: "/users",
|
||||
|
|
@ -97,7 +109,9 @@ export function getModuleById(moduleId: string): ModuleDefinition | undefined {
|
|||
}
|
||||
|
||||
export function moduleIdFromPath(pathname: string): string | null {
|
||||
for (const m of MODULES) {
|
||||
// Longer paths first so /port-traffic/wall wins over shorter prefixes if added later.
|
||||
const ordered = [...MODULES].sort((a, b) => b.path.length - a.path.length);
|
||||
for (const m of ordered) {
|
||||
if (pathname === m.path || pathname.startsWith(`${m.path}/`)) return m.moduleId;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue