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

Hide unimportant details from service details and show some important ones instead #15701

Conversation

KKoukiou
Copy link
Contributor

@KKoukiou KKoukiou commented Apr 15, 2021

So I was thinking how I can solve #14321
Went to service details and I realized that so much information there are not useful for most scenarios, or at least they were never useful for me till now.
So I though I should hide them by default, and display indead some more useful information, like the port a socket activated service is exposed at, for example.

Having the above mentioned property exposed we can move forward in the future with linking the service details of service sockets to the firewall page.

What do you think? @marusak ?

Services: Show memory usage and socket listeners

Socket units show the paths or ports on which they listen, and which service unit they activate:

image

Service units show their current memory usage and which socket unit activated them (if any). The static relationships like "Requires:" are now collapsed by default, to take less space and make it easier to see the journal output below.

image

@KKoukiou KKoukiou added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Apr 15, 2021
@KKoukiou KKoukiou changed the title WIP: Hide unimportant details from service details WIP: Hide unimportant details from service details and show some important ones instead Apr 15, 2021
@garrett
Copy link
Member

garrett commented Apr 15, 2021

Ooooo, I ❤️ this! You've got my approval for this PR when it's time for it.

Great work!

@marusak
Copy link
Member

marusak commented Apr 16, 2021

I like it a lot! Especially since this is the whole screen on my laptop screen:
screenbefore
And this is with this PR:
afterrel

The space is used just soo much better. Also having Listen is very useful.

It shows some random 0 though, can you please take a look at that?
justzero

Unrelated but noticed that there is not bottom padding, I cannot scroll any further than:
anyfrther
It is something we should take a look at.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

So cool, thanks @KKoukiou !

pkg/systemd/services/services.jsx Outdated Show resolved Hide resolved
@KKoukiou KKoukiou changed the title WIP: Hide unimportant details from service details and show some important ones instead Hide unimportant details from service details and show some important ones instead Apr 16, 2021
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch 2 times, most recently from 6ca9065 to daee0f0 Compare April 16, 2021 14:33
@KKoukiou KKoukiou removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Apr 16, 2021
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch from daee0f0 to a1ee5e1 Compare April 16, 2021 14:57
@KKoukiou KKoukiou marked this pull request as ready for review April 17, 2021 10:05
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

This works and looks really well 👏 Many thanks for this!

pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
test/verify/check-system-services Outdated Show resolved Hide resolved
test/verify/check-system-services Outdated Show resolved Hide resolved
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch 4 times, most recently from 313d0e6 to 9c15042 Compare April 20, 2021 07:19
@martinpitt
Copy link
Member

/livetest

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! There are still quite a number of issues from the previous review round, I marked the others as resolved. Many of the middle ones are unhelpfully hidden by github, you have to expand them 😿

pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch 2 times, most recently from 61ab94b to 7a300a1 Compare April 21, 2021 14:21
@KKoukiou
Copy link
Contributor Author

Still some test failures, marking as draft till these are resolved.

@KKoukiou KKoukiou marked this pull request as draft April 22, 2021 06:33
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch 3 times, most recently from ea1ed4b to b654695 Compare April 22, 2021 16:04
@KKoukiou KKoukiou marked this pull request as ready for review April 23, 2021 06:33
@martinpitt
Copy link
Member

test-static-code fails:

test/verify/check-system-services:22: 'time' imported but unused
test/verify/check-system-services:810: redefinition of unused 'time' from line 22

@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch from b654695 to bdb08a5 Compare April 23, 2021 07:51
@KKoukiou
Copy link
Contributor Author

test-static-code fails:

test/verify/check-system-services:22: 'time' imported but unused
test/verify/check-system-services:810: redefinition of unused 'time' from line 22

Ups sorry, reposted.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

This works really nicely now 👍 Also thanks for the nice dynamic memory test case!

A few remaining easy nitpicks.

pkg/systemd/services/services.jsx Outdated Show resolved Hide resolved
pkg/systemd/services/service-details.jsx Outdated Show resolved Hide resolved
test/verify/check-system-services Outdated Show resolved Hide resolved
test/verify/check-system-services Outdated Show resolved Hide resolved
test/verify/check-system-services Outdated Show resolved Hide resolved
…for sockets

MemoryCurrent does not emit an event when updated therefore just do
polling.
Most of them are not of high interest and we display them as first
information in the service details page.
Let's add them behind an expandable section and let the user decide if
they want to see them.

Show the triggeredBy/triggers by default however since there are actually
important for socket and timer activated services.

systemctl status has the same approach.
We do have a lot of space in desktop mode which is unused, in smaller
screens they collapse to vertical anyway.
Previously there was just too much information there, so we tried to
categorize it. Now it's hidden by default so let's just divide the
items.
Previously in console there was:
Switch: Switch requires either a label or an aria-label to be specified
This custom CSS was removing the page's bottom padding, resulting in
inability to scroll to the end.
In service details we used to block component refresh when we performed
a unit lifecycle operation. This is still needed, but it can be done in a
cleaner way with getDerivedStateFromProps.
@KKoukiou KKoukiou force-pushed the service-details-note-important-details branch from bdb08a5 to ceca3b9 Compare April 23, 2021 08:43
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! 👍 assuming the tests agree.

"MemoryCurrent",
result[0] && result[0].v > 0 ? result[0].v : null,
);
}, ex => console.log(ex.message));
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, the previous "Failed to.." string was fine, I meant to add ex.toString() as a second argument. But good enough.

@martinpitt
Copy link
Member

@marusak: rhel-9-0 failed in an interesting way:

+ rpm -U --force build-results/cockpit-debuginfo-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-system-242.63.g64ad0d211-1.wip.el9.noarch.rpm build-results/cockpit-debugsource-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-ws-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-tests-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-bridge-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-packagekit-242.63.g64ad0d211-1.wip.el9.noarch.rpm build-results/cockpit-storaged-242.63.g64ad0d211-1.wip.el9.noarch.rpm build-results/cockpit-pcp-242.63.g64ad0d211-1.wip.el9.x86_64.rpm build-results/cockpit-242.63.g64ad0d211-1.wip.el9.x86_64.rpm
error: Failed dependencies:
	(selinux-policy >= 34.1.2 if selinux-policy-targeted) is needed by cockpit-ws-242.63.g64ad0d211-1.wip.el9.x86_64

This is some weird collision with your PR? that just landed

@martinpitt
Copy link
Member

Or perhaps some interaction between #15707 and the image refresh in cockpit-project/bots#1955 ? They landed in parallel

@martinpitt martinpitt merged commit 62254b0 into cockpit-project:master Apr 26, 2021
@KKoukiou KKoukiou deleted the service-details-note-important-details branch April 26, 2021 05:39
@martinpitt
Copy link
Member

@garrett: I made new screenshots (the original one was way too wide) and added a release note. Can you please have a look?

@garrett
Copy link
Member

garrett commented Apr 28, 2021

@martinpitt Cool!

I do remember a screenshot showing a port; these don't though?

Also, since there's just white at the top, we might want to frame these in a dark grey outline.

@garrett
Copy link
Member

garrett commented Apr 28, 2021

Here's a cropped screenshot from the above thread that shows a port:

114979796-c81e3e00-9e8b-11eb-9b3f-681fcb9035cb-3

@martinpitt
Copy link
Member

@garrett Right, I picked an Unix socket instead of a TCP one, but a TCP socket is fine as well. I just didn't want to use Cockpit's own service, as that felt a little too self-referential. But fine for me, of course :) Do you want to do the corresponding service one as well, or want me to re-do mine?

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.

None yet

4 participants