From ddd46295717bd63bd31eadb506a93a66c45c0b02 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Thu, 20 Jan 2022 11:21:59 +0100 Subject: Adds confirmation page to power off clients This commit adds an extra view to ensure users do not power off clients accidentally. ogcp GET /poweroff returns the confirmation page and POST /poweroff builds and sends the request to ogServer. It also includes Spanish translation of the new strings. --- ogcp/templates/actions/poweroff.html | 25 +++++++++++++++++++++++++ ogcp/templates/commands.html | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ogcp/templates/actions/poweroff.html (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/poweroff.html b/ogcp/templates/actions/poweroff.html new file mode 100644 index 0000000..2ff9440 --- /dev/null +++ b/ogcp/templates/actions/poweroff.html @@ -0,0 +1,25 @@ +{% extends 'commands.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% block content %} + +{% set ip_list = form.ips.data.split(' ') %} +{% set ip_count = ip_list | length %} +

+ {{ _('Power off %(ip_count)d client(s)', ip_count=ip_count) }} +

+ + + +{{ wtf.quick_form(form, + action=url_for('action_poweroff'), + method='post', + button_map={'submit': 'primary'}, + extra_classes="mx-5") }} + +{% endblock %} + diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html index 02fe5c2..b06574a 100644 --- a/ogcp/templates/commands.html +++ b/ogcp/templates/commands.html @@ -19,7 +19,7 @@ + form="scopesForm" formaction="{{ url_for('action_poweroff') }}" formmethod="get">