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: add open exposed url to pod details #3762

Merged
merged 1 commit into from Nov 17, 2023
Merged

feat: add open exposed url to pod details #3762

merged 1 commit into from Nov 17, 2023

Conversation

vzhukovs
Copy link
Contributor

@vzhukovs vzhukovs commented Sep 5, 2023

What does this PR do?

Adds a button to pod details to open the exposed url.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

#2978

How to test this PR?

There is an open url button near refresh button in top right corner of pod details.

@vzhukovs vzhukovs self-assigned this Sep 5, 2023
@vzhukovs vzhukovs requested review from benoitf and a team as code owners September 5, 2023 10:30
@vzhukovs vzhukovs requested review from jeffmaury and lstocchi and removed request for a team September 5, 2023 10:30
@vzhukovs vzhukovs linked an issue Sep 5, 2023 that may be closed by this pull request
Comment on lines 148 to 157
title="Open Browser"
onClick="{() => window.openExternal(url)}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

from my understanding user will see "Open Browser" several times if I have like 4 URLs
but how to differentiate each link if I only see "Open Browser"

also does it mean we will have like 5 icons if I have 5 links ?

@@ -51,6 +52,7 @@ const removePodMock = vi.fn();

beforeAll(() => {
(window as any).listPods = listPodsMock;
(window as any).listContainers = listContainersMock.mockResolvedValue([]);
(window as any).kubernetesListPods = kubernetesListPodsMock;
(window as any).removePod = removePodMock;
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

we're missing the test of checking if we have links to open URLs and verify that if we click on the button we're redirected to the expected link

@jeffmaury
Copy link
Contributor

Tried on a container without port (node) and can see the Open browser link on the infra node

Copy link
Contributor

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

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

See previous comment

@vzhukovs
Copy link
Contributor Author

@benoitf @jeffmaury can you check it, please. I've provided some updates to the current PR:

Terminated Pod:

Active Pod:

Opening Dialogs:

Single Port:

@deboer-tim
Copy link
Collaborator

The images look good, but could we make the button disabled when the pod is stopped instead of hidden? Otherwise there is some visual movement and the start/stop button changes location.

@benoitf
Copy link
Collaborator

benoitf commented Oct 18, 2023

maybe a UX question, do we need to display a dropdown/single action when we have only one item rather than just clicking on the button ?

@deboer-tim
Copy link
Collaborator

maybe a UX question, do we need to display a dropdown/single action when we have only one item rather than just clicking on the button ?

+1, I would prefer if there's only one there's no drop-down and we just open it. (or maybe longer term there is a separate drop down to select which port and the button always opens?)

@vzhukovs
Copy link
Contributor Author

The images look good, but could we make the button disabled when the pod is stopped instead of hidden? Otherwise there is some visual movement and the start/stop button changes location.

maybe a UX question, do we need to display a dropdown/single action when we have only one item rather than just clicking on the button ?

There isn't a problem to make it disable and actionable when we have only one exposed ports. Going to update the PR.

@vzhukovs
Copy link
Contributor Author

@deboer-tim @benoitf I've updated the PR, now the situation with buttons following:

If pod doesn't have exposed port, button will be visible but disabled, the same state either on running or stopped pod:

If pod has only one exposed port, button will handle openning port if pod started, otherwise button visible, but disabled.

If pod has several exposed ports, then on stopped state button will display dropdown with disabled buttons, the opposite situation when pod is started, in this case buttons vill be enabled and handle opening particular port.

@benoitf
Copy link
Collaborator

benoitf commented Nov 14, 2023

I tried and it's displaying several times the ports
image

I created a container using

podman run -p 8080:80 -p 8085:80 -p 8086:70 nginx

then convert this container to a pod

and then opening the details of the pod

Copy link
Collaborator

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

on my side it's not working, I saw several duplicated items

@vzhukovs
Copy link
Contributor Author

on my side it's not working, I saw several duplicated items

going to check it

Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
@vzhukovs vzhukovs enabled auto-merge (rebase) November 17, 2023 12:06
@vzhukovs vzhukovs merged commit 853eea0 into main Nov 17, 2023
9 checks passed
@vzhukovs vzhukovs deleted the pd#2978 branch November 17, 2023 12:37
@podman-desktop-bot podman-desktop-bot added this to the 1.6.0 milestone Nov 17, 2023
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.

Ability to open application in the browser for Pod Open Browser actions should handle multiple ports
5 participants