summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/scopes.html
blob: 3cb84fd01755f450cc5ab28ad93ed463d8e1b18a (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
{% extends 'base.html' %}
{% block nav_scopes %}active{% endblock %}

{% macro print_scopes_tree(scopes) -%}

  <ul class="list-group list-group-flush mx-5">
    {% for scope in scopes %}
    <li class="list-group-item state--{{ scope['state'] | lower }}">
        <input class="form-check-input" type="checkbox"
               value="{{ " ".join(scope["ip"]) }}"
               name="{{ scope["name"] }}_{{ scope["id"] }}">
        {{ scope["name"] }}
        {% if "state" in scope %}
          -- STATE: {{ scope["state"] }}
        {% endif %}
        {{ print_scopes_tree(scope["scope"]) }}
      </li>
    {% endfor %}
  </ul>

{% endmacro %}

{% block content %}

<form>
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
  {{ print_scopes_tree(scopes["scope"]) }}

  <div class="dropdown mt-2">
    <button class="btn btn-primary dropdown-toggle" type="button"
            id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
            aria-expanded="false">
    {{ _('Actions') }}
    </button>
    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
      <input class="dropdown-item" type="submit" value="{{ _('Power on (WoL)') }}"
             formaction="{{ url_for('action_wol') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Power off') }}"
             formaction="{{ url_for('action_poweroff') }}" formmethod="post">
      <input class="dropdown-item" type="submit" value="{{ _('Reboot') }}"
             formaction="{{ url_for('action_reboot') }}" formmethod="post">
      <input class="dropdown-item" type="submit" value="{{ _('Refresh') }}"
             formaction="{{ url_for('action_refresh') }}" formmethod="post">
      <input class="dropdown-item" type="submit" value="{{ _('Hardware') }}"
             formaction="{{ url_for('action_hardware') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Software') }}"
             formaction="{{ url_for('action_software') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Start session') }}"
             formaction="{{ url_for('action_session') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Restore Image') }}"
             formaction="{{ url_for('action_image_restore') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Partition & Format') }}"
             formaction="{{ url_for('action_setup_show') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Client details') }}"
             formaction="{{ url_for('action_client_info') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Add client') }}"
             formaction="{{ url_for('action_client_add') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Create image') }}"
             formaction="{{ url_for('action_image_create') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Set boot mode') }}"
             formaction="{{ url_for('action_mode') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Add room') }}"
             formaction="{{ url_for('action_room_add') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Delete room') }}"
             formaction="{{ url_for('action_room_delete') }}" formmethod="get">
    </div>
  </div>
</form>

{% endblock %}