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

Accessing graphs directly with apikey #27

Open
pb66 opened this issue Sep 14, 2018 · 5 comments
Open

Accessing graphs directly with apikey #27

pb66 opened this issue Sep 14, 2018 · 5 comments

Comments

@pb66
Copy link
Contributor

pb66 commented Sep 14, 2018

It would be very useful to be able to access any saved graph via a url and apikey eg

http://server.com/emoncms/graph/somegraph?apikey=abc123

This would make frequently visited graphs bookmarkable and save logging in.

I'm aware that graphs can be embedded in dashboards, but 1) the dashboards do not populate when a dash is viewed by apikey (see #8) and 2) only the graph is displayed, not the stats and/or the ability to download csv etc.

@pb66 pb66 changed the title Accessing graphs with apikey Accessing graphs directly with apikey Sep 14, 2018
@pb66
Copy link
Contributor Author

pb66 commented Sep 15, 2018

Also with having a graph specific url, it adds the ability to refresh the page to reset to original settings after exploring, adding and removing feeds and changing setttings, you can just refresh the page without going back to a blank empty graph.

A couple minor thoughts, If using an apikey top directly access a preset graph, the feed selection panel is less of a primary function so the page should open with the LH panel collapsed by default.

Perhaps the graph name selector and definitely the save button should not be made available when the graph page is accessed with the readonly key.

@TrystanLea
Copy link
Member

Good idea, the first part of this is now implemented
http://localhost/emoncms/graph?load=test&apikey=APIKEY

commit:
5496525

It would be good to automatically change the url when a saved graph is selected so that general users can use find this shortcut.

The left hand menu still needs hiding.

@pb66
Copy link
Contributor Author

pb66 commented Jan 11, 2019

Very much appreciated. Thank you.

It would be good to automatically change the url when a saved graph is selected so that general users can use find this shortcut.

As a stop gap you could include the url of saved graphs at the foot of the lefthand panel like the multigraph embeded url textbox's and also make it a clickable link (or nav to button?) as well as a copy button? Both of these features would be desirable even if the page refreshes to the saved graphs url so the work would not be wasted (eg a temp fix).

I think this commit may also fix #8, I will test and update that issue if so.

Please see #41 as I think a link to the saved graphs page from an embedded graph would offer stats and indepth research of data direct from the dashboards, perhaps opening in a modal view without the lefthand menu (no menu in modal view only)

@pb66
Copy link
Contributor Author

pb66 commented Feb 8, 2019

This doesn't appear to work, I don't recall how thoroughly I tried it a month ago, but I do not seem to be able to get it working with

http://localhost/emoncms/graph?load=test&apikey=APIKEY

or

http://server.com/emoncms/graph/somegraph?apikey=abc123

am I doing something wrong or has it broken since?

(See https://community.openenergymonitor.org/t/emoncms-app-dev-suggestion/9848/13?u=pb66)

@TrystanLea
Copy link
Member

The following all work for me

http://192.168.0.102/graph?apikey=APIKEY#/Saved/1
http://192.168.0.102/graph/16?apikey=APIKEY
http://192.168.0.102/graph?feedidsLH=16&apikey=APIKEY
http://192.168.0.102/graph?feedidsRH=16&apikey=APIKEY

It looks like graph?load=test is not working (perhaps replaced by more recent version of #saved/1 @emrysr ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants