mirror of https://git.48k.eu/ogcp
Add images view
Images view manages all the images stored in the server. Follow up patches adds actions to get and edit image details, and to delete them.multi-ogserver
parent
37a0304575
commit
27ea5016c4
|
@ -0,0 +1,29 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block nav_images %}active{% endblock %}
|
||||
|
||||
{% block container %}
|
||||
<form id="imagesForm">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
</form>
|
||||
{{ super() }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
<ul id="images" class="nav flex-column nav-pills">
|
||||
{% for image in images %}
|
||||
<li id="{{ image["name"] }}_{{ image["id"] }}" class="nav-item">
|
||||
<input class="form-check-input" type="checkbox" form="imagesForm"
|
||||
value="{{ image["id"] }}"
|
||||
{% if image.get("selected", False) %}checked{% endif %}
|
||||
name="{{ image["name"] }}_{{ image["id"] }}" />
|
||||
{{ image["name"] }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block commands %}
|
||||
{% endblock %}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<a class="nav-link" href="{{ url_for('commands') }}">{{ _('Commands') }}</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.endpoint == "images" %}active{% endif %}">
|
||||
<a class="nav-link" href="#">{{ _('Images') }}</a>
|
||||
<a class="nav-link" href="{{ url_for('images') }}">{{ _('Images') }}</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.endpoint == "tasks" %}active{% endif %}">
|
||||
<a class="nav-link" href="#">{{ _('Tasks') }}</a>
|
||||
|
|
|
@ -767,3 +767,10 @@ def action_room_delete():
|
|||
def commands():
|
||||
scopes, clients = get_scopes()
|
||||
return render_template('commands.html', scopes=scopes, clients=clients)
|
||||
|
||||
@app.route('/images/', methods=['GET'])
|
||||
@login_required
|
||||
def images():
|
||||
r = g.server.get('/images')
|
||||
images = r.json()['images']
|
||||
return render_template('images.html', images=images)
|
||||
|
|
Loading…
Reference in New Issue