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

add image to conatiner view. #145

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

anjiawei1991
Copy link

Fix: #144

@codecov-io
Copy link

Codecov Report

Merging #145 into master will decrease coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
- Coverage   26.12%   26.06%   -0.07%     
==========================================
  Files          13       13              
  Lines        1129     1132       +3     
==========================================
  Hits          295      295              
- Misses        821      824       +3     
  Partials       13       13
Impacted Files Coverage Δ
pkg/commands/container.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8970352...119c2e7. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Aug 3, 2019

Codecov Report

Merging #145 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #145      +/-   ##
=========================================
- Coverage   26.12%   26.1%   -0.03%     
=========================================
  Files          13      13              
  Lines        1129    1130       +1     
=========================================
  Hits          295     295              
- Misses        821     822       +1     
  Partials       13      13
Impacted Files Coverage Δ
pkg/commands/container.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8970352...9f50809. Read the comment docs.

@@ -248,7 +248,11 @@ type ContainerCliStat struct {

// GetDisplayStrings returns the dispaly string of Container
func (c *Container) GetDisplayStrings(isFocused bool) []string {
return []string{c.GetDisplayStatus(), c.Name, c.GetDisplayCPUPerc()}
image := c.Container.Image
Copy link
Owner

Choose a reason for hiding this comment

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

we can just do image := strings.TrimPrefix(c.Container.Image, "sha256:") here

Copy link
Author

Choose a reason for hiding this comment

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

2019-08-06 19-01-05屏幕截图

Since the image name may remain too long, I have just reserved 14 characters here.

Copy link
Author

Choose a reason for hiding this comment

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

2019-08-06 19-08-00屏幕截图

Compare with this one which is more concise and won't take much spaces.

Copy link
Owner

Choose a reason for hiding this comment

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

I personally don't mind if the image name is long, given we don't yet have any other columns to the right, and the magenta color means it's not too jarring on the eyes. But if you want to shorten it, I would add an ellipsis (...) after the 14 characters to communicate to the user that there's more of the image name not being shown

Copy link
Author

Choose a reason for hiding this comment

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

I think long name is not very good. But I do think that add an ellipsis after the 14 characters is better than before. I'm going to do it.

Copy link
Author

Choose a reason for hiding this comment

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

If I do that, it would be inconsistent with those named containers whose name is very long and with the other colums such as container name.

It may not be that bad to remain the whole name since there's no colums to the right now.

Though, I think it could be adjusted in the future when adding toggle-able expanded side panel view.

Copy link
Author

Choose a reason for hiding this comment

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

So I'll adopt your suggestions that remain the whole name after sha256:

Copy link
Author

Choose a reason for hiding this comment

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

@jesseduffield all is done. thank you.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

looks good, I left a couple comments :)

Update issue: jesseduffield#144

Co-Authored-By: Jesse Duffield <jessedduffield@gmail.com>
@jesseduffield jesseduffield merged commit b305558 into jesseduffield:master Aug 14, 2019
@jesseduffield
Copy link
Owner

Merged! Thanks for making this :)

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.

add image name to container frame
4 participants