From 04b676a8bc7209b8017395dc9bb36086283ac72c Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Tue, 9 Apr 2019 16:30:57 -0400 Subject: Implement OPNFV workflow This is a counterpart to an update to network models, and allows for configuring baremetal OPNFV and Openstack deploys Change-Id: I0185dbfa6c9105d7e63a7e7d7dd1f5cf228a8877 Signed-off-by: Sawyer Bergeron Signed-off-by: Parker Berberian --- .../config_bundle/steps/assign_host_roles.html | 22 ++++ .../config_bundle/steps/assign_network_roles.html | 22 ++++ .../config_bundle/steps/config_software.html | 50 +------- .../config_bundle/steps/define_software.html | 129 +++++++-------------- .../config_bundle/steps/pick_installer.html | 32 +++++ .../config_bundle/steps/table_formset.html | 63 ++++++++++ 6 files changed, 182 insertions(+), 136 deletions(-) create mode 100644 src/templates/config_bundle/steps/assign_host_roles.html create mode 100644 src/templates/config_bundle/steps/assign_network_roles.html create mode 100644 src/templates/config_bundle/steps/pick_installer.html create mode 100644 src/templates/config_bundle/steps/table_formset.html (limited to 'src/templates/config_bundle/steps') diff --git a/src/templates/config_bundle/steps/assign_host_roles.html b/src/templates/config_bundle/steps/assign_host_roles.html new file mode 100644 index 0000000..3ba7665 --- /dev/null +++ b/src/templates/config_bundle/steps/assign_host_roles.html @@ -0,0 +1,22 @@ +{% extends "config_bundle/steps/table_formset.html" %} + +{% load bootstrap3 %} + +{% block table %} + + + Host + Role + + + + {% for form in formset %} + + {% bootstrap_field form.host_name show_label=False %} + {% bootstrap_field form.role show_label=False %} + + {% endfor %} + + +{{formset.management_form}} +{% endblock table %} diff --git a/src/templates/config_bundle/steps/assign_network_roles.html b/src/templates/config_bundle/steps/assign_network_roles.html new file mode 100644 index 0000000..0e887d6 --- /dev/null +++ b/src/templates/config_bundle/steps/assign_network_roles.html @@ -0,0 +1,22 @@ +{% extends "config_bundle/steps/table_formset.html" %} + +{% load bootstrap3 %} + +{% block table %} + + + Role + Network + + + + {% for form in formset %} + + {% bootstrap_field form.role show_label=False %} + {% bootstrap_field form.network show_label=False %} + + {% endfor %} + + +{{formset.management_form}} +{% endblock table %} diff --git a/src/templates/config_bundle/steps/config_software.html b/src/templates/config_bundle/steps/config_software.html index e1f9541..b181c7e 100644 --- a/src/templates/config_bundle/steps/config_software.html +++ b/src/templates/config_bundle/steps/config_software.html @@ -8,58 +8,12 @@
{% csrf_token %}

Give it a name:

- {{ form.name }} + {% bootstrap_field form.name %}

And a description:

- {{ form.description }} - - + {% bootstrap_field form.description %}
- {% endblock content %} diff --git a/src/templates/config_bundle/steps/define_software.html b/src/templates/config_bundle/steps/define_software.html index 8e7be91..ba1ff34 100644 --- a/src/templates/config_bundle/steps/define_software.html +++ b/src/templates/config_bundle/steps/define_software.html @@ -1,102 +1,55 @@ -{% extends "workflow/viewport-element.html" %} -{% load staticfiles %} +{% extends "config_bundle/steps/table_formset.html" %} {% load bootstrap3 %} +{% block table %} + + + Device + Image + HeadNode + + + +{% for form in formset %} + + {% bootstrap_field form.host_name show_label=False %} + {% bootstrap_field form.image show_label=False %} + + + {{ form.headnode }} + + +{% endfor %} +{{formset.management_form}} + +{% endblock table %} + +{% block tablejs %} + +{% endblock tablejs %} -{% block extrahead %} - - - - -{% endblock extrahead %} - -{% block content %} -{% if error %} -

{{ error }}

-{% else %} -
- {% csrf_token %} - -
-
-
- - - {% block table %} - - - - - - - - - {% for form in formset %} - - {% for field in form %} - - {% endfor %} - - {% endfor %} - {{formset.management_form}} - - {% endblock table %} - -
DeviceRoleImage
{{ field }}
-
- - - -
- -
-
- - -{% endif %} -{% endblock content %} - -{% block extrajs %} - {{ block.super }} - - - - - - - - {% block tablejs %} - {% endblock tablejs %} -{% endblock extrajs %} - - -{% block onleave %} -var form = $("#softwaredefinitionform"); +var form = $("#table_formset"); var formData = form.serialize(); var req = new XMLHttpRequest(); req.open("POST", "/wf/workflow/", false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onerror = function() { alert("problem with form submission"); } req.send(formData); -{% endblock %} +{% endblock onleave %} diff --git a/src/templates/config_bundle/steps/pick_installer.html b/src/templates/config_bundle/steps/pick_installer.html new file mode 100644 index 0000000..3b170d9 --- /dev/null +++ b/src/templates/config_bundle/steps/pick_installer.html @@ -0,0 +1,32 @@ +{% extends "workflow/viewport-element.html" %} +{% load staticfiles %} + +{% load bootstrap3 %} + +{% block content %} + +{% if unavailable %} +

Please choose a config bundle first

+{% else %} + +
+ {% csrf_token %} +

Choose your installer:

+ {% bootstrap_field form.installer %} +

Choose your scenario:

+ {% bootstrap_field form.scenario %} +
+ +{% endif %} + +{% endblock content %} + +{% block onleave %} +var form = $("#installer_form"); +var formData = form.serialize(); +var req = new XMLHttpRequest(); +req.open("POST", "/wf/workflow/", false); +req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); +req.onerror = function() { alert("problem with form submission"); } +req.send(formData); +{% endblock %} diff --git a/src/templates/config_bundle/steps/table_formset.html b/src/templates/config_bundle/steps/table_formset.html new file mode 100644 index 0000000..ad2c5a3 --- /dev/null +++ b/src/templates/config_bundle/steps/table_formset.html @@ -0,0 +1,63 @@ +{% extends "workflow/viewport-element.html" %} +{% load staticfiles %} + +{% load bootstrap3 %} + +{% block extrahead %} + + + + + +{% endblock extrahead %} + +{% block content %} +{% if error %} +

{{ error }}

+{% else %} +
+
+ {% csrf_token %} + +
+
+
+ + + {% block table %} + {% endblock table %} + +
+
+
+
+
+
+ +{% endif %} +{% endblock content %} + +{% block extrajs %} + {{ block.super }} + + + + + + + + {% block tablejs %} + {% endblock tablejs %} +{% endblock extrajs %} + + +{% block onleave %} +var form = $("#table_formset"); +var formData = form.serialize(); +var req = new XMLHttpRequest(); +req.open("POST", "/wf/workflow/", false); +req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); +req.onerror = function() { alert("problem with form submission"); } +req.send(formData); +{% endblock %} -- cgit 1.2.3-korg