~rvb/maas/bug-1384001-redux-2

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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{% extends "maasserver/base.html" %}

{% block nav-active-settings %}active{% endblock %}

{% block title %}Settings{% endblock %}
{% block page-title %}Settings{% endblock %}

{% block head %}
{% endblock %}

{% block content %}
  <div id="settings" class="block">
    <div id="users">
      <h2>Users and Keys</h2>
      <table class="list">
        <thead>
          <tr>
            <th>ID</th>
            <th>Number of nodes in use</th>
            <th>Last seen</th>
            <th>MAAS Admin</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          {% for user_item in user_list %}
          <tr class="user {% cycle 'even' 'odd' %}" id="{{ user_item.username }}">
            <td>
              <a class="user"
                 href="{% url 'accounts-view' user_item.username %}">
                {{ user_item.username }}
              </a>
            </td>
            <td>{{ user_item.node_set.count }}</td>
            <td>{{ user_item.last_login }}</td>
            <td>
              {% if user_item.is_superuser %}
                <img src="{{ STATIC_URL }}img/yes.png" alt="yes" />
              {% endif %}
            </td>
            <td>
              <a href="{% url 'accounts-edit' user_item.username %}"
                 title="Edit user {{ user_item.username }}">
                <img src="{{ STATIC_URL }}img/edit.png" alt="edit" />
              </a>
              {% if user != user_item %}
                <a title="Delete user {{ user_item.username }}"
                   class="delete-user"
                   href="{% url 'accounts-del' user_item.username %}">
                  <img src="{{ STATIC_URL }}img/delete.png" alt="delete" />
                </a>
                <form method="POST"
                      action="{% url 'accounts-del' user_item.username %}">
                  <input type="hidden" name="username"
                         value="{{ user_item.username }}" />
                </form>
              {% endif %}
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
      <a class="button right" href="{% url 'accounts-add' %}">
        Add user
      </a>
      <div class="clear"></div>
    </div>
    <div id="commissioning" class="block size7 first">
      <h2>Commissioning</h2>
      <form action="{% url "settings" %}" method="post">
        <ul>
        {% for field in commissioning_form %}
          {% include "maasserver/form_field.html" %}
        {% endfor %}
        </ul>
        <input type="hidden" name="commissioning_submit" value="1" />
        <input type="submit" class="button right" value="Save" />
      </form>
    </div>
    <div id="ubuntu" class="block size7 first">
      <h2>Ubuntu</h2>
      <form action="{% url "settings" %}" method="post">
        <ul>
        {% with field=ubuntu_form.update_from %}
          {% include "maasserver/form_field.html" %}
        {% endwith %}
        <li>
          <label>Custom archives</label>
          <a href="{% url "settings-add-archive" %}">
            <img src="{{ STATIC_URL }}img/inline_add.png" 
                 alt="Add" class="icon" />
            Add archive for newly provisioned machines
          </a>
        </li>
        {% with field=ubuntu_form.fallback_master_archive %}
          {% include "maasserver/form_field.html" %}
        {% endwith %}
        {% with field=ubuntu_form.keep_mirror_list_uptodate %}
          {% include "maasserver/form_field.html" %}
        {% endwith %}
        {% with field=ubuntu_form.fetch_new_releases %}
          {% include "maasserver/form_field.html" %}
        {% endwith %}
        </ul>
        <input type="hidden" name="ubuntu_submit" value="1" />
        <input type="submit" class="button right" value="Save" />
      </form>
    </div>
    <div id="maas_and_network" class="block size7 first">
      <h2>Network Configuration</h2>
      <form action="{% url "settings" %}" method="post">
        <ul>
        {% for field in maas_and_network_form %}
          {% include "maasserver/form_field.html" %}
        {% endfor %}
        </ul>
        <input type="hidden" name="maas_and_network_submit" value="1" />
        <input type="submit" class="button right" value="Save" />
      </form>
    </div>
  </div>
{% endblock %}