summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/actions/setup.html
blob: fafcb87052e9c8da7c83845e7806ef228cd30363 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% extends 'commands.html' %}

{% set sidebar_state = 'disabled' %}
{% set btn_back = true %}

{% block nav_setup %} active{% endblock %}
{% block nav_setup_setup %} active{% endblock %}
{% block content %}

<h2 class="mx-5 subhead-heading">{{_('Partition and Format')}}</h2>

<form method="GET" id="changeDiskForm">
    <input type="hidden" name="ips" value="{{ ips }}"/>
    <input type="hidden" name="selected_client" value="{{ base_client }}"/>
</form>

<form class="form-inline" method="POST" id="setupForm">
    <table class="table">
        <thead class="text-center">
            <tr>
                <th>{{ _('Disk') }}</th>
                <th>{{ _('Partition Table Type') }}</th>
                <th>{{ _('Total Disk Size') }} (MiB)</th>
            </tr>
        </thead>

        <tbody data-target="partitons-fieldset" id="setupTable" class="text-center">
                    <tr>
                        <td>
                            <select form="changeDiskForm" name="disk" onchange="this.form.submit()">
                            {% for disk in disks %}
                                <option {% if disk == selected_disk %}selected{% endif %}
                                        value="{{ disk }}">{{ disk }}</option>
                            {% endfor %}
                            </select>
                        </td>
                        {{ form.hidden_tag() }}
                        <td>{{ form.disk_type(class_="form-control") }}</td>
                        <td>{{ disk_size }}</td>
                    </tr>
        </tbody>
    </table>
    <table class="table">
        <thead class="text-center">
            <tr>
                <th>{{ _('Partition') }}</th>
                <th>{{ _('Type') }}</th>
                <th>{{ _('Filesystem') }}</th>
                <th>{{ _('Size') }} (MiB)</th>
                <th colspan="2"></th>
            </tr>
        </thead>

        <tbody data-target="partitons-fieldset" id="partitionsTable" class="text-center">
                {% for partition in form.partitions %}
                    <tr data-toggle="fieldset-entry">
                        {{ partition.hidden_tag() }}
                        <td>{{ partition.partition.data }}</td>
                        <td>{{ partition.part_type(class_="form-control") }}</td>
                        <td>{{ partition.fs(class_="form-control") }}</td>
                        <td>{{ partition.size(class_="form-control") }}</td>
                        <td>
                            <button class="btn btn-danger" type="button" onclick="RemovePartition(this)">
                                {{ _('Remove') }}
                            </button>
                        </td>
                    </tr>
                {% endfor %}
        </tbody>
    </table>
</form>

<button class="btn btn-primary" data-target="#partitionsTable" onclick="AddPartition(this)">
    {{ _('Add a new partition') }}
</button>

<button class="btn btn-success" form="setupForm">
    {{ _('Accept') }}
</button>

{% endblock %}