Skip to content

mgr/dashboard: New Landing Page - #23568

Merged
LenzGr merged 3 commits into
ceph:masterfrom
rhcs-dashboard:wip-24573-landing-page
Sep 24, 2018
Merged

LenzGr merged 3 commits into
ceph:masterfrom
rhcs-dashboard:wip-24573-landing-page

Conversation

@alfonsomthd

@alfonsomthd alfonsomthd commented Aug 14, 2018 •

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest using ::ng-deep instead of /deep/, just so we use the same everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

recommended way to import this is: PopoverModule.forRoot()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

recommended way to import this is: PopoverModule.forRoot()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we use bootstrap classes for setting the column size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bootstrap 3 grid does not have a built-in solution for 5 equal full-width columns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need this wrapper div?
I think the margin can be set on the .card element and the rowClass can be set on the cd-info-card element, no need to have an extra element and input.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Refactored.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't all cards have the same size? I think we can remove this @input and class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not all cards have the same height: Configuration cards use the default card class,
meanwhile Perf. and Capacity Cards use "card-medium" (bigger height).

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch 5 times, most recently from 1f00d48 to 701ff65 Compare August 20, 2018 07:45

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from 569d4e1 to 90d59d5 Compare August 21, 2018 08:56

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you prefix this classes with cd-, it is a bit confusing with the ones from bootstrap, even more because the 5 has different meaning.

@alfonsomthd alfonsomthd Aug 21, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

color should be a variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, I forgot it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

color should be a variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, I forgot it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should put all css rules for this media query in the same block. No reason to declare 3 media queries for the same size.
Sames goes for the others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, although AFAIK the number of media queries does not have any performance impact. The separation seemed to me more readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

font-size seems a bit small when you use a xs screen.

@alfonsomthd alfonsomthd Aug 21, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't there a color scheme we can use instead of defining the colors?
It seems we are reverting a really recent change...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The Red & Blue colors were explicitly requested so I set the first ones (next are automatically chosen).
Nevertheless, I've set this topic to be discussed/solved in this issue:
https://tracker.ceph.com/issues/27050

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should use "col-md-12 col-lg-6" for the logs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would use this class only for big screens.
If you have a md screen or even a lg screen, the charts are too small.

My suggestion would be:
normal: "col-xs-12 col-sm-6 col-md-4 cd-col-5"
charts: "col-xs-12 col-sm-6 col-md-6 cd-col-5"
logs: "col-md-12 col-lg-6"

col-5 would have a media query with min-width 1200px.

@alfonsomthd alfonsomthd Aug 22, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.
Logs: OK.
Medium cards (including charts): Bootstrap 3 classes do not play well with 5 cols (awkward look) so I adapted cd-col-5 with media queries to show bigger charts
for md screen and lg screen.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we set the logs card a bit bigger? we can only see 4 lines atm.
And unset the justified text.

@alfonsomthd alfonsomthd Aug 21, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Logs card a bit bigger: Ack.
Done, although the justified text was requested by someone, I don't remember who.
As this is very subjective, can we reach a consensus about being or not justified,
because another one can ask to put it again...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from 19cff24 to f0fc5f4 Compare August 22, 2018 07:47

@LenzGr LenzGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've tested the new dashboard landing page in a local test environment today and it LGTM from an end-user perspective.

@LenzGr
LenzGr requested a review from Devp00l August 22, 2018 13:36

@Devp00l Devp00l left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The landing page containers jump beneath each other before the menu and the text size jump into mobile view. You can see this behavior with a display width of around 950px.

Here is the example
strangeview

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from 8f90e58 to 3622630 Compare August 23, 2018 12:44

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As this simple method gets more complexity, could you please make a private method out of it to shorten the size of the ngOnInit method?

@alfonsomthd alfonsomthd Aug 23, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This new code could be put in a new method as well.

And could you please add tests for this?

@alfonsomthd alfonsomthd Aug 23, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This could be also the first item in charTypes, which is only used here.
If you would do it, you could init charTypes in this method with const chartTypes = ['doughnut', 'pie']; and you can remove line 28, 29 and 30.

@alfonsomthd alfonsomthd Aug 23, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see your point, but I think this is a matter of coding style (very subjective).
Nevertheless, it is refactored.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As those colors are only used once and only here, they should not be class properties.

@alfonsomthd alfonsomthd Aug 23, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you please add debugElement tests for this file to make sure all components are rendered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As per our previous conversation, I've created this test coverage issue:
https://tracker.ceph.com/issues/27220

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about using the dimless pipe instead, This would shorten the number for large clusters a lot.

@alfonsomthd alfonsomthd Aug 23, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree. Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Through the use of many long static variables this isn't as readable as you intended.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IMHO it's a subjective matter.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would like to point out that I only found this usage in rbd.py and rbd_mirrowing.py where the same object is used.

IMHO it's not a subjective matter if it is mostly avoided except for the only case where it's suitable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Replace those static variables with the actual strings before merging this PR please.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Devp00l, I think literal references should be avoided as much as possible, as mistakes will be found at a later stage (worst case at runtime).

The following error (missing E in RECOVERY) will make unit tests/pylint fail:

   return client_perf[cls.POOL_STAT_RECOVRY_BYTES_PER_SEC]

However this other mistake will go unnoticed until some QA/E2E test is run:

   return client_perf['recovring_bytes_per_sec']

Unfortunately this can't be done in the front-end side without using some kind of model/schema validation, which is not currently happening.

More info on this topic

@Devp00l Devp00l Sep 10, 2018 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The problem is that these strings are only used once. If I have a typo in the object definition or in the call does not make a difference in this case. As said they are only used once, but it looks like they are a crucial part that is used in many places.

To reduce the use of each string use something like

for attr in [strings...]:
    client_perf[attr] = client_io[attr]

@votdev

votdev commented Aug 23, 2018 •

Copy link
Copy Markdown
Member

The section title should use a fixed font size imho, otherwise it gets too small and does not fit into the overall look and feel of the UI. See example:

auswahl_015

The default font size is 21px:
auswahl_016

@votdev

votdev commented Aug 23, 2018

Copy link
Copy Markdown
Member

What about this small design improvement (adding a line below the title)? You may also see a fixed font size of 21px in action:

auswahl_004

auswahl_005

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing i18n

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i18n-cardTitle is missing to support translating. Please check the other code for this behaviour, too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i18n-groupTitle is missing to support translating. Check the rest of the code, too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from c54a199 to ee1303c Compare August 24, 2018 11:24

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please remove the separations if they are not needed

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would like to point out that I only found this usage in rbd.py and rbd_mirrowing.py where the same object is used.

IMHO it's not a subjective matter if it is mostly avoided except for the only case where it's suitable.

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from ee1303c to 17f13d7 Compare August 24, 2018 15:13
@epuertat epuertat self-assigned this Aug 27, 2018
@LenzGr

LenzGr commented Aug 27, 2018

Copy link
Copy Markdown
Contributor

@epuertat kindly agreed to address the few remaining issues that should be resolved before this pull request will be merged. The key issue is to add the missing tests for the backend functionality in order to maintain test coverage, plus some style issues. The remaining issues have been added to the tracker. Once the tests have been added, this PR should be put through the QA pipeline as well.

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll start working on the unit tests for python code (src/pybind/mgr/dashboard/services/ceph_service.py:get_client_perf()). I've asked @a2batic for some help on the front-end side (src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts).

Regarding the other comments, I think some of them are fully debatable (like the blank lines one), but others are IMO not aligned to settled practices (using TS code in templates vs. pipes for formatting, or the constant vs. literal debate).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doing it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Devp00l, I think literal references should be avoided as much as possible, as mistakes will be found at a later stage (worst case at runtime).

The following error (missing E in RECOVERY) will make unit tests/pylint fail:

   return client_perf[cls.POOL_STAT_RECOVRY_BYTES_PER_SEC]

However this other mistake will go unnoticed until some QA/E2E test is run:

   return client_perf['recovring_bytes_per_sec']

Unfortunately this can't be done in the front-end side without using some kind of model/schema validation, which is not currently happening.

More info on this topic

@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch 2 times, most recently from 8e66ea6 to 9eff9ad Compare September 17, 2018 15:55
@epuertat epuertat assigned alfonsomthd and unassigned epuertat Sep 18, 2018
@alfonsomthd
alfonsomthd force-pushed the wip-24573-landing-page branch from 17ac62c to f9fbc25 Compare September 19, 2018 06:55

@Devp00l Devp00l left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@tspmelo tspmelo changed the title [WIP] mgr/dashboard: New Landing Page mgr/dashboard: New Landing Page Sep 20, 2018

@ricardoasmarques ricardoasmarques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR lgtm.

There are a lot of landing page improvements registered on tracker, but these improvements should be submitted in separate PRs (see related issues - https://tracker.ceph.com/issues/24573).

Per our discussion today, this landing page is now an improvement over the existing one, so there's no point in postponing the merge.

Thanks @alfonsomthd

@callithea

Copy link
Copy Markdown
Contributor

QA run was successful: http://pulpito.ceph.com/laura-2018-09-24_09:58:21-rados:mgr-wip-lpaduano-testing-23568-4-distro-basic-smithi/

@LenzGr
LenzGr merged commit 4d3f896 into ceph:master Sep 24, 2018
@alfonsomthd
alfonsomthd deleted the wip-24573-landing-page branch November 6, 2018 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants