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 --- src/templates/base.html | 1 + src/templates/booking/booking_table.html | 2 +- .../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 ++++++++++ src/templates/resource/steps/meta_info.html | 2 +- 9 files changed, 185 insertions(+), 138 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') diff --git a/src/templates/base.html b/src/templates/base.html index 02c67dc..f48a201 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -134,6 +134,7 @@ +
  • diff --git a/src/templates/booking/booking_table.html b/src/templates/booking/booking_table.html index e0c5f49..32a0146 100644 --- a/src/templates/booking/booking_table.html +++ b/src/templates/booking/booking_table.html @@ -30,7 +30,7 @@ {{ booking.end }} - {{ booking.resource.get_host.config.image.os.name }} + {{ booking.resource.get_head_node.config.image.os.name }} {% endfor %} 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 %} diff --git a/src/templates/resource/steps/meta_info.html b/src/templates/resource/steps/meta_info.html index 7a1b56a..da98267 100644 --- a/src/templates/resource/steps/meta_info.html +++ b/src/templates/resource/steps/meta_info.html @@ -7,7 +7,7 @@