Skip to content

Commit a438543

Browse files
committed
Migrate UI pages to Lit web components in antrea-ui-components
Replace the Clarity Core UI library with a new antrea-ui-components package of Lit-based custom elements, and migrate all page-level React components into it so a downstream Angular shell can consume them without the React dependency. New components library (client/web/antrea-ui-components): - antrea-button, antrea-alert, antrea-card, antrea-input, antrea-nav: lightweight replacements for the Clarity Core primitives - antrea-summary-page, antrea-settings-page: cluster info and feature gate management pages - antrea-traceflow-page: DOT graph rendering via d3-graphviz, polling loop with retry-after support, live/dropped-only capture modes - antrea-flow-visibility-page: SSE-backed live flow list with multi-select namespace/pod/service filtering, D3 force-simulation service map with namespace hulls, drag/zoom, and verdict-colored edges - Shared lib: FlowStreamClient (SSE with reconnect), FlowStore (bounded LRU with sliding-window bit rate), typed API helpers, design tokens React app (client/web/antrea-ui): - Replace all page route files with thin Lit wrapper components that forward the auth token and bridge antrea-session-expired events to the Redux-backed logout flow - Delete all React route files, page-level API modules, and store files that moved into the components library - Move @types/d3 to regular dependencies so the Docker build (npm install --omit=dev) still installs the type declarations needed when antrea-ui compiles the components source directly
1 parent 1782537 commit a438543

54 files changed

Lines changed: 6175 additions & 5427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/frontend.dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,25 @@
1414

1515
FROM node:24-bullseye-slim as build-web
1616

17+
# Optional: override the npm registry (e.g., for corporate proxies).
18+
# Leave unset to use the default registry (npmjs.org).
19+
ARG NPM_REGISTRY=""
20+
21+
# Install antrea-ui-components dependencies first so the link: resolution can find 'lit'.
22+
WORKDIR /antrea-ui-components
23+
COPY client/web/antrea-ui-components/package.json client/web/antrea-ui-components/package-lock.json ./
24+
COPY client/web/antrea-ui-components/src ./src
25+
COPY client/web/antrea-ui-components/tsconfig.json ./
26+
RUN if [ -n "$NPM_REGISTRY" ]; then npm config set registry "$NPM_REGISTRY"; fi && \
27+
npm install --omit=dev
28+
1729
WORKDIR /app
1830

1931
COPY client/web/antrea-ui/package.json .
2032
COPY client/web/antrea-ui/yarn.lock .
2133
COPY client/web/antrea-ui/.yarnrc.yml .
2234
COPY client/web/antrea-ui/.yarn ./.yarn
2335

24-
# Optional: override the npm registry (e.g., for corporate proxies).
25-
# Leave unset to use the default registry (npmjs.org).
26-
ARG NPM_REGISTRY=""
2736
RUN if [ -n "$NPM_REGISTRY" ]; then \
2837
echo "npmRegistryServer: \"$NPM_REGISTRY\"" >> .yarnrc.yml; \
2938
fi
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

0 commit comments

Comments
 (0)