Skip to content
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

On "Graph Utility View" add the name of and a link to the graph template which the graph is based on #4239

Closed
bernisys opened this issue Apr 19, 2021 · 1 comment
Labels
enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@bernisys
Copy link
Contributor

Feature Request

Is your feature request related to a problem? Please describe

When you need to do template reviews, it is not helpful to have to go thru manual DB queries in order to find out, which graph-template a graph is based on.

Describe the solution you'd like

On the Graph Utility View, add a line under "Summary Details" which shows the graph template, best would be a hyperlink that directly takes you to the template.

I quick-hacked it into our code to see if it works. It's just a few lines in graph_xport.php and a small addition in lib/rrd.php
Would be nice to have also a link to the template, but this would need some privileges-evaluation so that users without template-edit permissions don't see the link, but only the template ID as plain number.

in lib/rrd.php: function rrdtool_function_graph()

  • around line 1350 i added "gtg.graph_template_id" to the query
  • at the bottom where the returned xport_array is assembled, add:
    $xport_array['meta']['graph_template_id'] = $graph['graph_template_id'];

and in graph_xport.php i added the ouptut of another line with the template ID after line 195 with the scheme from above.

BTW this part could be cleaned up using a function to generate the table rows.
If i find time i can prepare the code and do a pull req.

Describe alternatives you've considered

Alternatives are a pain ...
select id, local_graph_template_graph_id, local_graph_id, graph_template_id, title_cache from graph_templates_graph where local_graph_id=[graph ID];
then go to the templates page and search for the template ID ...
you get the point ...

@bernisys bernisys added the enhancement General tag for an enhancement label Apr 19, 2021
TheWitness added a commit that referenced this issue Oct 17, 2022
On "Graph Utility View" add the name of and a link to the graph template which the graph is based on
@TheWitness TheWitness added this to the v1.2.23 milestone Oct 17, 2022
@TheWitness TheWitness added the resolved A fixed issue label Oct 17, 2022
@TheWitness
Copy link
Member

This is done now.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants