Files
powerfulcomputermanager/admin/templates/adminindex.tmpl
2020-07-16 09:51:00 +02:00

102 lines
3.9 KiB
Cheetah

{# -*- coding: utf-8 -*- #}
{% extends 'baseadmin.tmpl' %}
{% block content %}
<!-- Modal Add Computer To Database -->
<div class="modal fade" id="modalAdd" tabindex="-1" role="dialog" aria-labelledby="modalAddLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<form method="get" action="/admin/addcomputer">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalAddLabel">Add computer to Database</h5>
</div>
<div class="modal-body">
<div class="form-group">
<p>Add computer to database<br>
<label for="computeradd" class="col-form-label">Computer:</label>
<input name="computeradd" id="computeradd" type="text"/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Delete Computer From Database -->
<div class="modal fade" id="modalDel" tabindex="-1" role="dialog" aria-labelledby="modalDelLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<form method="get" action="/admin/delcomputer">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalDelLabel">Delete computer from Database. NOT REVERSIBLE</h5>
</div>
<div class="modal-body">
<div class="form-group">
<p>Delete computer from database. NOT REVERSIBLE<br>
<label for="computerdel" class="col-form-label">Computer:</label>
<select class="form-control" name="computerdel" id="computerdel">
{% for item in tablecomputers %} {#['ID_C','Name',.....]#}
<option value="{{item.0}}">{{item.1}}</option>
{% endfor %}
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger">DELETE</button>
</div>
</div>
</form>
</div>
</div>
<h2>Computers</h2>
<div class="table-responsive">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>#</th>
<th>Computer</th>
<th>Operating System</th>
<th>Groups</th>
<th>CPU</th>
<th>RAM (RAMUsed/RAM) Mb</th>
<th>HDD</th>
<th>Last ping</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="8"><a class="btn btn-outline-success btn-sm" data-toggle="modal" data-target="#modalAdd">Add computer to database</a></td>
</tr>
{% for item in tablecomputers %} {#['ID_C','Name','RAM','CPUName','SOVersion','SOCaption','HDD','LastConnection','RamFree','GroupsNames']#}
<tr>
<td>{{item.0}}</td>
<td><a href="/admin/computer?ID_C={{item.0}}">{{item.1}}</a></td>
<td>{{item.5}} {{item.4}}</td>
<td width='200px'>
{% for x in item.9 %}
<a href="/admin/group?ID_G={{x.0}}">{{x.1}}</a>,
{% endfor %}
</td>
<td>{{item.3}}</td>
<td>{{item.2|int - item.8|int}}/{{item.2}}</td>
<td>
{% for x in item.6 %}
{{x.Volume}}({{x.UsedSpace}}/{{x.Capacity}} GB)<br>
{% endfor %}
</td>
<td>{{item.7}}</td>
</tr>
{% endfor %}
<tr>
<td colspan="8"><a class="btn btn-outline-danger btn-sm" data-toggle="modal" data-target="#modalDel">Delete computer to database</a></td>
</tr>
</tbody>
</table>
</div>
{% endblock %}