Skip to content

add ability to group monitors & proxies - #24

Open
mrohmer wants to merge 4 commits into
jeansaad:masterfrom
mrohmer:feat/group-monitors
Open

add ability to group monitors & proxies#24
mrohmer wants to merge 4 commits into
jeansaad:masterfrom
mrohmer:feat/group-monitors

Conversation

@mrohmer

@mrohmer mrohmer commented Nov 7, 2021

Copy link
Copy Markdown

Hey there 🙂

Amazing work your doing here maintaining this awesome tool 🙂

I currently have the pain that ui gets pretty messy when dealing with a hugh amount of servers.

This PR adds the ability to group monitors & proxies within expansion panels by folder structure inside the servers directory.

Given folder structure:

|-- servers
    |-- top-level-project.json
    |-- @rohmer
    |   |-- design-system.json
    |-- fancy-app
        |-- backend.json
        |-- ui.json
        |-- tests
            |-- cypress.json
            |-- jest.json

Would result in a ui structure like so:

Screenshot 2021-11-07 at 16 07 46

@jeansaad

jeansaad commented Nov 7, 2021

Copy link
Copy Markdown
Owner

Thank you for the PR! Will have a look!

@jeansaad jeansaad left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I quickly ran the code and noticed that the server url has forward slashes in it when grouped in a folder. I think that grouping should be separate from server name. Wondering if it makes more sense to introduce a namespace property inside the server JSON and use that to do the grouping rather than inferred based on the folder structure. What I would also suggest that u can use slashes to denote folder structure and to potentially ignore any trailing slashes.

Here is an example configuration:

➜  servers cat hello.json
{
  "namespace": "@work/hello",
  "cwd": "/home/user/dev/work/hello/fe",
  "cmd": "python -m http.server",
  "env": {
    "PATH": "...",
    "PORT": 8080
  }
}
➜  servers cat api.hello.json
{
  "namespace": "@work/hello",
  "cwd": "/home/user/dev/work/hello/api",
  "cmd": "npm start",
  "env": {
    "PATH": "...",
    "PORT": 8081
  }
}

In this example you can configure the name separately from the grouping, hence hello.test and api.hello.test will continue to be separate than the namespace grouping.

Let me know your thoughts! I think it adds a bit more work to your PR but makes it flexible.

@mrohmer

mrohmer commented Nov 9, 2021

Copy link
Copy Markdown
Author

Thx for the really fast reply 🙂

Yes, had that problem with slashes in the urls and solved it a bit hacky by encoding the server name.

That concept looks pretty nice though. Never thought about such a config entry.
Will give it a try this evening.

@jeansaad

Copy link
Copy Markdown
Owner

@mrohmer, Please let me know if you've had the time to look into 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.

2 participants