mirror of https://git.48k.eu/ogcp
Refactor selected clients drawing in commands
Refactor duplicated code as a jinja macro.multi-ogserver
parent
cc008a0e62
commit
42ba24c9f9
|
@ -1,5 +1,6 @@
|
|||
{% extends 'scopes.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -9,11 +10,7 @@
|
|||
{{ _('Delete %(ip_count)d client(s)', ip_count=ip_count) }}
|
||||
</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_client_delete'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'base.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -7,11 +8,7 @@
|
|||
{% set ip_count = ip_list | length %}
|
||||
<h1 class="m-5">Restore partition image to {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_image_restore'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -7,11 +8,7 @@
|
|||
{% set ip_count = ip_list | length %}
|
||||
<h1 class="m-5">Changing boot mode of {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_mode'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -7,11 +8,7 @@
|
|||
{% set ip_count = ip_list | length %}
|
||||
<h1 class="m-5">Changing ogLive of {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_oglive'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -9,11 +10,7 @@
|
|||
{{ _('Power off %(ip_count)d client(s)', ip_count=ip_count) }}
|
||||
</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_poweroff'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -9,11 +10,7 @@
|
|||
{{ _('Reboot %(ip_count)d client(s)', ip_count=ip_count) }}
|
||||
</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_reboot'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'base.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -7,11 +8,7 @@
|
|||
{% set ip_count = ip_list | length %}
|
||||
<h1 class="m-5">Powering on {{ip_count}} {%if ip_count > 1%}computers{% else %}computer{% endif %}</h1>
|
||||
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ macros.cmd_selected_clients(ip_list) }}
|
||||
|
||||
{{ wtf.quick_form(form,
|
||||
action=url_for('action_wol'),
|
||||
|
|
|
@ -52,3 +52,11 @@
|
|||
{% macro selected_clients() -%}
|
||||
<div id="selected-clients" class="d-flex flex-wrap justify-content-center"></div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro cmd_selected_clients(ip_list) -%}
|
||||
<ul class="list-group mx-5 list-group-horizontal-sm">
|
||||
{% for ip in ip_list %}
|
||||
<li class="list-group-item flex-fill list-group-item-info">{{ ip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endmacro %}
|
||||
|
|
Loading…
Reference in New Issue