diff --git a/cos_registration_server/devices/views.py b/cos_registration_server/devices/views.py index 39b2dce..b293b1d 100644 --- a/cos_registration_server/devices/views.py +++ b/cos_registration_server/devices/views.py @@ -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 = { @@ -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] = (