proxadmin/app/templates/admin/list_recyclebin.html

123 lines
3.5 KiB
HTML
Raw Normal View History

2017-08-01 07:21:22 -04:00
{% extends "base.html" %}
{% block styles %}
{{ super() }}
</style>
{% endblock %}
2017-09-20 20:08:58 -04:00
{% block scripts %}
{{ super() }}
<script>
// Only run what comes next *after* the page has loaded
addEventListener("DOMContentLoaded", function() {
// Grab all of the elements with a class of command
// (which all of the buttons we just created have)
var commandButtons = document.querySelectorAll(".command");
for (var i=0, l=commandButtons.length; i<l; i++) {
var button = commandButtons[i];
// For each button, listen for the "click" event
button.addEventListener("click", function(e) {
// When a click happens, stop the button
// from submitting our form (if we have one)
e.preventDefault();
if (window.confirm("Are you sure?")) {
var clickedButton = e.target;
var command = clickedButton.value;
var vmid = clickedButton.getAttribute('vmid');
// Now we need to send the data to our server
// without reloading the page - this is the domain of
// AJAX (Asynchronous JavaScript And XML)
// We will create a new request object
// and set up a handler for the response
var request = new XMLHttpRequest();
request.onload = function() {
// We could do more interesting things with the response
// or, we could ignore it entirely
//alert(request.responseText);
};
// We point the request at the appropriate command
request.open("GET", "/vmanager/" + command + "/" + vmid, true);
// and then we send it off
request.send();
alert("command " + command + " executed.");
window.location.reload();
}
});
}
}, true);
</script>
{% endblock %}
2017-08-01 07:21:22 -04:00
{% block page_content %}
<div class="row">
{% include "admin/admin_tasks.html" %}
<div class="col-md-12">
<div class="panel panel-info" id="deployments">
<div class="panel-heading">Deployments</div>
<div class="panel-body"><p>
<table class="table table-hover table-striped table-condensed cf">
<thead>
<tr>
<th>Owner</th>
<th>Cube ID</th>
<th>Alias</th>
<th>CPU</th>
<th>Mem</th>
<th>HDD</th>
<th>Last Charged</th>
<th>Days Left</th>
2017-09-20 20:08:58 -04:00
<th></th>
2017-08-01 07:21:22 -04:00
</tr>
</thead>
<tbody>
{% for deploy in deployments %}
2017-10-07 11:39:50 -04:00
{% if deploy.deleted == True %}
2017-09-24 13:24:11 -04:00
<tr class="active">
{% else %}
{% if deploy.enabled == False %}
2017-08-01 07:21:22 -04:00
<tr class="danger">
2017-09-24 13:24:11 -04:00
{% else %}
{% if deploy.warning == True %}
2017-08-01 07:21:22 -04:00
<tr class="warning">
2017-09-24 13:24:11 -04:00
{% else %}
2017-08-01 07:21:22 -04:00
<tr>
2017-09-24 13:24:11 -04:00
{% endif %}
{% endif %}
2017-08-01 07:21:22 -04:00
{% endif %}
<td><a href="{{ url_for('admin.dashboard', user_pid=deploy.user_id) }}">{{ deploy.owner.email }}</a></td>
<td>{{ deploy.machine_id }}</td>
<td>{{ deploy.machine_alias }}</font></td>
<td>{{ deploy.machine_cpu }}</td>
<td>{{ deploy.machine_mem }} MB</td>
<td>{{ deploy.machine_hdd }} GB</td>
2017-09-24 13:24:11 -04:00
{% if deploy.date_last_charge == None %}
<td>Never</td>
{% else %}
2017-08-01 07:21:22 -04:00
<td>{{ moment(deploy.date_last_charge).format('lll') }} ({{ moment(deploy.date_last_charge).fromNow() }})</td>
2017-09-24 13:24:11 -04:00
{% endif %}
2017-08-01 07:21:22 -04:00
<td>{{ deploy.daysleft }}</td>
2017-10-07 11:39:50 -04:00
{% if deploy.deleted == True %}
2017-09-24 13:24:11 -04:00
<td>-deleted-</td>
{% else %}
<td><button class="btn btn-default btn-danger" onclick="location.reload();location.href='/vmanager/vmremove/{{ deploy.machine_id }}'"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button></td>
{% endif %}
2017-08-01 07:21:22 -04:00
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
</div>
</div>
{% endblock %}