Refactor web UI: feature-first structure, tokenized styles, modern blue theme.

Structure
- pages/ -> features/<domain>/{Page, components, hooks, lib}; 95 files moved,
  333 imports rewritten, verified with tsc.
- services/api.ts -> services/api/<domain>.ts (250 exports preserved),
  types.ts -> types/<domain>.ts, i18n zh/en -> locales/<lang>/<namespace>.ts
  (2696 messages deep-equal before/after).
- ESLint rule: shared layers must not import features/.

Styles
- index.css (16k lines) split losslessly into styles/{base,layout,components,
  pages,legacy,theme}; compiled CSS was byte-identical before tokenizing.
- ~930 hard-coded colors replaced by --nx-* tokens (theme/tokens.css); WebCRT
  off-palette colors unified; fixed dark-on-dark text introduced by mapping.
- theme/theme.css: modern blue design language (rounded shapes, gradients,
  unified buttons/fields/tables/modals), form-grid alignment fix, flat nav list
  without tree indent, soft selected state instead of left accent bar.

Docs: WEB.md documents code structure and style rules.
Not touched: the large Biz*/Webcrt/Topology page components (to be split later).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
oliver 2026-10-12 03:17:51 +08:00
parent 3b45d6abe3
commit 0d894efe5e
196 changed files with 26947 additions and 28091 deletions

View file

@ -1,33 +0,0 @@
/** Flat world-map canvas (LOD / scatter). Temporarily offline in the UI. */
export const WORLD_MAP_ENABLED = false;
export const LAST_LEAF_KEY = "netx.topology.lastLeafViewId";
export const TREE_EXPAND_KEY = "netx.topology.treeExpanded";
export const SIDEBAR_WIDTH_KEY = "netx.topology.sidebarWidth";
export const SIDEBAR_WIDTH_DEFAULT = 260;
export const SIDEBAR_WIDTH_MIN = 180;
export const SIDEBAR_WIDTH_MAX = 560;
export const UNDO_MAX = 40;
export const PALETTE_DND = "application/x-netx-topo-palette";
export const SEP = " / ";
export const FIT_VIEW_OPTS = { padding: 0.2, includeHiddenNodes: true } as const;
export const WORLD_LOCATE_ZOOM = 0.22;
export const WORLD_LOCATE_HALF = 12000;
export const WORLD_FLAT_ACCUM_CAP = 8000;
export const EDGE_DEFAULTS_KEY = "netx.topology.edgeDefaults";
export const AUTO_LAYOUT_DISCOVER_KEY = "netx.topology.autoLayoutAfterDiscover";
export const DISCOVER_AUTO_ADD_KEY = "netx.topology.discoverAutoAddUnmatched.v2";
export const DISCOVER_PROJECT_NEIGHBORS_KEY = "netx.topology.discoverProjectNeighbors.v2";
export const SCALE_BUNDLE_WIDTH_KEY = "netx.topology.scaleBundleWidth";
export const SHOW_PLACEHOLDER_BADGE_KEY = "netx.topology.showPlaceholderBadge";
export const SHOW_CONNECT_STATUS_KEY = "netx.topology.showConnectStatus";
export const SHOW_ALARM_OVERLAY_KEY = "netx.topology.showAlarmOverlay";
export const SHOW_LEVEL_COLORS_KEY = "netx.topology.showLevelColors";
export const CANVAS_BG_KEY = "netx.topology.canvasBg";
export const DEFAULT_CANVAS_BG = "#0f172a";
export const LEGACY_CANVAS_BG = "#dbeafe";
export const LABEL_COLORS_KEY = "netx.topology.labelColors";
export const VENDOR_COLORS_KEY = "netx.topology.vendorColors";