Repository navigation
mgr/dashboard: New Landing Page - #23568
Conversation
920586f to
afcf9d7
Compare
afcf9d7 to
a96cb7f
Compare
There was a problem hiding this comment.
I would suggest using ::ng-deep instead of /deep/, just so we use the same everywhere.
There was a problem hiding this comment.
recommended way to import this is: PopoverModule.forRoot()
There was a problem hiding this comment.
recommended way to import this is: PopoverModule.forRoot()
There was a problem hiding this comment.
Can't we use bootstrap classes for setting the column size?
There was a problem hiding this comment.
Bootstrap 3 grid does not have a built-in solution for 5 equal full-width columns.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Don't all cards have the same size? I think we can remove this @input and class.
There was a problem hiding this comment.
Not all cards have the same height: Configuration cards use the default card class,
meanwhile Perf. and Capacity Cards use "card-medium" (bigger height).
1f00d48 to
701ff65
Compare
569d4e1 to
90d59d5
Compare
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
color should be a variable.
There was a problem hiding this comment.
Right, I forgot it.
There was a problem hiding this comment.
color should be a variable.
There was a problem hiding this comment.
Right, I forgot it.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
OK, although AFAIK the number of media queries does not have any performance impact. The separation seemed to me more readable.
There was a problem hiding this comment.
font-size seems a bit small when you use a xs screen.
There was a problem hiding this comment.
Isn't there a color scheme we can use instead of defining the colors?
It seems we are reverting a really recent change...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I think we should use "col-md-12 col-lg-6" for the logs.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Can we set the logs card a bit bigger? we can only see 4 lines atm.
And unset the justified text.
There was a problem hiding this comment.
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...
19cff24 to
f0fc5f4
Compare
LenzGr
left a comment
There was a problem hiding this comment.
I've tested the new dashboard landing page in a local test environment today and it LGTM from an end-user perspective.
8f90e58 to
3622630
Compare
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
This new code could be put in a new method as well.
And could you please add tests for this?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I see your point, but I think this is a matter of coding style (very subjective).
Nevertheless, it is refactored.
There was a problem hiding this comment.
As those colors are only used once and only here, they should not be class properties.
There was a problem hiding this comment.
Could you please add debugElement tests for this file to make sure all components are rendered?
There was a problem hiding this comment.
As per our previous conversation, I've created this test coverage issue:
https://tracker.ceph.com/issues/27220
There was a problem hiding this comment.
How about using the dimless pipe instead, This would shorten the number for large clusters a lot.
There was a problem hiding this comment.
I agree. Done.
There was a problem hiding this comment.
Through the use of many long static variables this isn't as readable as you intended.
There was a problem hiding this comment.
IMHO it's a subjective matter.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Replace those static variables with the actual strings before merging this PR please.
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
i18n-cardTitle is missing to support translating. Please check the other code for this behaviour, too.
There was a problem hiding this comment.
i18n-groupTitle is missing to support translating. Check the rest of the code, too.
c54a199 to
ee1303c
Compare
There was a problem hiding this comment.
Please remove the separations if they are not needed
There was a problem hiding this comment.
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.
ee1303c to
17f13d7
Compare
|
@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
left a comment
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
@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
8e66ea6 to
9eff9ad
Compare
1st Milestone. Fixes: https://tracker.ceph.com/issues/24573 Signed-off-by: Alfonso Martínez <[email protected]>
Updated integration tests to check data from new python code Fixes: https://tracker.ceph.com/issues/24573 Signed-off-by: Alfonso Martínez <[email protected]>
17ac62c to
f9fbc25
Compare
get_client_perf method refactored for readability. Fixes: https://tracker.ceph.com/issues/24573 Signed-off-by: Alfonso Martínez <[email protected]>
ricardoasmarques
left a comment
There was a problem hiding this comment.
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





Implemented New Landing Page (new layout) that fixes:
https://tracker.ceph.com/issues/24573