Sensetif / sensetif-app-plugin

The Grafana Application Plugin for the Sensetif platform.
Apache License 2.0
0 stars 0 forks source link

Use Title when presenting #55

Closed niclash closed 11 months ago

niclash commented 1 year ago

In Datapoint, the Project and Subsystem names are used. Change to use "Title"

image

grzegorekb commented 1 year ago

Currently it works in a way that project name and subsystem name are passed in url, eg: /a/sensetif-app?tab=edit_datapoint&project=l2w-test-app&subsystem=room3&datapoint=battery

We have an endpoint get_datapoint which takes project_name and subsystem_name.

In order to render title of project and subsystem I would need to either:

  1. Extend get_datapoint endpoint so it also returns that data (project/subsystem title)
  2. Make 2 additional API calls to fetch project & subtitle

That is scenario when you go to datapoint view with direct URL.

You can also reach that view with steps:

  1. on projects vew: select specific project (meaning we've already fetched project details)
  2. on project view: select specific subsystem (we already have subsystem details & selected project) Now we are on datapoint view with all the required data. However I need to switch URL params somehow.

Are both scenarios required? If so, do you have a preferable way of implementing #1 scenario?

@niclash

niclash commented 1 year ago

Isn't project and subsystem info already cached on the client (most of the time, one navigates through the Project and Subsystem to get to this page)? If not, perhaps introduce that. And I wish cache expires in 15 minutes or so.

If caching is too hard to do, then simply make additional calls, since we don't have 1000 concurrent users.

niclash commented 11 months ago

Closing this for now. I am entering a TODO in the source code for changes when Caching is done (maybe never).