2015-03-02 08:52:07 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% load i18n %}
|
2015-03-05 09:55:15 +00:00
|
|
|
{% block title %}{% trans "User" %} - {{ user }}{% endblock %}
|
2015-03-02 08:52:07 +00:00
|
|
|
{% block content %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<!-- Page Heading -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
{% include 'create_user_inst_block.html' %}
|
2020-05-19 16:53:54 +00:00
|
|
|
<h2 class="page-header">{{ user }}</h2>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
2015-03-02 08:52:07 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
{% include 'errors_block.html' %}
|
|
|
|
|
|
|
|
{% if request.user.is_superuser and publickeys %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-bordered table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{% trans "Key name" %}</th>
|
|
|
|
<th>{% trans "Public key" %}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for publickey in publickeys %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ publickey.keyname }}</td>
|
|
|
|
<td title="{{ publickey.keypublic }}">{{ publickey.keypublic|truncatechars:64 }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-03-02 08:52:07 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
{% if not user_insts %}
|
2017-11-15 11:55:05 +00:00
|
|
|
<div class="col-lg-12">
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="alert alert-warning alert-dismissable">
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
2020-05-19 16:53:54 +00:00
|
|
|
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning" %}:</strong> {% trans "User doesn't have any Instance" %}
|
2017-11-15 11:55:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
{% else %}
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-bordered table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>#</th>
|
|
|
|
<th>{% trans "Instance" %}</th>
|
|
|
|
<th>{% trans "VNC" %}</th>
|
|
|
|
<th>{% trans "Resize" %}</th>
|
|
|
|
<th>{% trans "Delete" %}</th>
|
|
|
|
<th colspan="2">{% trans "Action" %}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for inst in user_insts %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ forloop.counter }}</td>
|
|
|
|
<td><a href="{% url 'instance' inst.instance.compute.id inst.instance.name %}">{{ inst.instance.name }}</a></td>
|
|
|
|
<td>{{ inst.is_vnc }}</td>
|
|
|
|
<td>{{ inst.is_change }}</td>
|
|
|
|
<td>{{ inst.is_delete }}</td>
|
|
|
|
<td style="width:5px;">
|
2020-05-19 16:53:54 +00:00
|
|
|
<a href="#editPriv{{ forloop.counter }}" type="button" class="btn btn-sm btn-secondary" data-toggle="modal">
|
|
|
|
<span class="fa fa-pencil" aria-hidden="true"></span>
|
2019-07-31 08:03:48 +00:00
|
|
|
</a>
|
2015-03-10 14:24:10 +00:00
|
|
|
|
2019-07-31 08:03:48 +00:00
|
|
|
<!-- Modal pool -->
|
|
|
|
<div class="modal fade" id="editPriv{{ forloop.counter }}" tabindex="-1" role="dialog" aria-labelledby="editPrivLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2020-05-19 16:53:54 +00:00
|
|
|
<h5 class="modal-title">{% trans "Edit privilegies for" %} {{ inst.instance.name }}</h5>
|
2019-07-31 08:03:48 +00:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2020-05-19 16:53:54 +00:00
|
|
|
<form method="post" action="" role="form">{% csrf_token %}
|
2019-07-31 08:03:48 +00:00
|
|
|
<input type="hidden" name="user_inst" value="{{ inst.id }}">
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label class="col-sm-4 col-form-label">{% trans "VNC" %}</label>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="col-sm-6">
|
2020-03-16 13:59:45 +00:00
|
|
|
<select class="form-control" name="inst_vnc">
|
|
|
|
<option value="">{% trans 'False' %}</option>
|
2019-07-31 08:03:48 +00:00
|
|
|
<option value="1" {% if inst.is_vnc %}selected{% endif %}>True</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-03-10 14:24:10 +00:00
|
|
|
</div>
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label class="col-sm-4 col-form-label">{% trans "Resize" %}</label>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="col-sm-6">
|
2020-03-16 13:59:45 +00:00
|
|
|
<select class="form-control" name="inst_change">
|
|
|
|
<option value="">{% trans 'False' %}</option>
|
2019-07-31 08:03:48 +00:00
|
|
|
<option value="1" {% if inst.is_change %}selected{% endif %}>True</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-03-10 14:24:10 +00:00
|
|
|
</div>
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label class="col-sm-4 col-form-label">{% trans "Delete" %}</label>
|
2019-07-31 08:03:48 +00:00
|
|
|
<div class="col-sm-6">
|
2020-03-16 13:59:45 +00:00
|
|
|
<select class="form-control" name="inst_delete">
|
|
|
|
<option value="">{% trans 'False' %}</option>
|
2019-07-31 08:03:48 +00:00
|
|
|
<option value="1" {% if inst.is_delete %}selected{% endif %}>True</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-03-10 14:24:10 +00:00
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-05-19 16:53:54 +00:00
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button>
|
2019-07-31 08:03:48 +00:00
|
|
|
<button type="submit" class="btn btn-primary" name="permission">{% trans "Edit" %}</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|
|
|
|
</td>
|
|
|
|
<td style="width:5px;">
|
|
|
|
<form action="" method="post" role="form">{% csrf_token %}
|
|
|
|
<input type="hidden" name="user_inst" value="{{ inst.id }}">
|
2020-05-19 16:53:54 +00:00
|
|
|
<button type="submit" class="btn btn-sm btn-secondary" name="delete" title="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
|
|
|
<span class="fa fa-trash" aria-hidden="true"></span>
|
2019-07-31 08:03:48 +00:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2015-03-10 14:24:10 +00:00
|
|
|
</div>
|
2019-07-31 08:03:48 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-11-15 11:55:05 +00:00
|
|
|
{% endblock %}
|