From 6b33268b5c03db29cb003acb4e2042c9254402d2 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 10 Sep 2024 13:33:05 +0200 Subject: ogcp: add view to assign repo to clients Add /action/repo/set in Commands to assign a repository to multiple clients. The view includes the actual repo assigned in the client pills and shows a table with the clients grouped by repo when multiple repos are assigned among the selected clients. --- ogcp/templates/actions/repo_set.html | 69 ++++++++++++++++++++++++++++++++++++ ogcp/templates/commands.html | 2 ++ 2 files changed, 71 insertions(+) create mode 100644 ogcp/templates/actions/repo_set.html (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/repo_set.html b/ogcp/templates/actions/repo_set.html new file mode 100644 index 0000000..bdd7abf --- /dev/null +++ b/ogcp/templates/actions/repo_set.html @@ -0,0 +1,69 @@ +{% extends 'commands.html' %} +{% import "bootstrap/wtf.html" as wtf %} +{% import "macros.html" as macros %} + +{% set sidebar_state = 'disabled' %} +{% set btn_back = true %} + +{% block nav_setup %} active{% endblock %} +{% block content %} + +{% set ip_list = form.ips.data.split(' ') %} +{% set ip_count = ip_list | length %} +

+ {{ _('Changing repository of %(ip_count)d computer(s)', ip_count=ip_count) }} +

+ +{{ macros.cmd_selected_clients(selected_clients) }} + +{% if repos_set|length > 1 %} +
+

Selected clients have different ogLive

+ + + + + + + + + + {% for repo, clients in repos_set.items() %} + + + + + {% endfor %} + +
RepositoryClients
{{repo}} + {% for ip in clients %}
{{ ip }}
{% endfor %} +
+
+{% endif %} + +{{ wtf.quick_form(form, + action=url_for('action_repo_set'), + method='post', + button_map={'ok': 'primary'}, + extra_classes="m-5") }} + + + + + + + +{% endblock %} diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html index 48630ea..41a0917 100644 --- a/ogcp/templates/commands.html +++ b/ogcp/templates/commands.html @@ -40,6 +40,8 @@