diff --git a/ldvspec/lofardata/templates/lofardata/index.html b/ldvspec/lofardata/templates/lofardata/index.html index 6b0cc1195dc4f4c1a86d794af709522ab056601f..73d511f6d399ca829709c53d3e21b83841312255 100644 --- a/ldvspec/lofardata/templates/lofardata/index.html +++ b/ldvspec/lofardata/templates/lofardata/index.html @@ -8,7 +8,15 @@ <table class="table table-striped table-bordered table-sm"> <tbody> - <tr><td>atdb_host</td><td>{{ atdb_host }}</td></tr> + + <tr><td>atdb_host</td> + <td><ul> + {% for atdb_host in atdb_hosts %} + <li>{{ atdb_host.name }} ( <a href="{{ atdb_host.url }}">{{ atdb_host.url }}</a> )</li> + {% endfor %} + </ul> + </td> + </tr> <tr><td>api data</td><td><a href="{% url 'dataproduct' %}">{% url 'dataproduct' %}</a></td></tr> <tr><td>api data-location</td><td><a href="{% url 'datalocation' %}">{% url 'datalocation' %}</a></td></tr> diff --git a/ldvspec/lofardata/views.py b/ldvspec/lofardata/views.py index 144776cb229ae4a0703d8ec4f94eedd7d61d38c6..e3939b73fee4c795c888dd37d229f3533f9f6792 100644 --- a/ldvspec/lofardata/views.py +++ b/ldvspec/lofardata/views.py @@ -6,7 +6,7 @@ from rest_framework import generics from django_filters import rest_framework as filters from rest_framework.schemas.openapi import AutoSchema -from .models import DataProduct, DataProductFilter, DataLocation, WorkSpecification +from .models import DataProduct, DataProductFilter, DataLocation, WorkSpecification, ATDBProcessingSite from .serializers import DataProductSerializer, \ DataProductFlatSerializer, DataLocationSerializer, \ WorkSpecificationSerializer @@ -42,8 +42,8 @@ class DataProductFilterSet(DynamicFilterSet): # ---------- GUI Views ----------- def index(request): - atdb_host = settings.ATDB_HOST - return render(request, "lofardata/index.html", {'atdb_host': atdb_host}) + atdb_hosts = ATDBProcessingSite.objects.values('name', 'url') + return render(request, "lofardata/index.html", {'atdb_hosts': atdb_hosts}) # ---------- REST API views ----------