nickethier / grokdebug

grokdebug.herokuapp.com
Other
123 stars 56 forks source link

New feature: Custom patterns in the debugger #3

Closed danielpetisme closed 10 years ago

danielpetisme commented 11 years ago

Specs As a user, when I debug an input, I should be able to use my own patterns As a user, when I use the autocompletion, the debugger should propose me my own patterns.

Demo http://grokdebug-danielpetisme.herokuapp.com/

Check the "Add custom patterns" checkbox to toggle the textarea. The edition format is classic, one pattern per line. Then you will be able to use the custom pattern in the pattern field. If you trigger the autocompletion, the suggestions will include the custom patterns.

Code The custom patterns are transmitted to the backend. The backend do basic validations (empty). Then, it will parse and extract the the custom patterns before adding them to the grok instance patterns.

Regarding the autocompletion, when it's trying to load the "available tags" (ie. the defaults ones), the JS will read the custom patterns textarea, parse them and add them in the "availableTags" collection. A verification is made to only have unique values in the final list.

danielpetisme commented 11 years ago

I have also did:

I'm not sure my PRs are very clean (not yet totally familiar w/ git :disappointed:

Tell me if you prefer 3 seperated PRs or a big one?

The final app http://grokdebug-danielpetisme.herokuapp.com/

nickethier commented 10 years ago

This is awesome thankyou! Sorry for taking for ever to get to this. I will attempt to get this pushed out soon.

3 separate PRs are great, though I'm not picky.

danielpetisme commented 10 years ago

It has been a pleasure!

tomyam1 commented 3 years ago

@danielpetisme Any chance you can give an example of how to use custom patterns?

Tried all syntaxes I could think of and keep getting a compile error.

danielpetisme commented 3 years ago

Hi.

It's something I made 7 years ago... To be honest I don't even remember what it was about...

Have a look to the mentioned PR, is the best O can do.

Hope you'll find what you need