<commit_before>{% extends "clearinghouse/base.html" %}
{% load ch_extras %}

{% block content %}
<script type="text/javascript">
<!--
function showDiv(foo) {
	obj = document.getElementById("flowspacedivid");
	if (foo == "advanced") {
		obj.style.display = 'block';
	} else {
		obj.style.display = 'none';
	}
}
//-->
</script>
<div class="main">
    
    <h1>Step 3: Packet Types and OpenFlow Controller for Slice {{ slice.name }}</h1>
    
    {% if error_message %}
    <div class="error">
    <p><strong>{{ error_message }}</strong></p>
    </div>
    {% endif %}
    
    <form class="form" onsubmit="return doSubmit(this.typesdropdown)" id='sliceForm' method="POST" action="">
        <div class="controller form">
	        <h2>OpenFlow Controller:</h2>
	        <table class="formtable controllertable">
	        {{ form.as_table }}
	        </table>
        </div>
        
        <div class="flowspace form">
            <div class="packet types">
                <h2>Select Packet Types:</h2>
                <select name="typesdropdown" onchange="showDiv(this.value);">
		            <option value="http">All HTTP</option>
                    <option value="ip">All IP</option>
                    <option value="tcp">All TCP</option>
		            <option value="special">All CDN</option>
		            <option value="advanced" selected="selected">Advanced</option>
                </select>
            </div>
            
            <div id="flowspacedivid" >
	            {{ fsformset.management_form }}
	            <table border="1" class="fulltable flowspacetable">
					<thead>
		                <tr>
			                {% for field in fsformset.forms.0 %}
			                {% if not field.label_tag|contains:"Slice" and not field.label_tag|contains:"Id" %}
		                    <th><strong>{{ field.label_tag }}</strong></th>
			                {% endif %}
			                {% endfor %}
		                </tr>
					</thead>
	                {% for form in fsformset.forms %}
	                <tr>
		                {% for field in form %}
		                {% if not field.label_tag|contains:"Slice" and not field.label_tag|contains:"Id" %}
                        <td>{{ field.errors }} {{ field }}</td>
	                    {% endif %}
	                    {% endfor %}
	                </tr>
	                {% for field in form %}
	                {% if field.label_tag|contains:"Slice" or field.label_tag|contains:"Id" %}
	                {{ field }}
	                {% endif %}
	                {% endfor %}
	                {% endfor %}
	            </table>
            </div>
            <input id='submit' type="submit" value="Save" />
        </div>
    </form>
</div>
{% endblock %}

{% block scripts %}
<script language="JavaScript">
    function addHiddenInput(id, name, val) {
        var form = document.getElementById("sliceForm");
        var newIn = document.createElement("input");
        newIn.name = name;
        newIn.type = "hidden";
        newIn.id = id;
        newIn.value = val;
        form.appendChild(newIn);
    }
    function doSubmit(menu) {
        addHiddenInput("type", "type", menu.options[menu.selectedIndex].value);
        return true;
    }<commit_msg>Tweak: Added vertical space to move submit button lower.<commit_after>{% extends "clearinghouse/base.html" %}
{% load ch_extras %}

{% block content %}
<script type="text/javascript">
<!--
function showDiv(foo) {
	obj = document.getElementById("flowspacedivid");
	if (foo == "advanced") {
		obj.style.display = 'block';
	} else {
		obj.style.display = 'none';
	}
}
//-->
</script>
<div class="main">
    
    <h1>Step 3: Packet Types and OpenFlow Controller for Slice {{ slice.name }}</h1>
    
    {% if error_message %}
    <div class="error">
    <p><strong>{{ error_message }}</strong></p>
    </div>
    {% endif %}
    
    <form class="form" onsubmit="return doSubmit(this.typesdropdown)" id='sliceForm' method="POST" action="">
        <div class="controller form">
	        <h2>OpenFlow Controller:</h2>
	        <table class="formtable controllertable">
	        {{ form.as_table }}
	        </table>
        </div>
        
        <div class="flowspace form">
            <div class="packet types">
                <h2>Select Packet Types:</h2>
                <select name="typesdropdown" onchange="showDiv(this.value);">
		            <option value="http">All HTTP</option>
                    <option value="ip">All IP</option>
                    <option value="tcp">All TCP</option>
		            <option value="special">All CDN</option>
		            <option value="advanced" selected="selected">Advanced</option>
                </select>
            </div>
            
            <div id="flowspacedivid" >
	            {{ fsformset.management_form }}
	            <table border="1" class="fulltable flowspacetable">
					<thead>
		                <tr>
			                {% for field in fsformset.forms.0 %}
			                {% if not field.label_tag|contains:"Slice" and not field.label_tag|contains:"Id" %}
		                    <th><strong>{{ field.label_tag }}</strong></th>
			                {% endif %}
			                {% endfor %}
		                </tr>
					</thead>
	                {% for form in fsformset.forms %}
	                <tr>
		                {% for field in form %}
		                {% if not field.label_tag|contains:"Slice" and not field.label_tag|contains:"Id" %}
                        <td>{{ field.errors }} {{ field }}</td>
	                    {% endif %}
	                    {% endfor %}
	                </tr>
	                {% for field in form %}
	                {% if field.label_tag|contains:"Slice" or field.label_tag|contains:"Id" %}
	                {{ field }}
	                {% endif %}
	                {% endfor %}
	                {% endfor %}
	            </table>
            </div>
			<br/>
            <input id='submit' type="submit" value="Save" />
        </div>
    </form>
</div>
{% endblock %}

{% block scripts %}
<script language="JavaScript">
    function addHiddenInput(id, name, val) {
        var form = document.getElementById("sliceForm");
        var newIn = document.createElement("input");
        newIn.name = name;
        newIn.type = "hidden";
        newIn.id = id;
        newIn.value = val;
        form.appendChild(newIn);
    }
    function doSubmit(menu) {
        addHiddenInput("type", "type", menu.options[menu.selectedIndex].value);
        return true;
    }
{'fraction_non_alphanumeric': 0.1521070439864657, 'fraction_numerical': 0.0027683789603199014, 'mean_word_length': 1.703950103950104, 'pattern_counts': {'":': 0, '<': 118, '<?xml version=': 0, '>': 118, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5562634', 'n_tokens_mistral': 2047, 'n_tokens_neox': 1758, 'n_words': 391}