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

How to set the pods_table label to "Pods [selected namespace]" ? #40

Closed
593769290 opened this issue Apr 19, 2019 · 4 comments
Closed

How to set the pods_table label to "Pods [selected namespace]" ? #40

593769290 opened this issue Apr 19, 2019 · 4 comments

Comments

@593769290
Copy link
Contributor

1, When I select one pod from the poslist table, the logs windows show the real log content and change the title from "Logs" to "Logs [docker-name]".

2, But in the whole web page, I don't kown which namespace I have selected.
3, So I want to say, when I select some namespace from the namespace selecting windows.
the podlist table display all pods under the namespace, in the mean time,
I want the podlist table title change from "Pods" to "Pods [selected namespace]".

4, I have studied some code from the project , and found some code like this:

resources.setLabel(Resources {grey-fg}[${container_selected}]{/grey-fg} {red-fg}TERMINATING{/red-fg});
pod_log.setLabel(Logs {grey-fg}[${container_selected}]{/grey-fg} {red-fg}TERMINATING{/red-fg});

5, So where should I place some code like
pods_table.setLabel(Pods {grey-fg}[${current_namespace}]{/grey-fg});

5, So where should I place some code like
pods_table.setLabel(Pods {grey-fg}[${current_namespace}]{/grey-fg});

@593769290
Copy link
Contributor Author

593769290 commented Apr 25, 2019

OK
I found it now.

in the file: kubebox/lib/ui/dashboard.js

// FIXME: should be cancellable
const promise = until(client.pods(current_namespace).get())
  .spin(s => pods_table.setLabel(`${s} Pods {grey-fg}[${current_namespace}]{/grey-fg}`))
  .succeed(_ => pods_table.setLabel(`Pods {grey-fg}[${current_namespace}]{/grey-fg}`)) 

@593769290 593769290 changed the title How to set the pods_table label with Pattern Pods [selected namespace] ? How to set the pods_table label to "Pods [selected namespace]" ? Apr 25, 2019
@593769290
Copy link
Contributor Author

I suggest this feature should be a small enhancement.

@593769290 593769290 reopened this Apr 25, 2019
@astefanutti
Copy link
Owner

Thanks for the report. I agree it lacks context of which namespace is selected. I thought that it could be set as the tab tittle, but I like your idea. Would you be able to submit a PR for it?

593769290 added a commit to 593769290/kubebox that referenced this issue Apr 25, 2019
set the pods_table label to "Pods [selected namespace]" 
astefanutti#40
astefanutti pushed a commit that referenced this issue Apr 25, 2019
set the pods_table label to "Pods [selected namespace]" 
#40
@astefanutti
Copy link
Owner

Fixed with 062d228.

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

No branches or pull requests

2 participants