2015-03-06 13:06:29 +00:00
|
|
|
{% load i18n %}
|
2023-08-09 06:20:18 +00:00
|
|
|
{% load bootstrap_icons %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<a href="#AddInstance" type="button" class="btn btn-success btn-header float-end" data-bs-toggle="modal">
|
2023-08-09 06:20:18 +00:00
|
|
|
<span aria-hidden="true">{% bs_icon 'plus'%} </span>
|
2020-07-13 09:33:09 +00:00
|
|
|
</a>
|
2015-03-06 13:06:29 +00:00
|
|
|
|
2020-07-13 09:33:09 +00:00
|
|
|
<!-- Modal pool -->
|
2021-08-25 08:05:46 +00:00
|
|
|
<div class="modal fade" id="AddInstance" tabindex="-1" role="dialog" aria-labelledby="AddInstanceModal" aria-hidden="true">
|
2023-05-10 10:59:13 +00:00
|
|
|
<div class="modal-dialog modal-dialog-scrollable modal-lg">
|
2020-07-13 09:33:09 +00:00
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h5 class="modal-title">{% trans "Choose a compute for new instance" %}</h5>
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
2020-07-13 09:33:09 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2023-05-12 08:18:17 +00:00
|
|
|
<form method="post" aria-label="Select compute for instance create form">{% csrf_token %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2023-05-11 14:32:42 +00:00
|
|
|
<table class="table">
|
2023-05-10 10:59:13 +00:00
|
|
|
<thead>
|
|
|
|
<tr style="cursor:default;pointer-events:none">
|
|
|
|
<th>{% trans "Name" %}</th>
|
|
|
|
<th>{% trans "VCPU" %}
|
2023-05-12 08:18:17 +00:00
|
|
|
<th>{% trans "CPU Usage" %}</th>
|
2023-05-10 10:59:13 +00:00
|
|
|
<th>{% trans "Memory" %}</th>
|
|
|
|
<th>{% trans "Mem Usage" %}</th>
|
2023-05-11 14:32:42 +00:00
|
|
|
<th>{% trans "Action" %}</th>
|
2023-05-10 10:59:13 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-07-13 09:33:09 +00:00
|
|
|
{% for compute in computes %}
|
2023-05-10 10:59:13 +00:00
|
|
|
{% if compute.status is True %}
|
2023-08-09 06:20:18 +00:00
|
|
|
<tr style="text-decoration: none">
|
2023-05-10 10:59:13 +00:00
|
|
|
<td>{{ compute.name }}</td>
|
|
|
|
<td>{{ compute.cpu_count }}</td>
|
|
|
|
<td>
|
|
|
|
<div class="progress">
|
2023-05-12 08:18:17 +00:00
|
|
|
<div class="progress-bar bg-primary" role="progressbar" style="width: {{ compute.cpu_usage }}%"
|
2023-05-10 10:59:13 +00:00
|
|
|
aria-valuenow="{{ compute.cpu_usage }}" aria-valuemin="0" aria-valuemax="100">{{ compute.cpu_usage }}%
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>{{ compute.ram_size|filesizeformat }}</td>
|
|
|
|
<td>
|
|
|
|
<div class="progress">
|
2023-05-12 08:18:17 +00:00
|
|
|
<div class="progress-bar bg-primary" role="progressbar" style="width: {{ compute.ram_usage }}%"
|
2023-05-10 10:59:13 +00:00
|
|
|
aria-valuenow="{{ compute.ram_usage }}" aria-valuemin="0" aria-valuemax="100">{{ compute.ram_usage }}%
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
2023-05-11 14:32:42 +00:00
|
|
|
<td class="col-1">
|
|
|
|
<button class="btn btn-success btn-sm" type="button" onclick="goto_compute('{{ compute.id }}');">
|
|
|
|
{% trans "Choose" %}
|
|
|
|
</button>
|
|
|
|
</td>
|
2023-05-10 10:59:13 +00:00
|
|
|
</tr>
|
|
|
|
{% endif %}
|
2020-07-13 09:33:09 +00:00
|
|
|
{% endfor %}
|
2023-05-10 10:59:13 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-07-13 09:33:09 +00:00
|
|
|
</div>
|
2023-05-10 10:59:13 +00:00
|
|
|
</form>
|
2020-07-13 09:33:09 +00:00
|
|
|
</div>
|
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|