mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
add instance/options/users tab. lists all owners of the instance
This commit is contained in:
parent
380cc2d09b
commit
e45c712d67
2 changed files with 15 additions and 1 deletions
|
@ -529,6 +529,11 @@
|
|||
{% trans "Options" %}
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#users" aria-controls="users" role="tab" data-toggle="tab">
|
||||
{% trans "Users" %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<!-- Tab panes -->
|
||||
|
@ -877,6 +882,13 @@
|
|||
</form>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="users">
|
||||
<p style="font-weight:bold;">{% trans "Instance owners" %}</p>
|
||||
{% for userinstance in userinstances %}
|
||||
<p><a href="{% url 'account' userinstance.user.id %}">{{ userinstance.user }}</a></p>
|
||||
{% endfor %}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1272,7 +1284,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
if (~$.inArray(hash, ['#media', '#network', '#clone', '#autostart', '#xmledit', '#vncsettings', '#migrate', '#options'])) {
|
||||
if (~$.inArray(hash, ['#media', '#network', '#clone', '#autostart', '#xmledit', '#vncsettings', '#migrate', '#options', '#users'])) {
|
||||
var btnsect = $('#navbtn>li>a');
|
||||
$(btnsect).each(function () {
|
||||
if ($(this).attr('href') === '#settings') {
|
||||
|
|
|
@ -302,6 +302,8 @@ def instance(request, compute_id, vname):
|
|||
instance = Instance(compute_id=compute_id, name=vname, uuid=uuid)
|
||||
instance.save()
|
||||
|
||||
userinstances = UserInstance.objects.filter(instance=instance).order_by('user__username')
|
||||
|
||||
if request.method == 'POST':
|
||||
if 'poweron' in request.POST:
|
||||
conn.start()
|
||||
|
|
Loading…
Reference in a new issue