Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [WD-18263] CMS Storage pool usage #1124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kxiru
Copy link
Contributor

@Kxiru Kxiru commented Feb 25, 2025

Done

  • Displaying multiple pools depending on Cluster

Fixes [list issues/bugs if needed]

QA

  1. Run the LXD-UI:
  2. Perform the following QA steps:
    • Review the Storage Pool list page on a clustered and non-clustered environment.

Screenshots

image

@Kxiru Kxiru requested a review from edlerd February 25, 2025 01:24
@Kxiru Kxiru self-assigned this Feb 25, 2025
@webteam-app
Copy link

@Kxiru Kxiru force-pushed the cms-pool-usage branch 2 times, most recently from b27c6b5 to 7d0c01c Compare February 25, 2025 02:03
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve the approach for the data loading. See comment below.

@Kxiru Kxiru requested a review from edlerd February 26, 2025 19:23
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks already very neat. Data loading code LGTM, QA of the data part as well.

The layout needs a bit of refinement, I think there are some improvements we should aim for.

@@ -11,7 +12,9 @@ interface Props {
const ResourceLink: FC<Props> = ({ type, value, to }) => {
return (
<Link
className="p-chip is-inline is-dense resource-link"
className={classNames("p-chip is-inline is-dense resource-link", {
"storage-pool-table": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be in the generic component

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted.

@@ -15,7 +15,7 @@ const Meter: FC<Props> = ({
hoverText,
}: Props) => {
return (
<>
<div className="p-meter-container">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we avoid those wrapper classes and find a way to style without having to add markup just for layouting.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we undo the changes here and in the meter.scss file? I assume with the two column solution most of it is not needed.

@Kxiru Kxiru force-pushed the cms-pool-usage branch 2 times, most recently from 508e565 to 47f2066 Compare February 27, 2025 12:16
@Kxiru Kxiru marked this pull request as ready for review February 27, 2025 12:24
@Kxiru Kxiru requested a review from edlerd February 27, 2025 12:24
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table is great. Some ideas for refinement below.

Comment on lines +59 to +71
{/* {isClustered && (
<ResourceLink
to="/ui/cluster"
type={
hasMemberSpecificSize ? "cluster-member" : "cluster-group"
}
value={
hasMemberSpecificSize && poolResource.memberName
? poolResource.memberName
: "Cluster wide"
}
/>
)} */}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{/* {isClustered && (
<ResourceLink
to="/ui/cluster"
type={
hasMemberSpecificSize ? "cluster-member" : "cluster-group"
}
value={
hasMemberSpecificSize && poolResource.memberName
? poolResource.memberName
: "Cluster wide"
}
/>
)} */}

}

return (
<div className="storage-pool-meter-container" key={index}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className="storage-pool-meter-container" key={index}>
<Fragment key={index}>

I think this is not needed.

Comment on lines +97 to +100
.storage-pool-meter-container {
align-items: center;
display: flex;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.storage-pool-meter-container {
align-items: center;
display: flex;
}

Seems not needed.

Comment on lines +102 to +104
.storage-pool-overview-meter {
display: flex;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.storage-pool-overview-meter {
display: flex;
}
.cluster-member-with-meters {
display: flex;
}

Better name and move this into the namespace for storage-overview-tab. This doesn't need to be on the root namespace.

@@ -38,7 +45,10 @@ const StoragePoolOverview: FC<Props> = ({ pool, project }) => {
</tr>
<tr>
<th className="u-text--muted">Size</th>
<td>
<td className="storage-pool-overview-meter">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<td className="storage-pool-overview-meter">
<td className="cluster-member-with-meters">

The styling of this one needs adjustments. The height of the member names should be aligned with the meters and there needs to be some gap between the chips and the meters.

image

? [
{
content: <StoragePoolClusterMember pool={pool} />,
role: "rowheader",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
role: "rowheader",
role: "cell",

@@ -11,7 +12,9 @@ interface Props {
const ResourceLink: FC<Props> = ({ type, value, to }) => {
return (
<Link
className="p-chip is-inline is-dense resource-link"
className={classNames("p-chip is-inline is-dense resource-link", {
"storage-pool-table": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted.

@@ -15,7 +15,7 @@ const Meter: FC<Props> = ({
hoverText,
}: Props) => {
return (
<>
<div className="p-meter-container">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we undo the changes here and in the meter.scss file? I assume with the two column solution most of it is not needed.

Comment on lines +28 to +30
.clustered-resource-link {
height: 2.25rem;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for the storage-pool-table and the migrate-instance-table > storage-pools. On the storage pool overview page, the height should be adjusted to match its context.

I suggest moving this into the SCSS files for the respective use cases instead of the global size in here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe hide the usage and cluster member columns on smaller screen sizes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because on small screen sizes, the columns and headings become unreadable. We can hide the columns with css and a media query below a reasonable breakpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants