summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/actions/select_client.html
blob: 92c6ecbd0a6371df969b0a779e07aa36cbb575ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% 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 nav_setup_setup %} active{% endblock %}
{% block content %}

{% set ip_list = form.ips.data.split(' ') %}
{% set ip_count = ip_list | length %}
<h2 class="mx-5 subhead-heading">
  {{ _('Partitioning %(ip_count)d client(s)', ip_count=ip_count) }}
</h2>

{{ macros.cmd_selected_clients(selected_clients) }}

{% if common_disk_data|length > 0 %}

<div class="form-group mx-5">
  <label class="control-label">{{ _('Disk inventory') }}</label>
  <table class="table table-bordered">
      <thead class="thead-light">
          <tr>
              <th>{{ _('Disk') }}</th>
              <th>{{ _('Size (MiB)') }}</th>
              <th>{{ _('Clients') }}</th>
          </tr>
      </thead>
      <tbody>
          {% for disk, data in common_disk_data.items() %}
            {% for size, ips in data.inventory.items() %}
              <tr>
                {% if loop.first %}
                  <td rowspan="{{ data.inventory | length }}">{{ disk }}</td>
                {% endif %}
                <td>
                  {% if size == data.common_size %}
                      <strong>{{ size // 1024 }}</strong>
                  {% else %}
                      {{ size // 1024 }}
                  {% endif %}
                </td>
                <td>
                  {% for ip in ips %}<div class="card d-inline-block" style="padding: 5px; margin: 3px;">{{ ip }}</div>{% endfor %}
                </td>
              </tr>
            {% endfor %}

          {% endfor %}
      </tbody>
  </table>
  <p>{{ _('Note: the disk size in bold represents the selected common size for partitioning') }}</p>
</div>

{% endif %}

{{ wtf.quick_form(form,
                  action=url_for('action_setup_show'),
                  method='get',
                  button_map={'restore': 'primary'},
                  extra_classes='m-5') }}

{% endblock %}