/
device_addresses.html
239 lines (231 loc) · 9.93 KB
/
device_addresses.html
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
{% extends "ui/base-devices.html" %}
{% load url from future %}
{% load icons %}
{% load bob %}
{% block content %}
<div class="row-fluid">
<div class="span6">
<h3>DNS Records</h3>
<form class="form form-inline" action="" method="POST">
{% csrf_token %}
{{ dnsformset.management_form }}
<table class="table table-striped table-bordered details-dns table-condensed">
<thead><tr>
<th width="16"></th>
<th width="30%">Name</th>
<th width="72">Type</th>
<th width="*">Content</th>
<th width="16">PTR</th>
<th width="16">Del</th>
</tr></thead>
<tbody>
{% for form in dnsformset %}
<tr>
<td style="vertical-align:middle">
{% if form.instance.content %}
{% icon 'fugue-price-tag' %}
{% else %}
{% icon 'fugue-price-tag--plus' %}
{% endif %}
{% for f in form.hidden_fields %}{{ f }}{% endfor %}
</td>
{% for f in form.visible_fields %}
<td class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}" style="vertical-align:middle">
{% if form.instance.content or not 'DELETE' in f.name %}
{% if canedit %}
{{ f }}
{% else %}
{{ f.value|default:'' }}
{% endif %}
{% for e in f.errors %}
<div class="help-block">{{ e }}</div>
{% endfor %}
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% if canedit %}
<div class="buttons pull-right">
{% spaceless %}
<button type="submit" name="dns" value="Save" class="btn btn-primary"
>{% icon 'fugue-tick' %} Save</button>
{% endspaceless %}
</div>
{% endif %}
</form>
<h3>DHCP Entries</h3>
<form class="form form-inline" action="" method="POST">
{% csrf_token %}
{{ dhcpformset.management_form }}
<table class="table table-striped table-bordered table-condensed details-dhcp">
<thead><tr>
<th width="16"></th>
<th>IP Address</th>
<th>MAC Address</th>
<th width="16">Del</th>
</tr></thead>
<tbody>
{% for form in dhcpformset %}
<tr>
<td style="vertical-align:middle">
{% icon 'fugue-network-ethernet' %}
{% for f in form.hidden_fields %}{{ f }}{% endfor %}
</td>
{% for f in form.visible_fields %}
<td class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}" style="vertical-align:middle">
{% if form.instance.ip or not 'DELETE' in f.name %}
{% if canedit %}
{{ f }}
{% else %}
{{ f.value|default:'' }}
{% endif %}
{% for e in f.errors %}
<div class="help-block">{{ e }}</div>
{% empty %}
{% if f.help_text %}
<div class="help-block">{{ f.help_text }}</div>
{% endif %}
{% endfor %}
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% if canedit %}
<div class="buttons pull-right">
{% spaceless %}
<button type="submit" name="dhcp" value="Save" class="btn btn-primary"
>{% icon 'fugue-tick' %} Save</button>
{% endspaceless %}
</div>
{% endif %}
</form>
</div>
<div class="span6">
<h3>Management address</h3>
<form class="form form-inline" action="" method="POST">
{% csrf_token %}
{{ ip_management_form }}
{% if canedit %}
<div class="buttons pull-right">
{% spaceless %}
<button type="submit" name="management" value="Save" class="btn btn-primary"
>{% icon 'fugue-tick' %} Save</button>
{% endspaceless %}
</div>
{% endif %}
</form>
<h3>Detected addresses</h3>
<form class="form form-inline" action="" method="POST">
{% csrf_token %}
{{ ipformset.management_form }}
<table class="table table-striped table-bordered table-condensed details-address">
<thead><tr>
<th width="16"></th>
<th width="35%">Hostname</th>
<th width="35%">Address</th>
<th width="*">Last Ping</th>
<th width="16">Del</th>
</tr></thead>
<tbody>
{% for form in ipformset %}
<tr>
<td style="vertical-align:middle">
{% if form.instance.address %}
{{ form.instance|address_icon }}
{% else %}
{% icon 'fugue-plus' %}
{% endif %}
{% for f in form.hidden_fields %}{{ f }}{% endfor %}
</td>
{% for f in form.visible_fields %}
{% if 'DELETE' in f.name %}
<td>{{ form.instance.last_seen|timesince_limited }}</td>
{% endif %}
<td class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}" style="vertical-align:middle">
{% if form.instance.address or not 'DELETE' in f.name %}
{% if canedit %}
{{ f }}
{% else %}
{{ f.value|default:'' }}
{% endif %}
{% for e in f.errors %}
<div class="help-block">{{ e }}</div>
{% empty %}
{% endfor %}
{% endif %}
{% if 'address' in f.name %}
<div class="error-text">
{{ form.non_field_errors }}
</div>
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<div class="action-list">
{% if next_hostname %}
<div class="alert alert-info">Next available hostname in this DC: {{ next_hostname }}</div>
{% endif %}
{% for item in first_free_ip_addresses %}
<div class="alert alert-info">First free IP for network {{ item.network_name }}: {{ item.first_free_ip }}</div>
{% endfor %}
</div>
{% if canedit %}
<div class="buttons pull-right">
{% spaceless %}
<button type="submit" name="ip" value="Save" class="btn btn-primary"
>{% icon 'fugue-tick' %} Save</button>
{% endspaceless %}
</div>
{% endif %}
</form>
{% if balancers %}
<h3>Load balancers</h3>
<table class="table table-striped table-bordered details-balancers">
<thead><tr>
<th width="16"></th>
<th>Load Balancer</th>
<th>Pool</th>
<th>IP Address</th>
<th>Port</th>
</tr></thead>
<tbody>
{% for item in balancers %}
<tr>
<td>
{% if item.server %}
{% icon 'fugue-balance' %}
{% else %}
{% if item.enabled %}
{% icon 'fugue-tick-circle' %}
{% else %}
{% icon 'fugue-cross-circle' %}
{% endif %}
{% endif %}
</td>
<td>
{% if item.server %}
{{ item.server }}
{% else %}
{{ item.balancer }}
{% endif %}
</td>
<td>{{ item.pool }}</td>
<td>{{ item.address }}</td>
<td>{{ item.port }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
{% endblock content %}