yaooqinn opened a new pull request, #54632:
URL: https://github.com/apache/spark/pull/54632

   ### What changes were proposed in this pull request?
   
   Switches the Environment page from server-side Scala XML table rendering to 
client-side DataTables populated via the existing REST API endpoint 
(`/api/v1/applications/{appId}/environment`).
   
   **EnvironmentPage.scala:**
   - Remove all `UIUtils.listingTable` calls and server-side data preparation
   - Remove badge counts from tabs (JS adds them dynamically after data loads)
   - Add loading spinner placeholders in each tab pane
   - Include `environmentpage.js` and `utils.js` as ES modules
   - Enable DataTables via `useDataTables = true` in `headerSparkPage`
   
   **environmentpage.js:**
   - Rewrite as ES module importing `getStandAloneAppId` and 
`setDataTableDefaults` from `utils.js`
   - Fetch environment data via REST API on page load
   - Create DataTables with sorting, searching, and pagination for each section
   - Use `deferRender: true` for performance with 1000+ row tables (e.g., 
Hadoop Properties)
   - Format Resource Profiles with structured executor/task resource text
   - Dynamically update badge counts on tabs after data loads
   - Persist active tab state in localStorage
   - Adjust DataTable columns on tab switch for correct rendering in hidden 
panes
   
   ### Why are the changes needed?
   
   This continues the modernization of the Spark UI Environment page started in 
SPARK-55834. Moving to client-side rendering:
   - Reduces server-side HTML payload significantly (especially for 1000+ 
Hadoop properties)
   - Adds built-in search, sort, and pagination via DataTables
   - Follows the same pattern used by the Executors page
   - Improves user experience for environments with many properties
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The Environment page tables now render client-side with DataTables, 
providing:
   - Built-in search/filter across all columns
   - Column sorting
   - Pagination (important for large property sets)
   - Loading spinners while data fetches
   
   ### How was this patch tested?
   
   - `./dev/lint-js` — passed
   - `./dev/scalastyle` — passed
   - `./build/sbt core/compile` — passed
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, GitHub Copilot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to