From: Parker Berberian Date: Fri, 29 Mar 2019 14:35:59 +0000 (+0000) Subject: Merge "Fix iframe height bug" X-Git-Tag: 2.0.99~125 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=bce42a579545048055671e5726cf20fb6feea44b;hp=4755dbc4fa1820bdaed4e6aef746c7478f95dc17;p=laas.git Merge "Fix iframe height bug" --- diff --git a/src/dashboard/views.py b/src/dashboard/views.py index c4a6685..aaad7ab 100644 --- a/src/dashboard/views.py +++ b/src/dashboard/views.py @@ -46,7 +46,7 @@ def lab_detail_view(request, lab_name): 'title': "Lab Overview", 'lab': lab, 'hostprofiles': lab.hostprofiles.all(), - 'images': images + 'images': images, } ) diff --git a/src/resource_inventory/urls.py b/src/resource_inventory/urls.py index 4e159ba..a72871b 100644 --- a/src/resource_inventory/urls.py +++ b/src/resource_inventory/urls.py @@ -25,10 +25,11 @@ Including another URLconf 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url -from resource_inventory.views import HostView +from resource_inventory.views import HostView, hostprofile_detail_view app_name = "resource" urlpatterns = [ - url(r'^hosts$', HostView.as_view(), name='hosts') + url(r'^hosts$', HostView.as_view(), name='hosts'), + url(r'^profiles/(?P.+)/$', hostprofile_detail_view, name='host_detail'), ] diff --git a/src/resource_inventory/views.py b/src/resource_inventory/views.py index 2937bd7..8c3d899 100644 --- a/src/resource_inventory/views.py +++ b/src/resource_inventory/views.py @@ -9,8 +9,10 @@ from django.views.generic import TemplateView +from django.shortcuts import get_object_or_404 +from django.shortcuts import render -from resource_inventory.models import Host +from resource_inventory.models import HostProfile, Host class HostView(TemplateView): @@ -21,3 +23,16 @@ class HostView(TemplateView): hosts = Host.objects.filter(working=True) context.update({'hosts': hosts, 'title': "Hardware Resources"}) return context + + +def hostprofile_detail_view(request, hostprofile_id): + hostprofile = get_object_or_404(HostProfile, id=hostprofile_id) + + return render( + request, + "resource/hostprofile_detail.html", + { + 'title': "Host Type: " + str(hostprofile.name), + 'hostprofile': hostprofile + } + ) diff --git a/src/templates/dashboard/lab_detail.html b/src/templates/dashboard/lab_detail.html index a30ac9e..7d018ca 100644 --- a/src/templates/dashboard/lab_detail.html +++ b/src/templates/dashboard/lab_detail.html @@ -62,6 +62,8 @@ {{profile.name}} {{profile.description}} + {{profile.labs}} + Profile {% endfor %} diff --git a/src/templates/resource/hostprofile_detail.html b/src/templates/resource/hostprofile_detail.html new file mode 100644 index 0000000..0776b9e --- /dev/null +++ b/src/templates/resource/hostprofile_detail.html @@ -0,0 +1,116 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block content %} +
+
+
+
+

Available at

+ Expand +
+
+ + + + +
+
    + {% for lab in hostprofile.labs.all %} +
  • {{lab.name}}
  • + {% endfor %} +
+
+
+
+
+
+

RAM

+ Expand +
+
+ + + + +
{{hostprofile.ramprofile.first.amount}}G, + {{hostprofile.ramprofile.first.channels}} channels
+
+
+
+
+

CPU

+ Expand +
+
+ + + + + + + + + + + + + +
Arch:{{hostprofile.cpuprofile.first.architecture}}
Cores:{{hostprofile.cpuprofile.first.cores}}
Sockets:{{hostprofile.cpuprofile.first.cpus}}
+
+
+
+
+
+
+

Interfaces

+ Expand +
+
+ + {% for intprof in hostprofile.interfaceprofile.all %} + + + + {% endfor %} +
+ + + + + + + + + +
Name:{{intprof.name}}
Speed:{{intprof.speed}}
+
+
+
+
+
+
+
+

Disk

+ Expand +
+
+ + + + + + + + + + + + + +
Size:{{hostprofile.storageprofile.first.size}} GiB
Type:{{hostprofile.storageprofile.first.media_type}}
Mount Point:{{hostprofile.storageprofile.first.name}}
+
+
+
+
+{% endblock content %} diff --git a/src/templates/resource/hosts.html b/src/templates/resource/hosts.html index 4bf64e0..69b7231 100644 --- a/src/templates/resource/hosts.html +++ b/src/templates/resource/hosts.html @@ -17,7 +17,7 @@ {{ host.name }} - {{ host.profile }} + {{ host.profile }} {{ host.booked }}