-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support to links on fields #23
base: main
Are you sure you want to change the base?
Conversation
@perotta Thanks for your contribution and sorry for being very late in sending my feedback. |
@perotta Just curious if you can share your code (python?) as I'm also attempting to leverage the context menu to provide links for additional data about the node. |
Hi @zosocanuck. The image above (#23 (comment)) is literally the code (PHP) that matters to declare links. Showing the rest of my code would be pointless as it just encodes the array to json using json_encode() function and writes the json to buffer on the HTTP response (nothing different from the other stuff this library does) On the other end, this does require you to manually modify nodegraph-api-plugin to add these 4 lines Unless @hoptical accepts this PR and publishes a new version on the official signed plugin, this is the only way to get the Links working. |
Hi @perotta I ended up forking a plugin with your PR however it had no impact. Here is my sample json:
I'm using grafana v9.4.1, and not sure if that makes a difference. |
This looks like should be working to me. My final json looks essentially the same as yours and it works just find. The problem must be elsewhere? No idea if it's your case, but for me it was a little tricky to get grafana to use my unsigned plugin instead of the official one |
Hey @hoptical , can we expect this feature to get merged soon? I would really need this too! |
1 similar comment
Hey @hoptical , can we expect this feature to get merged soon? I would really need this too! |
This solves issue #20 and is a very simple (3 line solution).
the way to use it is by specifying a links array in the fields JSON
{ "edges_fields": [ { "field_name": "id", "type": "string" }, { "field_name": "source", "type": "string" }, { "field_name": "target", "type": "string" }, { "field_name": "mainStat", "type": "number" } ], "nodes_fields": [ { "field_name": "id", "type": "string", "links": [ { "title": "Section One/First Link", "url": "https://google.com/${__data.fields.title}" }, { "title": "Section One/Second Link", "url": "https://google.com" }, { "title": "Section One/Second Link", "url": "https://google.com" }, }, { "field_name": "title", "type": "string" }, { "field_name": "mainStat", "type": "string" }, { "field_name": "secondaryStat", "type": "number" }, { "color": "red", "field_name": "arc__failed", "type": "number" }, { "color": "green", "field_name": "arc__passed", "type": "number" }, { "displayName": "Role", "field_name": "detail__role", "type": "string" } ] }
This way it also supports all the internal links and stuff that Node Graph have on their example: