summaryrefslogtreecommitdiffstats
path: root/INFO
blob: ed184f6e1d256a405fb1b7a49ec6ff842dcb4143 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Project: Juju OPNFV Infrastructure Deployer (JOID)
Project Creation Date: 2015.05.26
Project Category: Integration & Testing
Lifecycle State: Incubation/Mature/Integration/Top Level
Primary Contact(s): artur.tyloch@canonical.com, narinder.gupta@canonical.com
Project Lead: artur.tyloch@canonical.com
Jira Project Name: Juju OPNFV Infrastructure Deployer
Jira Project Prefix: JOID
Mailing list tag: [joid]
IRC: #opnfv-joid
Repository: joid

Committers:
narinder.gupta@canonical.com
prakash.ramchandran@huawei.com
vagish.shanmukh@huawei.com
artur.tyloch@canonical.com

Link to TSC approval of the project: http://meetbot.opnfv.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-05-26-13.58.html
Link(s) to approval of additional committers:
ion */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
{% extends "base.html" %}
{% load staticfiles %}
{% load bootstrap4 %}
{% block content %}

{% bootstrap_form_errors form type='non_fields' %}
<form id="quick_booking_form" action="/booking/quick/" method="POST" class="form">
    {% csrf_token %}
        <div class="row mx-0 px-0">
            <div class="col-12 mx-0 px-0 mt-2">
                {% block form-text %}
                <p class="my-0">
                    Please select a host type you wish to book. Only available types are shown.
                    If something isn't working right, let us know <a href="mailto:{{contact_email}}"> here! </a> 
                </p>
                {% endblock form-text %}
                {% bootstrap_field form.filter_field show_label=False %}
            </div>
        </div>
        <div class="row justify-content-center">
            <div class="col-12 col-lg-3 my-2">
                <div class="col border rounded py-2 h-100">
                    {% bootstrap_field form.purpose %}
                    {% bootstrap_field form.project %}
                    {% bootstrap_field form.length %}
                    <span>Days: </span><output id="daysout">0</output>
                    <script>
                        document.getElementById("id_length").setAttribute("oninput", "daysout.value=this.value");
                        document.getElementById("daysout").value = document.getElementById("id_length").value;
                    </script>
                </div>
            </div>
            {% block collab %}
            <div class="col-12 col-lg-3 my-2">
                <div class="col border rounded py-2 h-100">
                    <label>Collaborators</label>
                    {{ form.users }}
                </div>
            </div>
            {% endblock collab %}
            <div class="col-12 col-lg-3 my-2">
                <div class="col border rounded py-2 h-100">
                    {% bootstrap_field form.hostname %}
                    {% bootstrap_field form.image %}
                </div>
            </div>
            {% block opnfv %}
            <div class="col-12 col-lg-3 my-2">
                <div class="col border rounded py-2 h-100">
                    <strong>OPNFV: (Optional)</strong>
                    {% bootstrap_field form.installer %}
                    {% bootstrap_field form.scenario %}
                </div>
            </div>
            {% endblock opnfv %}
            <div class="col-12 d-flex mt-2 justify-content-end">
                <button id="quick_booking_confirm" onclick="submit_form();" type="button" class="btn btn-success">Confirm</button>
            </div>
        </div>
</form>
{% block image_script %}
{% endblock image_script %}

<script type="text/javascript">
    function submit_form()
    {
        run_form_callbacks();
        document.getElementById("quick_booking_form").submit();
    }

    function hide_dropdown(drop_id) {
        var drop = document.getElementById(drop_id);
        //select 'blank' option
        for( var i=0; i < drop.length; i++ )
        {
            if ( drop.options[i].text == '---------' )
                drop.selectedIndex = i;
        }
    }

    function get_selected_value(key){
        for( var attr in multi_filter_widget.result[key] ){
            if(!(attr in {}) )
                return attr;
        }
    }

    var sup_image_dict = {{image_filter | safe}};
    var sup_installer_dict = {{installer_filter | safe}};
    var sup_scenario_dict = {{scenario_filter | safe}};
    var resource_profile_map = {{resource_profile_map | safe}};

    function imageFilter() {
        var drop = document.getElementById("id_image");
        var lab_pk = get_selected_value("lab");
        var host_pk = get_selected_value("resource");

        for (const childNode of drop.childNodes) {
            var image_object = sup_image_dict[childNode.value];
            if (image_object) //weed out empty option
            {
                const img_at_lab = image_object.lab == lab_pk;
                const profiles = resource_profile_map[host_pk];
                const img_in_template = profiles && profiles.indexOf(image_object.host_profile) > -1
                childNode.disabled = !img_at_lab || !img_in_template;
            }
        }
    }

    imageFilter();
    $('#id_installer').children().hide();
    $('#id_scenario').children().hide();


    Array.from(document.getElementsByClassName("grid-item-select-btn")).forEach(function (element) {
        element.addEventListener('click', imageFilter);
    });

    function installerHider() {
        dropFilter("id_installer", sup_installer_dict, "id_image");
        scenarioHider();
    }
    document.getElementById('id_image').addEventListener('change', installerHider);

    function scenarioHider() {
        dropFilter("id_scenario", sup_scenario_dict, "id_installer");
    }
    document.getElementById('id_installer').addEventListener('change', scenarioHider);

    function dropFilter(target, target_filter, master) {
        var dropdown = document.getElementById(target);

        hide_dropdown(target);

        var drop = document.getElementById(master);
        var opts = target_filter[drop.options[drop.selectedIndex].value];
        if (!opts) {
            opts = {};
        }

        var map = Object.create(null);
        for (var i = 0; i < opts.length; i++) {
            var j = opts[i];
            map[j] = true;
        }

        for (var i = 0; i < dropdown.childNodes.length; i++) {
            if (dropdown.childNodes[i].value in opts && !(dropdown.childNodes[i].value in {})) {
                dropdown.childNodes[i].style.display = "inherit";
                dropdown.childNodes[i].disabled = false;
            }
        }
    }
</script>
{% endblock %}