takeout icon indicating copy to clipboard operation
takeout copied to clipboard

Add categories on json list

Open danielebarbaro opened this issue 3 years ago • 13 comments

Hi @mattstauffer , first implementation of #143 could be like this:

Screenshot 2020-10-01 at 17 30 16

The json is:

{
  "Cache": [
    [
      {
        "container_id": "3aac7ef4477f",
        "names": "TO--memcached--1.6.7",
        "status": "Up 7 hours",
        "ports": "0.0.0.0:11211->11211\\/tcp"
      }
    ]
  ],
  "Database": [
    [
      {
        "container_id": "4dc197902954",
        "names": "TO--mariadb--focal",
        "status": "Up 7 hours",
        "ports": "0.0.0.0:3342->3306\\/tcp"
      }
    ],
    [
      {
        "container_id": "0daed47e14a5",
        "names": "TO--postgresql--13.0",
        "status": "Up 3 days",
        "ports": "0.0.0.0:5647->5432\\/tcp"
      }
    ]
  ],
  "Mail": [
    [
      {
        "container_id": "202e824629b1",
        "names": "TO--mailhog--v1.0.1",
        "status": "Up 7 hours",
        "ports": "0.0.0.0:8025->8025\\/tcp, 0.0.0.0:2341->1025\\/tcp"
      }
    ]
  ]
}

I decided to group container by category as i've done in the principal menu #88 (PR #135) but we can discuss about it.

I think that isn't useful category column in list output.

danielebarbaro avatar Oct 01 '20 15:10 danielebarbaro

Hi @mattstauffer now PR is updated. All tests pass.

This PR needs #157 .

danielebarbaro avatar Oct 08 '20 07:10 danielebarbaro

🥺

danielebarbaro avatar Oct 23 '20 09:10 danielebarbaro

@danielebarbaro Whoops, sorry!

  1. I think I'd prefer we use the lowercase version of the categories, but I'd be up to someone telling me the uppercase is better.
  2. My natural inclination would be just to add it to each item in the list rather than grouping them this way. @mpociot as the first person who's talked about possibly consuming this data, what do you think?

mattstauffer avatar Oct 26 '20 15:10 mattstauffer

hi @mpociot , what you think about this implementation?

I think I'd prefer we use the lowercase version of the categories, but I'd be up to someone telling me the uppercase is better.

oookkeeeei 🧐 🤓

My natural inclination would be just to add it to each item in the list rather than grouping them this way. @mpociot as the first person who's talked about possibly consuming this data, what do you think?

I prefer grouping to "select" only one group a time 💪🏻

danielebarbaro avatar Nov 04 '20 13:11 danielebarbaro

@danielebarbaro OK, I'm going to say definitely throw them into the main body of each entry, and give a flat response of entries.

@josecanhelp had a great idea as well: To add the category under a meta key, so it's separated from the rest.

Thanks!

mattstauffer avatar Nov 09 '20 16:11 mattstauffer

Cool, if you need any help i can support you . I noticed your last PR merges and i saw Base Alias && Full Alias , well done @josecanhelp 🥇

danielebarbaro avatar Nov 09 '20 16:11 danielebarbaro

@danielebarbaro If you're up to code the change, I'd love it! If you don't have time, please let me know.

mattstauffer avatar Nov 09 '20 16:11 mattstauffer

@danielebarbaro If you're up to code the change, I'd love it! If you don't have time, please let me know.

i'm always on the cutting edge 🏄🏼‍♂️. i will rewrite the PR with the new changes

danielebarbaro avatar Nov 09 '20 16:11 danielebarbaro

Hi @mattstauffer , PR updated but i have some doubts to discuss.

Screenshot 2020-11-10 at 15 49 26
  • takeout list --json have different output from takeout list is it what we want?

My opinion is to have same output (add category column on list) and with #173 filter base alias, full alias and category fields Maybe category can be always present 🧐

  • Full Alias and Base Alias are lowercase, category isn't.

My opinion is to have same output :) convert category to lowercase and use ucfirst() on menu (takeout enable).

  • behind the scenes i use container name to get the right category however, i would like to use base_alias

My opinion is: container name isn't clean to parse, base alias is "more confident" to use

danielebarbaro avatar Nov 10 '20 14:11 danielebarbaro

🙋🏻‍♂️

danielebarbaro avatar Nov 13 '20 08:11 danielebarbaro

takeout list --json have different output from takeout list is it what we want? Yep!

Full Alias and Base Alias are lowercase, category isn't. I agree, let's strtolower the category

behind the scenes i use container name to get the right category however, i would like to use base_alias Makes sense!

mattstauffer avatar Dec 01 '20 22:12 mattstauffer

@danielebarbaro Thanks for all your hard work on this!

mattstauffer avatar Dec 04 '20 17:12 mattstauffer

@danielebarbaro OK, I'm finally getting back into my open source tasks. Taking a look now!

mattstauffer avatar Jan 20 '21 13:01 mattstauffer