dodanie listy obrazów i poprawa buga

This commit is contained in:
2023-04-19 14:10:31 +02:00
parent 8d2455724e
commit 26275a0674
7 changed files with 84 additions and 15 deletions

View File

@@ -20,7 +20,10 @@
<a class="nav-link" href="/">Lista maszyn</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/create/conf">Tworzenie obrazu</a>
<a class="nav-link" href="/create">Tworzenie obrazu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/images">Lista obrazów</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/logout">Wyloguj</a>

33
templates/images.html Normal file
View File

@@ -0,0 +1,33 @@
{% extends "base.html" %}
{% block title %}Obrazy{% endblock %}
{% block style %}
{% endblock %}
{% block content %}
<div class="container">
<h1 class="my-4">Lista obrazów</h1>
<table class="table">
<thead>
<tr>
<th>Token</th>
<th>Nazwa</th>
<th>Usuń</th>
</tr>
</thead>
<tbody>
{% for image in images %}
<tr>
<td>{{ image.token }}</td>
<td>{{ image.name }}</td>
<td>
<form method="post" action="/api/delete_image/{{ image.id }}">
<button type="submit" class="btn btn-danger">Usuń</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}