1
0
Fork 0
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:
Jan Krcmar 2016-04-28 12:50:11 +02:00
parent 380cc2d09b
commit e45c712d67
2 changed files with 15 additions and 1 deletions

View file

@ -529,6 +529,11 @@
{% trans "Options" %} {% trans "Options" %}
</a> </a>
</li> </li>
<li role="presentation">
<a href="#users" aria-controls="users" role="tab" data-toggle="tab">
{% trans "Users" %}
</a>
</li>
{% endif %} {% endif %}
</ul> </ul>
<!-- Tab panes --> <!-- Tab panes -->
@ -877,6 +882,13 @@
</form> </form>
<div class="clearfix"></div> <div class="clearfix"></div>
</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 %} {% endif %}
</div> </div>
</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'); var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () { $(btnsect).each(function () {
if ($(this).attr('href') === '#settings') { if ($(this).attr('href') === '#settings') {

View file

@ -302,6 +302,8 @@ def instance(request, compute_id, vname):
instance = Instance(compute_id=compute_id, name=vname, uuid=uuid) instance = Instance(compute_id=compute_id, name=vname, uuid=uuid)
instance.save() instance.save()
userinstances = UserInstance.objects.filter(instance=instance).order_by('user__username')
if request.method == 'POST': if request.method == 'POST':
if 'poweron' in request.POST: if 'poweron' in request.POST:
conn.start() conn.start()