add ability to set and reset user usage limits

This commit is contained in:
Jordan Rodgers 2017-12-11 17:45:58 -05:00
parent 79fff2e762
commit 05e08fb92d
7 changed files with 248 additions and 13 deletions

View file

@ -38,6 +38,12 @@
Create VM
</a>
</li>
<li>
<a href="/proxstar/limits">
<span class="glyphicon glyphicon-pencil"></span>
Usage Limits
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown navbar-user">

43
templates/limits.html Normal file
View file

@ -0,0 +1,43 @@
{% extends "base.html" %}
{% block body %}
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Usage Limits</h3>
</div>
<div class="panel-body">
<table class="table table-bordered table-striped">
<thead>
<tr role="row">
<th>Username</th>
<th>CPU</th>
<th>Memory</th>
<th>Disk</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
{% for user_limit in user_limits %}
<tr role="row">
<td>{{ user_limit[0] }}</td>
<td>{{ user_limit[1] }}</td>
<td>{{ user_limit[2] }}</td>
<td>{{ user_limit[3] }}</td>
<td>
<button class="btn btn-info edit-limit" data-user="{{ user_limit[0] }}" data-cpu="{{ user_limit[1] }}" data-mem="{{ user_limit[2] }}" data-disk="{{ user_limit[3] }}">EDIT</button>
<button class="btn btn-danger reset-limit" data-user="{{ user_limit[0] }}">RESET</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}