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

api: Add option to output graphs as base64 #8535

Merged
merged 5 commits into from Apr 11, 2018

Conversation

Projects
None yet
4 participants
@pheinrichs
Contributor

pheinrichs commented Apr 10, 2018

Let me know what you would like updated.

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

@@ -244,6 +245,10 @@ function get_graph_generic_by_hostname()
rrdtool_initialize(false);
include 'includes/graphs/graph.inc.php';
rrdtool_close();
if ($vars['output'] === 'base64') {
api_success(['image' => $base64_output, 'content-type' => get_image_type()], 'image');

This comment has been minimized.

@laf

laf Apr 10, 2018

Member

Do you need to add this to the other functions which return graphs?

This comment has been minimized.

@pheinrichs

pheinrichs Apr 10, 2018

Contributor

Yep, does the format and names seem ok? If so, i'll append it to the port methods as well

@laf

This comment has been minimized.

Member

laf commented Apr 10, 2018

Yeah seems fine to me :)

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented Apr 10, 2018

The inspection completed: 3 new issues, 1 updated code elements

@laf

laf approved these changes Apr 10, 2018

LGTM. Tested fine both WebUI and API.

@murrant murrant merged commit ff0063b into librenms:master Apr 11, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

TheMysteriousX added a commit to TheMysteriousX/librenms that referenced this pull request May 20, 2018

api: Add option to output graphs as base64 (librenms#8535)
* Allow 'option' param in graph endpoint

* Update lint and update docs

* Uncomment api response

* Add imagedestroy on 'tobias_trim' section

* Add base64 to port endpoints also

@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.