Update booking detail page and API after model refactor 76/71676/3
authorSawyer Bergeron <sbergeron@iol.unh.edu>
Tue, 8 Dec 2020 20:49:31 +0000 (15:49 -0500)
committerSawyer Bergeron <sbergeron@iol.unh.edu>
Wed, 9 Dec 2020 20:17:24 +0000 (15:17 -0500)
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Change-Id: I2d1d5d7031c82a2088aa68b772c7bbdf225f3c9a
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
src/notifier/migrations/0007_email.py [new file with mode: 0644]
src/resource_inventory/models.py
src/templates/base/booking/booking_detail.html

diff --git a/src/notifier/migrations/0007_email.py b/src/notifier/migrations/0007_email.py
new file mode 100644 (file)
index 0000000..aaac048
--- /dev/null
@@ -0,0 +1,23 @@
+# Generated by Django 2.2 on 2020-12-09 20:02
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('notifier', '0006_emailed'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Email',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('sent', models.BooleanField(default=False)),
+                ('title', models.CharField(max_length=150)),
+                ('message', models.TextField()),
+                ('recipient', models.CharField(max_length=150)),
+            ],
+        ),
+    ]
index 01da8bb..e2f2fea 100644 (file)
@@ -345,7 +345,7 @@ class Server(Resource):
         return {
             "id": self.labid,
             "image": image,
-            "hostname": self.name,
+            "hostname": self.config.name,
             "power": power,
             "ipmi_create": str(ipmi)
         }
index 24a654c..a014fea 100644 (file)
                         <td>Pod Definition</td>
                         <td>{{ booking.resource.template }}</td>
                     </tr>
-                    <tr>
-                        <td>Pod Configuration</td>
-                        <td>{{ booking.config_bundle }}</td>
-                    </tr>
                     <tr>
                         <td>Lab Deployed At</td>
                         <td>{{ booking.lab }}</td>
             </div>
             <div class="collapse show" id="pod_panel">
                 <div class="card-body">
+                    <h4>{{host.bundle.template.copy_of.name}}</h4>
                     {% for host in booking.resource.get_resources %}
-                        <h4>{{host.bundle.template.copy_of.name}}</h4>
+                        <h4>{{host.config.name}}</h4>
                         <div class="overflow-auto">
                             <table class="table m-0">
                                 <tr>
                                     <td>Hostname:</td>
-                                    <td>{{host.name}}</td>
+                                    <td>{{host.config.name}}</td>
                                 </tr>
                                 <tr>
                                     <td>Machine:</td>
                                     <td>Role:</td>
                                     <td>{{host.template.opnfvRole}}</td>
                                 </tr>
+                                <tr>
+                                    <td>Is Headnode:</td>
+                                    <td>{{host.config.is_head_node}}</td>
                                 <tr>
                                     <td>Image:</td>
                                     <td id="host_image_{{host.id}}">
-                                        {{host.config.Image}}
+                                        {{host.config.image}}
                                         <button
                                             class="btn btn-primary ml-4"
                                             data-toggle="modal"