B4J Question WebApp and Grafana

DarkoT

Active Member
Licensed User
Hi Guys,

I need a tip, how to generate web page inside of B4J ABMaterial, which will show dashboards created with Grafana. On Grafana site is possible to create API key for Viewer role... Means – I need a tip:
  • How to connect Grafana dashboard web app over API key and
  • How to show result inside of my web app
Maybe exist one similar example, but I can not find it… And sory for (maybe) not real description of my problem - I’m still learning how to programming web app and little tip or example who to use API key, will be more as useful...


Thank you...
Darko
 

MichalK73

Well-Known Member
Licensed User
Longtime User
There is full documentation on the Grafana site for API key support. Sample JSON query structures that return a panel result.
I think:
1. Create a CustomComponent ABMaterial so that you can inject the html code into it.
1. Use HttpJob to create an authorization request for Grafana.
2. Retrieve the return key and use it to create the Rest API download Grafana dashboard query.
3. Read the result as html which you can insert into CustomComponent ABMaterial, which you can now put on your website.

It's as fast as I reviewed the Graphene documentation.
 
Upvote 0

DarkoT

Active Member
Licensed User
There is full documentation on the Grafana site for API key support. Sample JSON query structures that return a panel result.
I think:
1. Create a CustomComponent ABMaterial so that you can inject the html code into it.
1. Use HttpJob to create an authorization request for Grafana.
2. Retrieve the return key and use it to create the Rest API download Grafana dashboard query.
3. Read the result as html which you can insert into CustomComponent ABMaterial, which you can now put on your website.

It's as fast as I reviewed the Graphene documentation.
Thank you, sounds very logical... But - If you can give me some example how to build/create customcombonent for html code - It's will be very usefull...

Tnx, DaT
 
Upvote 0
Top