Re-architects the OpenStack Dashboard for modularity and extensibility.
Implements blueprint extensible-architecture. Implements blueprint improve-dev-documentation. Implements blueprint gettext-everywhere. Implements blueprint sphinx-docs. Complete re-architecture of the dashboard to transform it from a standalone django-openstack app to a Horizon framework for building dashboards. See the docs for more information. Incidentally fixes the following bugs: Fixes bug 845868 -- no PEP8 violations. Fixes bug 766096 -- the dashboard can now be installed at any arbitrary URL. Fixes bug 879111 -- tenant id is now controlled solely by the tenant switcher, not the url (which was disregarded anyway) Fixes bug 794754 -- output of venv installation is considerably reduced. Due to the scale and scope of this patch I recommend reviewing it on github: https://github.com/gabrielhurley/horizon/tree/extensible_architecture Change-Id: I8e63f7ea235f904247df40c33cb66338d973df9e
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'horizon/common/_sidebar.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% block page_header %}{% endblock %}
|
||||
<div class="main_content">
|
||||
{% include "_messages.html" %}
|
||||
{% block syspanel_main %}{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends 'syspanel/flavors/_form.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Create Flavor"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{%load i18n%}
|
||||
<form id="form_delete_{{flavor.id}}" class="form-delete" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="flavorid" type="hidden" value="{{flavor.id}}" />
|
||||
<input id="delete_{{flavor.id}}" class="delete" title="Flavor: {{flavor.name}}" type="submit" value="{% trans "Delete"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,17 @@
|
||||
{%load i18n%}
|
||||
<form id="flavor_form" action="" method="post">
|
||||
{% csrf_token %}
|
||||
<fieldset>
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
{% for field in form.visible_fields %}
|
||||
{{field.label_tag}}
|
||||
{{field.errors}}
|
||||
{{field}}
|
||||
{% endfor %}
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Create Flavor"%}" />
|
||||
{% endblock %}
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,25 @@
|
||||
{%load i18n%}
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "Id"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "VCPUs"%}</th>
|
||||
<th>{% trans "Memory"%}</th>
|
||||
<th>{% trans "Disk"%}</th>
|
||||
<th>{% trans "Actions"%}</th>
|
||||
</tr>
|
||||
{% for flavor in flavors %}
|
||||
<tr id="{{flavor.id}}" class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{flavor.id}}</td>
|
||||
<td>{{flavor.name}}</td>
|
||||
<td>{{flavor.vcpus}}</td>
|
||||
<td>{{flavor.ram}}MB</td>
|
||||
<td>{{flavor.disk}}GB</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/flavors/_delete.html" with form=delete_form %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -0,0 +1,41 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="flavors" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Create Flavor") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div>
|
||||
<ul class='status_box info small'>
|
||||
<li class='block'>
|
||||
<p class='overview'>{{global_summary.total_vcpus}}<span> Cores</span></p></span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_vcpus}}<span class='label'> Avail</span></p>
|
||||
</li>
|
||||
<li class='block'>
|
||||
<p class='overview'>{{global_summary.total_ram_size_hr|floatformat}}<span> {{global_summary.unit_ram_size}} Ram</span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_ram_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_ram_size}}</span><span class='label'> Avail</span></p>
|
||||
</li>
|
||||
<li class='block last'>
|
||||
<p class='overview'>{{global_summary.total_disk_size_hr|floatformat}}<span> {{global_summary.unit_disk_size}} Disk</span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_disk_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_disk_size}}</span><span class='label'> Avail</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="left">
|
||||
{% include "syspanel/flavors/_create.html" %}
|
||||
</div>
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can define the sizing of a new flavor."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="flavors" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:flavors:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Flavors") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
{% include "syspanel/flavors/_list.html" %}
|
||||
<a id="flavor_create_link" class="action_link large-rounded" href="{% url horizon:syspanel:flavors:create %}">{% trans "Create New Flavor"%}</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{%load i18n%}
|
||||
<form id="form_delete_{{image.id}}" class="form-delete" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="image_id" type="hidden" value="{{image.id}}" />
|
||||
<input id="delete_{{image.id}}" class="delete" title="Image: {{image.name}}" type="submit" value="{% trans "Delete"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,11 @@
|
||||
{%load i18n%}
|
||||
<form id="image_form" action="" 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="{% trans "Update Image"%}" class="large-rounded" />
|
||||
</form>
|
||||
@@ -0,0 +1,47 @@
|
||||
{% load parse_date %}
|
||||
{%load i18n%}
|
||||
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "ID"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Size"%}</th>
|
||||
<th>{% trans "Public"%}</th>
|
||||
<th>{% trans "Created"%}</th>
|
||||
<th>{% trans "Updated"%}</th>
|
||||
<th colspan="2">{% trans "Status"%}</th>
|
||||
</tr>
|
||||
{% for image in images %}
|
||||
<tr id="images" class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{image.id}}</td>
|
||||
<td>{{image.name}}</td>
|
||||
<td>{{image.size|filesizeformat}}</td>
|
||||
<td>{{image.is_public}}</td>
|
||||
<td>{{image.created_at|parse_date}}</td>
|
||||
<td>{{image.updated_at|parse_date}}</td>
|
||||
<td>{{image.status|capfirst}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/images/_delete.html" with form=delete_form %}</li>
|
||||
{# <li class="form">{% include "syspanel/images/_toggle.html" with form=toggle_form %}</li> #}
|
||||
|
||||
<li><a href="{% url horizon:syspanel:images:update image.id %}">{% trans "Edit"%}</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="details">
|
||||
<td class="properties" colspan="9">
|
||||
<ul>
|
||||
<li><span>{% trans "Location"%}: </span>{{image.properties.image_location}}</li>
|
||||
<li><span>{% trans "State"%}: </span>{{image.properties.image_state}}</li>
|
||||
<li><span>{% trans "Kernel ID"%}: </span>{{image.properties.kernel_id}}</li>
|
||||
<li><span>{% trans "Ramdisk ID"%}: </span>{{image.properties.ramdisk_id}}</li>
|
||||
<li><span>{% trans "Architecture"%}: </span>{{image.properties.architecture}}</li>
|
||||
<li><span>{% trans "Project ID"%}: </span>{{image.properties.project_id}}</li>
|
||||
<li><span>{% trans "Container Format"%}: </span>{{image.container_format}}</li>
|
||||
<li><span>{% trans "Disk Format"%}: </span>{{image.disk_format}}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -0,0 +1,9 @@
|
||||
{%load i18n%}
|
||||
<form id="form_toggle_{{image.id}}" class="form-toggle" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="image_id" type="hidden" value="{{image.id}}" />
|
||||
<input id="toggle_{{image.id}}" class="toggle" type="submit" value="{% trans "Toggle Public"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="images" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:images:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Images") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
{% include "syspanel/images/_list.html" %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="images" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Update Image") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/images/_form.html' %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can modify different properties of an image."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,54 @@
|
||||
{% load parse_date %}
|
||||
{% load i18n %}
|
||||
<table id="instances" class="wide">
|
||||
<tr>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Tenant"%}</th>
|
||||
<th>{% trans "User"%}</th>
|
||||
<th>{% trans "Host"%}</th>
|
||||
<th>{% trans "Created"%}</th>
|
||||
<th>{% trans "Image"%}</th>
|
||||
<th>{% trans "IPs"%}</th>
|
||||
<th>{% trans "State"%}</th>
|
||||
<th>{% trans "Actions"%}</th>
|
||||
</tr>
|
||||
{% for instance in instances %}
|
||||
<tr id="{{instance.id}}" class="{% cycle "odd" "even" %}">
|
||||
<td><a href="{% url horizon:syspanel:instances:detail instance.id %}">{{instance.name}} <small>(id: {{instance.id}})</small></a></td>
|
||||
<td>{{instance.attrs.tenant_id}}</td>
|
||||
<td>{{instance.attrs.user_id}}</td>
|
||||
<td class="name">{{instance.attrs.host}}</td>
|
||||
<td>{{instance.attrs.launched_at|parse_date}}</td>
|
||||
<td>{{instance.image_name}}</td>
|
||||
|
||||
<td class="ip_list">
|
||||
{% for ip_group, addresses in instance.addresses.items %}
|
||||
{% if instance.addresses.items|length > 1 %}
|
||||
<h4>{{ip_group}}</h4>
|
||||
<ul>
|
||||
{% for address in addresses %}
|
||||
<li>{{address.addr}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for address in addresses %}
|
||||
<li>{{address.addr}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
|
||||
<td>{{instance.status|lower|capfirst}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "horizon/common/instances/_terminate.html" with form=terminate_form %}</li>
|
||||
<li class="form">{% include "horizon/common/instances/_reboot.html" with form=reboot_form %}</li>
|
||||
<li><a target="_blank" href="{% url horizon:nova:instances:console instance.id %}">{% trans "Console Log"%}</a></li>
|
||||
<li><a target="_blank" href="{% url horizon:nova:instances:vnc instance.id %}">{% trans "VNC Console"%}</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -0,0 +1,104 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="instances" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title="Instance Detail: "|add:instance.name %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<ul id="instance_tabs">
|
||||
<li class="active"><a class="overview" href="#">Overview</a></li>
|
||||
<li><a class="log" href="#">Log</a></li>
|
||||
<li><a class="vnc" href="#">VNC</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="dash_block">
|
||||
<div id="overview" class="tab_wrapper">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="status">
|
||||
<h4>Status</h4>
|
||||
<ul>
|
||||
<li><span>Status:</span> {{instance.status}}</li>
|
||||
<li><span>Instance Name:</span> {{instance.name}}</li>
|
||||
<li><span>Instance ID:</span> {{instance.id}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="specs">
|
||||
<h4>Specs</h4>
|
||||
<ul>
|
||||
<li><span>RAM:</span> {{instance.attrs.memory_mb}} MB</li>
|
||||
<li><span>VCPUs:</span> {{instance.attrs.vcpus}} VCPU</li>
|
||||
<li><span>Disk:</span> {{instance.attrs.disk_gb}}GB Disk</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="meta">
|
||||
<h4>Meta</h4>
|
||||
<ul>
|
||||
<li><span>Key name:</span> {{instance.attrs.key_name}}</li>
|
||||
<li><span>Security Group(s):</span> {% for group in instance.attrs.security_groups %}{{group}}, {% endfor %}</li>
|
||||
<li><span>Image Name:</span> {{instance.image_name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="log" class="tab_wrapper">
|
||||
<a class="view_full" target="_blank" href="{% url horizon:nova:instances:console instance.id %}">View Full Log</a>
|
||||
<pre class="logs"></pre>
|
||||
</div>
|
||||
|
||||
<div id="vnc" class="tab_wrapper">
|
||||
<iframe src="{{vnc_url}}" width="720" height="420"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer_js %}
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(function(){
|
||||
$(".dash_block div.tab_wrapper").hide()
|
||||
$(".dash_block div.tab_wrapper:first").show()
|
||||
|
||||
$("#instance_tabs a").click(function(e){
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
$(".dash_block div.tab_wrapper").hide('fast')
|
||||
$(".dash_block div#"+$(this).attr('class')).show('fast')
|
||||
|
||||
$("#instance_tabs li").removeClass('active')
|
||||
$(this).parent().toggleClass('active')
|
||||
})
|
||||
|
||||
$('a.log').click(function(){
|
||||
getlog()
|
||||
})
|
||||
|
||||
setInterval(function(){
|
||||
if ($("a.log").parent().hasClass('active')) {
|
||||
getlog()
|
||||
}
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
function getlog(){
|
||||
$.get("{% url horizon:nova:instances:console instance.id %}?length=25", function(data){
|
||||
$("#log .logs").html(data)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
{% endblock footer_js %}
|
||||
@@ -0,0 +1,66 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="instances" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:instances:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Instances") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
{% if instances %}
|
||||
{% include 'syspanel/instances/_list.html' %}
|
||||
{% else %}
|
||||
<div class="message_box info">
|
||||
{% url horizon:nova:images:index as dash_image_url%}
|
||||
<h2>{% trans "Info"%}</h2>
|
||||
<p>{% blocktrans %}There are currently no instances. You can launch an instance from the <a href='{{dash_image_url}}'>Images Page.</a>{% endblocktrans %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer_js %}
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(function(){
|
||||
function loadInstances(){
|
||||
if ($("#ajax_option_box").is(':checked')) {
|
||||
$('.refresh').addClass("refreshing");
|
||||
$('#instances').load('{% url horizon:syspanel:instances:refresh %}', function(){
|
||||
$('.refresh').removeClass("refreshing");
|
||||
});
|
||||
};
|
||||
}
|
||||
setInterval(function(){
|
||||
loadInstances();
|
||||
}, 15000);
|
||||
|
||||
loadOptionsWidget();
|
||||
|
||||
$("a.refresh").click(function(e){
|
||||
e.preventDefault()
|
||||
loadInstances();
|
||||
})
|
||||
|
||||
function loadOptionsWidget(){
|
||||
checkbox = document.createElement("input");
|
||||
cb = $(checkbox);
|
||||
cb.attr('id', 'ajax_option_box');
|
||||
cb.attr('class', 'refreshOption');
|
||||
cb.attr('type', 'checkbox');
|
||||
checkbox_label = document.createElement("label");
|
||||
cbl = $(checkbox_label);
|
||||
cbl.attr('class', 'refreshOption');
|
||||
cbl.text('auto refresh');
|
||||
cbl.attr('for', 'ajax_option_box');
|
||||
$('.right').append(cb);
|
||||
$('.right').append(cbl);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
{% endblock footer_js %}
|
||||
@@ -0,0 +1,11 @@
|
||||
Usage Report For Period:,{{datetime_start|date:"b. d Y H:i"}},/,{{datetime_end|date:"b. d Y H:i"}}
|
||||
Tenant ID:,{{usage.tenant_id}}
|
||||
Total Active VCPUs:,{{usage.total_active_vcpus}}
|
||||
CPU-HRs Used:,{{usage.total_cpu_usage}}
|
||||
Total Active Ram (MB):,{{usage.total_active_ram_size}}
|
||||
Total Disk Size:,{{usage.total_active_disk_size}}
|
||||
Total Disk Usage:,{{usage.total_disk_usage}}
|
||||
|
||||
ID,Name,UserId,VCPUs,RamMB,DiskGB,Flavor,Usage(Hours),Uptime(Seconds),State
|
||||
{% for instance in usage.instances %}{{instance.id}},{{instance.name|addslashes}},{{instance.user_id|addslashes}},{{instance.vcpus|addslashes}},{{instance.ram_size|addslashes}},{{instance.disk_size|addslashes}},{{instance.flavor|addslashes}},{{instance.hours}},{{instance.uptime}},{{instance.state|capfirst|addslashes}}
|
||||
{% endfor %}
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 48.
|
@@ -0,0 +1,98 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{% load parse_date %}
|
||||
{% load sizeformat %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("System Panel Overview") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<form action="" method="get" id="date_form">
|
||||
<!-- {% csrf_token %} -->
|
||||
<h3> Select a month to query its usage: </h3>
|
||||
<div class="form-row">
|
||||
{{dateform.date}}
|
||||
<input class="submit" type="submit"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="usage">
|
||||
<div class="usage_block">
|
||||
<h3>CPU</h3>
|
||||
<ul>
|
||||
<li><span class="quantity">{{usage.total_active_vcpus}}</span><span class="unit">Cores</span> Active</li>
|
||||
<li><span class="quantity">{{usage.total_cpu_usage|floatformat}}</span><span class="unit">CPU-HR</span> Used</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="usage_block">
|
||||
<h3>RAM</h3>
|
||||
<ul>
|
||||
<li><span class="quantity">{{usage.total_active_ram_size}}</span><span class="unit">MB</span> Active</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="usage_block">
|
||||
<h3>Disk</h3>
|
||||
<ul>
|
||||
<li><span class="quantity">{{usage.total_active_disk_size}}</span><span class="unit">GB</span> Active</li>
|
||||
<li><span class="quantity">{{usage.total_disk_usage|floatformat}}</span><span class="unit">GB-HR</span> Used</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p id="activity" class="tenant">
|
||||
<span><strong>{% trans "Active Instances"%}:</strong> {{usage.total_active_instances}}</span>
|
||||
<span><strong>{% trans "This month's VCPU-Hours"%}:</strong> {{usage.total_cpu_usage|floatformat}}</span>
|
||||
<span><strong>{% trans "This month's GB-Hours"%}:</strong> {{usage.total_disk_usage|floatformat}}</span>
|
||||
</p>
|
||||
|
||||
|
||||
{% if usage.instances %}
|
||||
<div class='table_title wide'>
|
||||
<a class="csv_download_link" href="{{csv_link}}">{% trans "Download CSV"%} »</a>
|
||||
<h3>{% trans "Tenant Usage"%}: {{tenant_id}}</h3>
|
||||
</div>
|
||||
|
||||
<table class="wide">
|
||||
<tr id='headings'>
|
||||
<th>{% trans "ID"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "User"%}</th>
|
||||
<th>{% trans "VCPUs"%}</th>
|
||||
<th>{% trans "Ram Size"%}</th>
|
||||
<th>{% trans "Disk Size"%}</th>
|
||||
<th>{% trans "Flavor"%}</th>
|
||||
<th>{% trans "Uptime"%}</th>
|
||||
<th>{% trans "Status"%}</th>
|
||||
</tr>
|
||||
<tbody class='main'>
|
||||
{% for instance in instances %}
|
||||
{% if instance.ended_at %}
|
||||
<tr class="terminated">
|
||||
{% else %}
|
||||
<tr class="{% cycle 'odd' 'even' %}">
|
||||
{% endif %}
|
||||
<td>{{instance.id}}</td>
|
||||
<td>{{instance.name}}</td>
|
||||
<td>{{instance.user_id}}</td>
|
||||
<td>{{instance.vcpus}}</td>
|
||||
<td>{{instance.ram_size|mbformat}}</td>
|
||||
<td>{{instance.disk_size}}GB</td>
|
||||
<td>{{instance.flavor}}</td>
|
||||
<td>{{instance.uptime_at|timesince}}</td>
|
||||
<td>{{instance.state|capfirst}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
Usage Report For Period:,{{datetime_start|date:"b. d Y H:i"}},/,{{datetime_end|date:"b. d Y H:i"}}
|
||||
Active Instances:,{{global_summary.total_active_instances|default:'-'}}
|
||||
This month's VCPU-Hours:,{{global_summary.total_cpu_usage|floatformat|default:'-'}}
|
||||
This month's GB-Hours:,{{global_summary.total_disk_usage|floatformat|default:'-'}}
|
||||
|
||||
Name,UserId,VCPUs,RamMB,DiskGB,Flavor,Usage(Hours),Uptime(Seconds),State
|
||||
{% for usage in usage_list %}{% for instance in usage.instances %}{{instance.name|addslashes}},{{instance.user_id|addslashes}},{{instance.vcpus|addslashes}},{{instance.ram_size|addslashes}},{{instance.disk_size|addslashes}},{{instance.flavor|addslashes}},{{instance.hours}},{{instance.uptime}},{{instance.state|capfirst|addslashes}}{% endfor %}
|
||||
{% endfor %}
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 48.
|
@@ -0,0 +1,99 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{% load sizeformat %}
|
||||
{%load i18n%}
|
||||
|
||||
{# default landing page for a admin user #}
|
||||
{# nav bar on top, sidebar, overview info in main #}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="overview" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("System Panel Overview") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div id="status_top">
|
||||
{% if external_links %}
|
||||
<div id="monitoring">
|
||||
<h3>{% trans "Monitoring"%}: </h3>
|
||||
<ul id="external_links">
|
||||
{% for link in external_links %}
|
||||
<li><a target="_blank" href="{{ link.1 }}">{{ link.0 }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form action="" method="get" id="date_form">
|
||||
<!-- {% csrf_token %} -->
|
||||
<h3>{% trans "Select a month to query its usage"%}: </h3>
|
||||
<div class="form-row">
|
||||
{{ dateform.date }}
|
||||
<input class="submit" type="submit"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ul class='status_box good'>
|
||||
<li class='status block'><span>Status:</span> Good</li>
|
||||
<li class='block'>
|
||||
<p class='overview'>{{global_summary.total_vcpus}}<span> Cores</span></p>
|
||||
<p class='used'>{{global_summary.total_active_vcpus}}<span class='label'> Used</span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_vcpus}}<span class='label'> Avail</span></p>
|
||||
</li>
|
||||
<li class='block'>
|
||||
<p class='overview'>{{global_summary.total_ram_size_hr|floatformat}}<span> {{global_summary.unit_ram_size}} Ram</span></p>
|
||||
<p class='used'>{{global_summary.total_active_ram_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_ram_size}}</span><span class='label'> Used</span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_ram_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_ram_size}}</span><span class='label'> Avail</span></p>
|
||||
</li>
|
||||
<li class='block last'>
|
||||
<p class='overview'>{{global_summary.total_disk_size_hr|floatformat}}<span> {{global_summary.unit_disk_size}} Disk</span></p>
|
||||
<p class='used'>{{global_summary.total_active_disk_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_disk_size}}</span><span class='label'> Used</span></p>
|
||||
<p class='avail'>{{global_summary.total_avail_disk_size_hr|floatformat}}<span class='unit'> {{global_summary.unit_disk_size}}</span><span class='label'> Avail</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p id="activity">
|
||||
<span><strong>{% trans "Active Instances"%}:</strong> {{global_summary.total_active_instances|default:'-'}}</span>
|
||||
<span><strong>{% trans "This month's VCPU-Hours"%}:</strong> {{global_summary.total_cpu_usage|floatformat|default:'-'}}</span>
|
||||
<span><strong>{% trans "This month's GB-Hours"%}:</strong> {{global_summary.total_disk_usage|floatformat|default:'-'}}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if usage_list %}
|
||||
<div id="usage_table">
|
||||
<div class='table_title wide'>
|
||||
<a class="csv_download_link" href="{{csv_link}}">{% trans "Download CSV"%} »</a>
|
||||
<h3>{% trans "Server Usage Summary"%}</h3>
|
||||
</div>
|
||||
|
||||
<table class="wide">
|
||||
<tr id="headings">
|
||||
<th>{% trans "Tenant"%}</th>
|
||||
<th>{% trans "Instances"%}</th>
|
||||
<th>{% trans "VCPUs"%}</th>
|
||||
<th>{% trans "Disk"%}</th>
|
||||
<th>{% trans "RAM"%}</th>
|
||||
<th>{% trans "VCPU CPU-Hours"%}</th>
|
||||
<th>{% trans "Disk GB-Hours"%}</th>
|
||||
</tr>
|
||||
{% for usage in usage_list %}
|
||||
<tr>
|
||||
<td><a href="{% url horizon:syspanel:instances:tenant_usage usage.tenant_id %}">{{usage.tenant_id}}</a></td>
|
||||
<td>{{usage.total_active_instances}}</td>
|
||||
<td>{{usage.total_active_vcpus}}</td>
|
||||
<td>{{usage.total_active_disk_size|diskgbformat}}</td>
|
||||
<td>{{usage.total_active_ram_size|mbformat}}</td>
|
||||
<td>{{usage.total_cpu_usage|floatformat}}</td>
|
||||
<td>{{usage.total_disk_usage|floatformat}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,29 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="quotas" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:quotas:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Default Quotas") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "Quota Name"%}</th>
|
||||
<th>{% trans "Limit"%}</th>
|
||||
</tr>
|
||||
{% for name,value in quotas.items %}
|
||||
<tr>
|
||||
<td>{{name}}</td>
|
||||
<td>{{value}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,65 @@
|
||||
{%load i18n%}
|
||||
{% load sizeformat %}
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "Service"%}</th>
|
||||
<th>{% trans "System Stats"%}</th>
|
||||
<th>{% trans "Enabled"%}</th>
|
||||
<th>{% trans "Up"%}</th>
|
||||
<th>{% trans "Actions"%}</th>
|
||||
</tr>
|
||||
|
||||
{% for service in services %}
|
||||
<tr class='{{service.up|yesno:"good,bad"}} {{service.disabled|yesno:"medium,"}} {% cycle 'odd' 'even' %}'>
|
||||
<td>
|
||||
{{service.type}} <br/>
|
||||
( {{service.host}} )
|
||||
</td>
|
||||
{% if service.type == 'nova-compute' %}
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
{% trans "Hypervisor"%}: {{service.stats.hypervisor_type}}( {{service.stats.cpu_info.features|join:', '}})
|
||||
</li>
|
||||
<li>
|
||||
{% trans "Allocable Cores"%}:
|
||||
{{service.stats.max_vcpus}}
|
||||
({{service.stats.vcpus_used}} Used, {{service.stats.vcpus}} Physical/Virtual)
|
||||
</li>
|
||||
<li>
|
||||
{% trans "Allocable Storage"%}:
|
||||
{{service.stats.max_gigabytes|diskgbformat}}
|
||||
({{service.stats.local_gb_used|diskgbformat}} Used, {{service.stats.local_gb|diskgbformat}} Physical)
|
||||
</li>
|
||||
<li>
|
||||
{% trans "System Ram"%}:
|
||||
{{service.stats.memory_mb|mbformat}}
|
||||
({{service.stats.memory_mb_used|mbformat}} Used)
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
{% else %}
|
||||
<td> - </td>
|
||||
{% endif %}
|
||||
<td>{{service.disabled|yesno:"Disabled,Enabled"}}</td>
|
||||
<td>{{service.up}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/services/_toggle.html" with form=service_toggle_enabled_form %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for service in other_services %}
|
||||
<tr class='{{service.up|yesno:"good,bad"}} {{service.disabled|yesno:"medium,"}} {% cycle 'odd' 'even' %}'>
|
||||
<td>
|
||||
{{service.type}} <br/>
|
||||
( {{service.host}} )
|
||||
</td>
|
||||
<td> - </td>
|
||||
<td>{{service.disabled|yesno:"Disabled,Enabled"}}</td>
|
||||
<td>{{service.up}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -0,0 +1,22 @@
|
||||
{%load i18n%}
|
||||
{% if service.disabled %}
|
||||
<form id="form_service_enable_{{service.id}}" class="form-service-enable" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="service" type="hidden" value="{{service.id}}" />
|
||||
<input name="name" type="hidden" value="{{service.type}}" />
|
||||
<input id="enable_{{service.id}}" class="enable" title="Service: {{service.type}}" type="submit" value="{% trans "Enable"%}" />
|
||||
</form>
|
||||
{% else %}
|
||||
<form id="form_service_disable_{{service.id}}" class="form-service-disable" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="service" type="hidden" value="{{service.id}}" />
|
||||
<input name="name" type="hidden" value="{{service.type}}" />
|
||||
<input id="disable_{{service.id}}" class="disable" title="Service: {{service.type}}" type="submit" value="{% trans "Disable"%}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="services" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:services:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Services") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
{% include "syspanel/services/_list.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{%load i18n%}
|
||||
<form id="form_add_tenant_user{{user}}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="user" type="hidden" value="{{user.id}}" />
|
||||
<input name="tenant" type="hidden" value="{{tenant_id}}" />
|
||||
<input id="add_tenant_user_{{user.id}}" class="add" title="User: {{user.id}}" type="submit" value="{% trans "Add"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends "syspanel/tenants/_form.html" %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Create Tenant"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{%load i18n%}
|
||||
<form id="form_tenant_delete{{tenant.id}}" class="form-tenant-delete" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="tenant_id" type="hidden" value="{{tenant.id}}" />
|
||||
<input id="delete_{{tenant.id}}" class="delete" title="Tenant: {{tenant.id}}" type="submit" value="{% trans "Delete" %}" />
|
||||
</form>
|
||||
@@ -0,0 +1,11 @@
|
||||
<form id="tenant_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 %}
|
||||
{% block submit %}
|
||||
{% endblock %}
|
||||
</form>
|
||||
@@ -0,0 +1,26 @@
|
||||
{%load i18n%}
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "Id"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Description"%}</th>
|
||||
<th>{% trans "Enabled"%}</th>
|
||||
<th>{% trans "Options"%}</th>
|
||||
</tr>
|
||||
{% for tenant in tenants %}
|
||||
<tr class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{tenant.id}}</td>
|
||||
<td>{{tenant.name}}</td>
|
||||
<td>{{tenant.description}}</td>
|
||||
<td>{{tenant.enabled}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/tenants/_delete.html" with form=tenant_delete_form %}</li>
|
||||
<li><a href="{% url horizon:syspanel:tenants:update tenant.id %}">{% trans "Edit"%}</a></li>
|
||||
<li><a href="{% url horizon:syspanel:tenants:users tenant.id %}">{% trans "View Members"%}</a></li>
|
||||
<li><a href="{% url horizon:syspanel:tenants:quotas tenant.id %}">{% trans "Modify Quotas"%}</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
@@ -0,0 +1,12 @@
|
||||
<form id="quotas_form" action="" 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 %}
|
||||
{% block submit %}
|
||||
{% endblock %}
|
||||
</form>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{%load i18n%}
|
||||
<form id="form_remove_tenant_user{{user.id}}" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="user" type="hidden" value="{{user.id}}" />
|
||||
<input name="tenant" type="hidden" value="{{tenant_id}}" />
|
||||
<input id="remove_tenant_user_{{user.id}}" class="remove" ttle="User: {{user.id}}" type="submit" value="{% trans "Remove"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends "syspanel/tenants/_form.html" %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Update Tenant"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends "syspanel/tenants/_quotas_form.html" %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Update Quotas"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Create Tenant") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/tenants/_create_form.html' %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can create a new tenant (aka project) to organize users."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:tenants:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Tenants") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
{% include "syspanel/tenants/_list.html" %}
|
||||
<a id="tenant_create_link" class="action_link large-rounded" href="{% url horizon:syspanel:tenants:create %}">{% trans "Create New Tenant"%}</a>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Update Tenant Quotas") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/tenants/_update_quotas_form.html' with form=form %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can edit quotas (max limits) for the tenant "%}{{ tenant_id }}.</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Update Tenant") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/tenants/_update_form.html' %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can edit a tenant."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="tenants" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
<div id='page_header'>
|
||||
<h2>{% trans "Users for Tenant"%}: <span>{{tenant_id}}</span></h2>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div id="usage">
|
||||
|
||||
{% if users %}
|
||||
<table class="wide">
|
||||
<tr id='headings'>
|
||||
<th>{% trans "ID"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Email"%}</th>
|
||||
<th>{% trans "Actions"%}</th>
|
||||
</tr>
|
||||
<tbody class='main'>
|
||||
{% for user in users %}
|
||||
<tr class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.name}}</td>
|
||||
<td>{{user.email}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/tenants/_remove_user.html" with form=remove_user_form %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="message_box info">
|
||||
<h2>{% trans "Info"%}</h2>
|
||||
<p>T{% trans "here are currently no users for this tenant"%}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if new_users %}
|
||||
<h3>{% trans "Add new users"%}</h3>
|
||||
<table class="wide">
|
||||
<tr id='headings'>
|
||||
<th>{% trans "ID"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Actions"%}</th>
|
||||
</tr>
|
||||
<tbody class='main'>
|
||||
{% for user in new_users %}
|
||||
<tr class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{user.id}}</td>
|
||||
<td>{{user.name}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/tenants/_add_user.html" with form=add_user_form %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "syspanel/users/_form.html" %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Create User"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{%load i18n%}
|
||||
<form id="form_user_delete{{user.id}}" class="form-user-delete" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="user" type="hidden" value="{{user.id}}" />
|
||||
<input id="enable_{{user.id}}" class="delete" title="User: {{user.id}}" type="submit" value="{% trans "Delete"%}" />
|
||||
</form>
|
||||
@@ -0,0 +1,9 @@
|
||||
<form id="form_user_enable_disable{{user.id}}" class="form-enable_disable" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="id" type="hidden" value="{{user.id}}" />
|
||||
<input name="enabled" type="hidden" value="{{ user.enabled|yesno:"disable,enable,None" }}" />
|
||||
<input id="enable_{{user.id}}" class="{{ user.enabled|yesno:"disable,enable,None" }}" title="User: {{user.id}}" type="submit" value="{{ user.enabled|yesno:"Disable,Enable,Error" }}" />
|
||||
</form>
|
||||
@@ -0,0 +1,12 @@
|
||||
<form id="user_form" action="" 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 %}
|
||||
{% block submit %}
|
||||
{% endblock %}
|
||||
</form>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{%load i18n%}
|
||||
{% if user.enabled %}
|
||||
<form id="form_user_disable_{{user.id}}" class="form-user-disable" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="user" type="hidden" value="{{user.id}}" />
|
||||
<input id="disable_{{user.id}}" class="disable" title="User: {{user.id}}" type="submit" value="{% trans "Disable"%}" />
|
||||
</form>
|
||||
{% else %}
|
||||
<form id="form_user_enable_{{user.id}}" class="form-user-enable" method="post">
|
||||
{% csrf_token %}
|
||||
{% for hidden in form.hidden_fields %}
|
||||
{{hidden}}
|
||||
{% endfor %}
|
||||
<input name="user" type="hidden" value="{{user.id}}" />
|
||||
<input id="enable_{{user.id}}" class="enable" title="User: {{user.id}}" type="submit" value="{% trans "Enable"%}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "syspanel/users/_form.html" %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block submit %}
|
||||
<input type="submit" value="{% trans "Update User"%}" class="large-rounded" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="users" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Create User") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/users/_create_form.html' %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can create a new user and assign them to a tenant (aka project)."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="users" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{% url horizon:syspanel:users:index as refresh_link %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Users") refresh_link=refresh_link searchable="true" %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
|
||||
<table class="wide">
|
||||
<tr>
|
||||
<th>{% trans "ID"%}</th>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Email"%}</th>
|
||||
<th>{% trans "Default Tenant"%}</th>
|
||||
<th>{% trans "Options"%}</th>
|
||||
</tr>
|
||||
{% for user in users %}
|
||||
<tr class="{% cycle 'odd' 'even' %}">
|
||||
<td>{{user.id}}{% if not user.enabled %} (disabled){% endif %}</td>
|
||||
<td>{{user.name}}</td>
|
||||
<td>{{user.email}}</td>
|
||||
<td>{{user.tenantId}}</td>
|
||||
<td id="actions">
|
||||
<ul>
|
||||
<li class="form">{% include "syspanel/users/_enable_disable.html" with form=user_enable_disable_form %}</li>
|
||||
<li class="form">{% include "syspanel/users/_delete.html" with form=user_delete_form %}</li>
|
||||
<li><a href="{% url horizon:syspanel:users:update user.id %}">{% trans "Edit"%}</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<a id="user_create_link" class="action_link large-rounded" href="{% url horizon:syspanel:users:create %}">{% trans "Create New User"%}</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends 'syspanel/base.html' %}
|
||||
{%load i18n%}
|
||||
|
||||
{% block sidebar %}
|
||||
{% with current_sidebar="users" %}
|
||||
{{block.super}}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
{# to make searchable false, just remove it from the include statement #}
|
||||
{% include "horizon/common/_page_header.html" with title=_("Update User") %}
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block syspanel_main %}
|
||||
<div class="dash_block">
|
||||
<div class="left">
|
||||
{% include 'syspanel/users/_update_form.html' %}
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h3>{% trans "Description"%}:</h3>
|
||||
<p>{% trans "From here you can edit users by changing their usernames, emails, passwords, and tenants."%}</p>
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user