dash-stack/dash/templates/server/list_servers.html

96 lines
2.8 KiB
HTML

{% extends "adminlte/base.html" %}
{% import "adminlte/layout.html" as layout with context %}
{% import "adminlte/widgets.html" as widgets with context %}
{% block title %}Server - {{ title }}{% endblock %}
{% block description %}{{ block_description }}{% endblock %}
{% block navbar %}
{% include "navbar.html" %}
{%- endblock navbar %}
{% block sidebar -%}
{% include 'sidebar.html' %}
{% include 'sidebar_menu.html' %}
{%- endblock sidebar %}
{% block content_header -%}
{% include 'server/content_header.html' %}
{%- endblock content_header %}
{% block content -%}
<!-- Main content -->
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Server Name</th>
<th>IP</th>
<th>Status</th>
<th>Task</th>
<th>Power</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for server in servers %}
<tr>
<td>{{ server.name }}</td>
<td>
{% for ips in server.networks['private'] %}
{{ ips }} |
{% endfor %}
</td>
<td>{{ server.status }}</td>
<td>{{ server|attr('OS-EXT-STS:task_state') }}</td>
<td>
{{ server|attr('OS-EXT-STS:power_state') }}
{% if server|attr('OS-EXT-STS:power_state') == 1 %}
Running
{% elif server|attr('OS-EXT-STS:power_state') == 2 %}
Shutoff
{% elif server|attr('OS-EXT-STS:power_state') == 3 %}
Paused
{% elif server|attr('OS-EXT-STS:power_state') == 4 %}
Shut Down
{% endif %}
</td>
<td>
<a href="{{ url_for('admin.edit_user_admin', id=user.id) }}">Edit</a>
|
<a href="{{ url_for('admin.delete_user_admin', id=user.id) }}">Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>Server Name</th>
<th>IP</th>
<th>Status</th>
<th>Task</th>
<th>Power</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
{%- endblock content %}