VolkovLabs / volkovlabs-dynamictext-panel

Business Text Panel for @grafana
https://docs.volkovlabs.io
Apache License 2.0
78 stars 14 forks source link

Add handlebars (startsWith, endsWith, match) #211

Closed McHill007 closed 7 months ago

McHill007 commented 9 months ago

Add handlebar helpers

startsWith

|Name| My Value|
|---|---|
{{#each @root}}
{{#if (startsWith @key "My_")}}
| {{@key}} | {{this}}  |
{{/if}}
{{/each}}

endsWith

|Name| My Keys|
|---|---|
{{#each @root}}
{{#if (endsWith @key "_key")}}
| {{@key}} | {{this}}  |
{{/if}}
{{/each}}

match

|Key| Value|
|---|---|
{{#each @root}}
{{#if (match @key "^(Country|Street|Post)")}}
| {{@key}} | {{this}}  |
{{/if}}
{{/each}}
mikhail-vl commented 9 months ago

@McHill007 We appreciate the contribution. I just have not had a chance to look at it yet.

It looks good overall, I will review later this week.