From 38619babc7225537025307a742ac2f254da0669a Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sun, 19 Jun 2022 15:23:50 +0530 Subject: [PATCH] feat: improve view VM styling and show VM configuration --- dash/templates/dash/instances/view/index.html | 39 ++++++++++++------- dash/views.py | 1 + 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/dash/templates/dash/instances/view/index.html b/dash/templates/dash/instances/view/index.html index 7c5d07c..a616e9b 100644 --- a/dash/templates/dash/instances/view/index.html +++ b/dash/templates/dash/instances/view/index.html @@ -1,17 +1,30 @@ {% extends 'dash/common/base.html' %} {% block dash %} -

{{ title }}

-

-Name: {{ instance.name }} -

-

-Configuration: {{ instance.configuration }} -

-

-Created On: {{ instance.created_at }} -

+

{{ title }}

-

-Click here to delete instance -

+
+

Configuration: {{ instance.configuration.name }}

+ + +

Created On: {{ instance.created_at }}

+ +
+
+ +
+
+
{% endblock %} diff --git a/dash/views.py b/dash/views.py index b78090a..55d5ec9 100644 --- a/dash/views.py +++ b/dash/views.py @@ -118,6 +118,7 @@ def view_instance(request, name: str): instance = get_object_or_404(Instance, owned_by=user, name=name) ctx = default_ctx(title=PAGE_TITLE, username=user.username) + instance.configuration = instance.configuration_id ctx["instance"] = instance return render(request, "dash/instances/view/index.html", context=ctx)