Merge pull request #92 from CiscoSystems/dashboard-quantum-integration

Dashboard quantum integration
This commit is contained in:
Devin Carlen
2011-08-30 14:32:55 -07:00
32 changed files with 1145 additions and 7 deletions

View File

@@ -0,0 +1,12 @@
<form id="attach_port_form_{{port.id}}" class="form-attach" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}{{hidden}}{% endfor %}
{% for field in form.visible_fields %}
{{ field.label_tag }}
{{ field.errors }}
{{ field }}
{% endfor %}
<input name="network" type="hidden" value="{{network}}" />
<input name="port" type="hidden" value="{{port}}" />
<input type="submit" value="Attach" class="large-rounded" />
</form>

View File

@@ -0,0 +1,11 @@
<form id="create_port_form" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% for field in form.visible_fields %}
{{ field.label_tag }}
{{ field.errors }}
{{ field }}
{% endfor %}
<input name="network" type="hidden" value="{{network_id}}" />
<input type="submit" value="Create Ports" class="large-rounded" />
</form>

View File

@@ -8,6 +8,9 @@
<li><a {% if current_sidebar == "images" %} class="active" {% endif %} href="{% url dash_images request.user.tenant %}">Images</a></li>
<li><a {% if current_sidebar == "snapshots" %} class="active" {% endif %} href="{% url dash_snapshots request.user.tenant %}">Snapshots</a></li>
<li><a {% if current_sidebar == "keypairs" %} class="active" {% endif %} href="{% url dash_keypairs request.user.tenant %}">Keypairs</a></li>
{% if quantum_configured %}
<li><a {% if current_sidebar == "networks" %} class="active" {% endif %} href="{% url dash_networks request.user.tenant %}">Networks</a></li>
{% endif %}
</ul>
{% if swift_configured %}
<h3>Manage Object Store</h3>

View File

@@ -0,0 +1,8 @@
<form id="delete_form" class="form-delete" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{hidden}}
{% endfor %}
<input name="network" type="hidden" value="{{network.id}}" />
<input title="Network" id="delete_{{network.id}}" class="delete" type="submit" value="Delete" />
</form>

View File

@@ -0,0 +1,9 @@
<form id="delete_port_form" class="form-delete" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{hidden}}
{% endfor %}
<input name="network" type="hidden" value="{{network.id}}" />
<input name="port" type="hidden" value="{{port.id}}" />
<input title="Delete this port" id="delete_{{port.id}}" class="delete" type="submit" value="Delete" />
</form>

View File

@@ -0,0 +1,9 @@
<form id="detach_port_form" class="form-detach" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{hidden}}
{% endfor %}
<input name="network" type="hidden" value="{{network.id}}" />
<input name="port" type="hidden" value="{{port.id}}" />
<input title="Detach port from instance" id="detach_{{port.id}}" class="detach" type="submit" value="Detach" />
</form>

View File

@@ -0,0 +1,49 @@
<table id='Ports' class="wide">
<tr id='headings'>
<th>ID</th>
<th>State</th>
<th>Attachment</th>
<th>Actions</th>
<th>Extensions</th>
</tr>
<tbody class='main'>
{% for port in network.ports %}
<tr class="{% cycle 'odd' 'even' %}">
<td>{{port.id}}</td>
<td class="{{port.state}}">{{port.state}}</td>
<td>
{% if port.attachment == None %}
--
{% else %}
<table class="attachmend_details">
<tr>
<td> Instance </td>
<td> VIF Id </td>
</tr>
<tr>
<td> {{port.instance}} </td>
<td> {{port.attachment}} </td>
</tr>
</table>
{% endif %}
</td>
<td id="actions">
<ul>
{% if port.attachment == None %}
<li><a href='{% url dash_ports_attach request.user.tenant network.id port.id %}'>Attach</a></li>
{% else %}
<li class="form">{% include "_detach_port.html" with form=detach_port_form %}</li>
{% endif %}
<li class="form">{% include "_delete_port.html" with form=delete_port_form %}</li>
<li class="form">{% include "_toggle_port.html" with form=toggle_port_form %}</li>
</ul>
</td>
<td id="extensions">
<ul>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,10 @@
<form id="network_form" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% for field in form.visible_fields %}
{{ field.label_tag }}
{{ field.errors }}
{{ field }}
{% endfor %}
<input type="submit" value="Create Network" class="large-rounded" />
</form>

View File

@@ -0,0 +1,27 @@
<table id='networks' class="wide">
<tr id='headings'>
<th>ID</th>
<th>Name</th>
<th>Ports</th>
<th>Available</th>
<th>Used</th>
<th>Action</th>
</tr>
<tbody class='main'>
{% for network in networks %}
<tr class="{% cycle 'odd' 'even' %}" id="{{network.id}}">
<td><a href='{% url dash_networks_detail request.user.tenant network.id %}'>{{network.id}}</a></td>
<td class="name">{{network.name}}</td>
<td>{{network.total}}</td>
<td>{{network.available}}</td>
<td>{{network.used}}</td>
<td id="actions">
<ul>
<li class="form">{% include "_delete_network.html" with form=delete_form %}</li>
<li><a href='{% url dash_network_rename request.user.tenant network.id %}'>Rename</a></li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -1,6 +1,8 @@
{% block page_header %}
<div id='page_header'>
<h2>{{title}}</h2>
{% block breadcrumbs %}
{% endblock %}
{% if searchable %}
<div class="right">
<div class='search'>

View File

@@ -0,0 +1,11 @@
<form id="rename_form" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% for field in form.visible_fields %}
{{ field.label_tag }}
{{ field.errors }}
{{ field }}
{% endfor %}
<input type="hidden" name="network" value="{{network.network.id}}"/>
<input type="submit" value="Rename Network" class="large-rounded" />
</form>

View File

@@ -0,0 +1,17 @@
<form id="form_rename_{{network.id}}" class="form-rename" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{hidden}}
{% endfor %}
<input name="network" type="hidden" value="{{network.id}}" />
<input id="new_name_{{network.id}}" name="new_name" type="hidden" value="{{network.name}}" />
<input id="rename_{{network.id}}" class="rename" type="submit" value="Rename" />
<div class="network_rename_div" id="rename_div_{{network.id}}">
<input id="change_to_{{network.id}}" name="change_to" class="change_to ui-corner-all ui-state-highlight" size="20" value="{{network.name}}"/><br/><br/>
<button id="{{network.id}}" class="dialog_rename">Rename</button>
</div>
</form>

View File

@@ -0,0 +1,15 @@
<form id="port_toggle_form" class="form-toggle" method="post">
{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{hidden}}
{% endfor %}
<input name="network" type="hidden" value="{{network.id}}" />
<input name="port" type="hidden" value="{{port.id}}" />
{% if port.state == 'DOWN' %}
<input name="state" type="hidden" value="ACTIVE" />
<input title="Turn port UP" id="port_up_{{port.id}}" class="port_up" type="submit" value="Port UP" />
{% else %}
<input name="state" type="hidden" value="DOWN" />
<input title="Turn port DOWN" id="port_up_{{port.id}}" class="port_down" type="submit" value="Port DOWN" />
{% endif %}
</form>

View File

@@ -0,0 +1,28 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title="Create Network" %}
{% endblock page_header %}
{% block dash_main %}
<div class="dash_block">
<div class="left">
{% include '_network_form.html' with form=network_form %}
<h3><a href="{% url dash_networks request.user.tenant %}"><< Return to networks list</a></h3>
</div>
<div class="right">
<h3>Description:</h3>
<p>Networks provide layer 2 connectivity to your instances.</p>
</div>
<div class="clear">&nbsp;</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title="Rename Network" %}
{% endblock page_header %}
{% block headerjs %}
<script type="text/javascript">
$(document).ready(function() {
$('input#id_new_name').val('{{network.network.name}}');
});
</script>
{% endblock headerjs %}
{% block dash_main %}
<div class="dash_block">
<div class="left">
{% include '_rename_form.html' with form=rename_form %}
<h3><a href="{% url dash_networks request.user.tenant %}"><< Return to networks list</a></h3>
</div>
<div class="right">
<h3>Rename:</h3>
<p>Enter a new name for your network.</p>
</div>
<div class="clear">&nbsp;</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,26 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{% url dash_networks request.user.tenant as refresh_link %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title="Networks" refresh_link=refresh_link searchable="true" %}
{% endblock page_header %}
{% block dash_main %}
{% if networks %}
{% include '_network_list.html' %}
<a id="network_create_link" class="action_link large-rounded" href="{% url dash_network_create request.user.tenant %}">Create New Network</a>
{% else %}
<div class="message_box info">
<h2>Info</h2>
<p>There are currently no networks. <a href='{% url dash_network_create request.user.tenant %}'>Create A Network &gt;&gt;</a></p>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,30 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{% url dash_networks_detail request.user.tenant network.id as refresh_link %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title=network.name refresh_link=refresh_link searchable="true" %}
{% endblock page_header %}
{% block breadcrumbs %}
<a href="{% url dash_networks tenant %}">Networks</a>&nbsp;&raquo;&nbsp;
<a href="{% url dash_networks_detail tenant network.id %}">{{network.name}}</a>
{% endblock %}
{% block dash_main %}
{% if network.ports %}
{% include '_network_detail.html' %}
<a id="network_create_link" class="action_link large-rounded" href="{% url dash_ports_create request.user.tenant network.id %}">Create Ports</a>
{% else %}
<div class="message_box info">
<h2>Info</h2>
<p>There are currently no ports in this network. <a href="{% url dash_ports_create request.user.tenant network.id %}">Create Ports &gt;&gt;</a></p>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,48 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title="Attach Port" %}
{% endblock page_header %}
{% block headerjs %}
<script type="text/javascript">
var VIF_OPTIONS = {
{% for vif in vifs %}
'{{vif.id}}' : '{{vif.name}}',
{% endfor %}
};
$(document).ready(function() {
$.each(VIF_OPTIONS, function(val, text) {
$('select#id_vif_id')
.append($("<option></option>")
.attr("value", val)
.text(text));
});
});
</script>
{% endblock headerjs %}
{% block dash_main %}
<div class="dash_block">
<div class="left">
{% include '_attach_port.html' with form=attach_form %}
<h3><a href="{% url dash_networks_detail request.user.tenant network %}"><< Return to network detail</a></h3>
</div>
<div class="right">
<p>Select an interface from the list on the left to attach it to this port.</p>
<p>Only interfaces that are not connected to any existing port are shown</p>
<p>If you want to reconnect a connected interface, please detach it first</p>
</div>
<div class="clear">&nbsp;</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% extends 'dash_base.html' %}
{% block sidebar %}
{% with current_sidebar="networks" %}
{{block.super}}
{% endwith %}
{% endblock %}
{% block page_header %}
{# to make searchable false, just remove it from the include statement #}
{% include "_page_header.html" with title="Create Network" %}
{% endblock page_header %}
{% block dash_main %}
<div class="dash_block">
<div class="left">
{% include '_create_port.html' with form=create_form %}
<h3><a href="{% url dash_networks_detail request.user.tenant network_id %}"><< Return to network detail</a></h3>
</div>
<div class="right">
<h3>Description:</h3>
<p>You can plug virtual interfaces from your instances to ports created in the network</p>
</div>
<div class="clear">&nbsp;</div>
</div>
{% endblock %}