Fixes #37478 - Add host power status column to new All Hosts page #10171
+81
−7
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.
This adds a Power Status column to the new All Hosts page.
Since there is no bulk endpoint for power status, I decided to use the existing API endpoint
/hosts/power
.per_page
API requests at a time. This seems reasonable to me.I added a fake delay and random power status for ease of testing. This will wait 1-4 seconds and give you a random power status back. This way you can see what it looks like when requests come in at different times.
The old page had red for powered off, but I decided to go with black here; it seems a bit less harsh.
I used the PF4-recommended icons for denoting "powered on," "powered off," and "unknown state."