Skip to content

Commit

Permalink
Merge pull request #36 from ubuntu-robotics/fix/links
Browse files Browse the repository at this point in the history
fix(device view): adapt grafana dashboards urls
  • Loading branch information
Guillaumebeuzeboc authored Apr 16, 2024
2 parents 1b9b95e + 8ab6217 commit 72632c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cos_registration_server/devices/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,19 @@ def __init__(

cos_model_name = settings.COS_MODEL_NAME

grafana_param = {"query": uid}
grafana_main_link = (
f"{base_url}/{cos_model_name}-grafana/"
f"dashboards/?{urlencode(grafana_param)}/"
f"dashboards/"
)
grafana_dashboards = {}
grafana_param = {"instance": uid}
grafana_param = {"var-Host": uid}
for grafana_dashboard in device.grafana_dashboards.all():
grafana_dashboards[grafana_dashboard.uid] = (
base_url
+ f"/{cos_model_name}-grafana/dashboards/"
+ f"/{cos_model_name}-grafana/d/"
+ grafana_dashboard.uid
+ "/"
f"?{urlencode(grafana_param)}/"
f"?{urlencode(grafana_param)}"
)

foxglove_params = {
Expand All @@ -89,7 +88,7 @@ def __init__(
foxglove_layouts = {}
for foxglove_dashboard in device.foxglove_dashboards.all():
foxglove_params["layoutUrl"] = (
f"{base_url}/{cos_model_name}-cos-registration-server/api/v1/"
f"http://{base_url}/{cos_model_name}-cos-registration-server/api/v1/"
f"applications/foxglove/dashboards/{foxglove_dashboard.uid}"
)
foxglove_layouts[foxglove_dashboard.uid] = (
Expand Down

0 comments on commit 72632c6

Please sign in to comment.