mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-20 09:34:50 +00:00
Reworked some computes views and added more tests
This commit is contained in:
parent
68f7376d15
commit
a4d28f2953
8 changed files with 205 additions and 333 deletions
69
computes/templates/computes/list.html
Normal file
69
computes/templates/computes/list.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load common_tags %}
|
||||
{% load icons %}
|
||||
{% block title %}{% trans "Computes" %}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'create_comp_block.html' %}
|
||||
{% include 'search_block.html' %}
|
||||
<h3 class="page-header">{% trans "Computes" %}</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'errors_block.html' %}
|
||||
<div class="row">
|
||||
{% if not computes %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{% icon 'exclamation-triangle '%} <strong>{% trans "Warning" %}:</strong> {% trans "You don't have any computes" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-lg-12">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th span="col">{% trans "Name" %}</th>
|
||||
<th span="col">{% trans "Status" %}</th>
|
||||
<th span="col">{% trans "Details" %}</th>
|
||||
<th span="col">{% trans "Actions" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
{% for compute in computes %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ compute.name }}
|
||||
</td>
|
||||
<td>
|
||||
{% if compute.status is True %}{% trans "Connected" %}{% else %}{% trans "Not Connected" %}{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ compute.details|default:"" }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="float-right btn-group">
|
||||
{% if compute.status is True %}
|
||||
<a class="btn btn-success" title="{%trans "Overview" %}" href="{% url 'overview' compute.id %}">{% icon 'eye' %}</a>
|
||||
{% else %}
|
||||
<a class="btn btn-light" title="{%trans "Overview" %}">{% icon 'eye' %}</a>
|
||||
{% endif %}
|
||||
<a class="btn btn-primary" title="{%trans "Edit" %}" href="{% url 'compute_update' compute.id %}">{% icon 'pencil' %}</a>
|
||||
<a class="btn btn-danger" title="{%trans "Delete" %}" href="{% url 'compute_delete' compute.id %}">{% icon 'times' %}</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block script %}
|
||||
<script src="{% static "js/filter-table.js" %}"></script>
|
||||
{% endblock script %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue