feat(ui): scope filter dropdowns to the current selection#97
Open
luohua13 wants to merge 1 commit into
Open
Conversation
The compute-management and workload list pages let you filter by overlapping
dimensions (card type, node, card). Previously each dropdown listed every value
in the cluster, so it was easy to pick combinations that can never match — e.g.
a node that has none of the selected card type, or a card that isn't on the
selected node — leaving the user with an empty table and no hint why.
This adds one-way cascading so a dependent dropdown only offers values that are
reachable given the current selection:
Compute-management page (card/admin):
* The node dropdown now lists only nodes that actually carry the selected card
type. When the type changes (via the select, the pie chart, or a ?type=
route query) a previously chosen node that no longer matches is cleared, so
the table is never filtered by an out-of-scope node. The prune runs
synchronously before each refresh to avoid querying with a stale node.
Workload list page (task/admin):
* Adds a card filter dropdown (the backend GetAllContainers already supports
the device_id filter). The dropdown lists only the cards on the selected
node, and switching node clears a chosen card that doesn't belong to it.
Both cascades reuse the node/card list data already fetched for the filters
(the node "type" array and the card "nodeName" field), so no extra API calls
are introduced.
Signed-off-by: luohua13 <jcwang@alauda.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: luohua13 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
/lgtm |
|
@Shenhan11: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compute-management and workload list pages let you filter by overlapping dimensions (card type, node, card). Previously each dropdown listed every value in the cluster, so it was easy to pick combinations that can never match — e.g. a node that has none of the selected card type, or a card that isn't on the selected node — leaving the user with an empty table and no hint why.
This adds one-way cascading so a dependent dropdown only offers values that are reachable given the current selection:
Compute-management page (card/admin):
Workload list page (task/admin):
Both cascades reuse the node/card list data already fetched for the filters (the node "type" array and the card "nodeName" field), so no extra API calls are introduced.