summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/scopes.html
blob: 4b9ff281487cdb85c259e5c29b5f267f6a63eb82 (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
{% extends 'base.html' %}

{% macro print_scopes_tree(scopes) -%}

  <ul class="list-group">
    {% for scope in scopes %}
      <li class="list-group-item">
        <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">
    <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="{{ _('Run') }}"
             formaction="{{ url_for('action_wol') }}" formmethod="get">
      <input class="dropdown-item" type="submit" value="{{ _('Poweroff') }}"
             formaction="{{ url_for('action_poweroff') }}" formmethod="post">
      <input class="dropdown-item" type="submit" value="{{ _('Reboot') }}"
             formaction="{{ url_for('action_reboot') }}" formmethod="post">
    </div>
  </div>
</form>

{% endblock %}