summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Hostbase/hostbase/webtemplates/edit.html
blob: 961c9d143ed7fc7ccb69e83c176f3aca1d07a861 (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
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
{% extends "base.html" %}

{% block pagebanner %}
  <div class="header">
      <h2>{{ host.hostname }}</h2>
  </div>
  <br/>
{% endblock %}

{% block sidebar %}
{% include "navbar.tmpl" %}
<ul class="sidebar">
<li><a href="/hostbase/{{ host.id }}/" class="sidebar">host info</a></li>
<li><a href="/hostbase/{{ host.id }}/dns/" class="sidebar">detailed dns info</a></li>
<li><a href="/hostbase/{{ host.id }}/dns/edit/" class="sidebar">edit dns info</a></li>
<li><a href="/hostbase/{{ host.id }}/logs/" class="sidebar">change logs</a></li>
</ul>
{% include "logout.tmpl" %}
{% endblock %}

{% block content %}

<script language="JavaScript" type="text/Javascript">
function toggleAddr(interface_id){
   if(document.getElementById){
      var style = document.getElementById('ipaddr'+interface_id).style;
      style.display = style.display? "":"block";
   }
}
function toggleInter(){
   if(document.getElementById){
      var style = document.getElementById('interface').style;
      style.display = style.display? "":"block";
   }
}
</script>

<style type=text/css>
{% for interface in interfaces %}
div#ipaddr{{ interface.0.id }}{
   display: none;
}
{% endfor %}
div#interface{
   display: none;
}
</style>

<form name="hostdata" action="" method="post">
<fieldset class="module aligned ()">
<input type="hidden" name="host" value="{{ host.id }}">
   <label for="id_hostname">hostname:</label>
   <input name="hostname" value="{{ host.hostname }}"><br>
   <label for="id_whatami">whatami:</label>
   <select name="whatami">
   {% for choice in host.WHATAMI_CHOICES %}
       {% ifequal host.whatami choice.0 %}
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
       {% else %}
           <option value="{{ choice.0 }}">{{ choice.1 }}
       {% endifequal %}
   {% endfor %}
   </select><br>
   <label for="id_netgroup">netgroup:</label>
   <select name="netgroup">
   {% for choice in host.NETGROUP_CHOICES %}
       {% ifequal host.netgroup choice.0 %}
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
       {% else %}
           <option value="{{ choice.0 }}">{{ choice.1 }}
       {% endifequal %}
   {% endfor %}
   </select><br>
   <label for="id_security_class">class:</label>
   <select name="security_class">
   {% for choice in host.CLASS_CHOICES %}
       {% ifequal host.security_class choice.0 %}
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
       {% else %}
           <option value="{{ choice.0 }}">{{ choice.1 }}
       {% endifequal %}
   {% endfor %}
   </select><br>
   <label for="id_support">support:</label>
   <select name="support">
   {% for choice in host.SUPPORT_CHOICES %}
       {% ifequal host.support choice.0 %}
           <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
       {% else %}
           <option value="{{ choice.0 }}">{{ choice.1 }}
       {% endifequal %}
   {% endfor %}
   </select><br>
   <label for="id_csi">csi:</label>
   <input name="csi" type="text" value="{{ host.csi }}"><br>
   <label for="id_printq">printq:</label>
   <input name="printq" type="text" value="{{ host.printq }}"><br>
   <label for="id_outbound_smtp">outbound_smtp:</label>
   {% if host.outbound_smtp %}
       <input type="checkbox" checked="checked" name="outbound_smtp">
   {% else %}
       <input type="checkbox" name="outbound_smtp">
   {% endif %}<br>
   <label for="id_primary_user">primary_user:</label>
   <input name="primary_user" type="text" size="32" value="{{ host.primary_user }}"><br>
   <label for="id_administrator">administrator:</label>
   <input name="administrator" type="text" size="32" value="{{ host.administrator }}"><br>
   <label for="id_location">location:</label>
   <input name="location" type="text" value="{{ host.location }}"><br>
   <label for="id_expiration_date">expiration_date:</label>
   <input name="expiration_date" type="text" value="{{ host.expiration_date }}"> YYYY-MM-DD<br>
   {% for interface in interfaces %}
      <label for="id_interface">Interface:</label>
      <select name="hdwr_type{{ interface.0.id }}">
      {% for choice in interface.0.TYPE_CHOICES %}
          {% ifequal interface.0.hdwr_type choice.0 %}
	      <option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
	  {% else %}
	      <option value="{{ choice.0 }}">{{ choice.1 }}
	  {% endifequal %}
      {% endfor %}
      </select><br>
      <label for="id_dhcp">dhcp:</label>
       {% if interface.0.dhcp %}
           <input type="checkbox" checked="checked" name="dhcp{{ interface.0.id }}">
       {% else %}
           <input type="checkbox" name="dhcp{{ interface.0.id }}">
       {% endif %}<br>
      <label for="id_mac_addr">mac_addr:</label>
      <input name="mac_addr{{ interface.0.id }}" type="text" value="{{ interface.0.mac_addr }}">
       <a style="font-size:75%" href="/hostbase/{{ host.id }}/interface/{{ interface.0.id }}/confirm">remove</a><br>
       {% for ip in interface.1 %}
           <label for="id_ip_addr">ip_addr:</label>
           <input name="ip_addr{{ ip.id }}" type="text" value="{{ ip.ip_addr }}">
	   <a style="font-size:75%" href="/hostbase/{{ host.id }}/ip/{{ ip.id }}/confirm">remove</a><br>
       {% endfor %}

<!-- Section for adding a new IP address to an existing interface -->
<!-- By default, section is hidden -->
       <div id=ipaddr{{ interface.0.id }}>
           <label for="id_ip_addr">ip_addr:</label>
           <input name="{{ interface.0.id }}ip_addr" type="text"><br>
       </div>
       <a style="font-size:75%" href=# onclick="toggleAddr({{ interface.0.id }})">Add a New IP Address</a><br>
   {% endfor %}
<!--  End section for new IP address -->

<!-- Section for add an entirely new interface to a host -->
<!-- By default, section is hidden -->
   <div id=interface>
   <label for="id_interface">Interface:</label>
   <select name="hdwr_type_new">
   {% for choice in TYPE_CHOICES %}
       <option value="{{ choice.0 }}">{{ choice.1 }}
   {% endfor %}
   </select><br>
   <label for="id_dhcp">dhcp:</label>
   {% if host.dhcp %}
       <input type="checkbox" checked="checked" name="dhcp_new">
   {% else %}
       <input type="checkbox" name="dhcp_new">
   {% endif %}<br>
   <label for="id_mac_addr">mac_addr:</label>
   <td> <input name="mac_addr_new" type="text"><br>
   <label for="id_ip_addr">ip_addr:</label>
   <td> <input name="ip_addr_new" type="text"><br>
</div>
<a style="font-size:75%" href=# onclick="toggleInter()">Add a New Interface</a><br>
<!-- End new interface section -->


<label for="id_comments">comments:</label>
<textarea rows="10" cols="50" name="comments">{{ host.comments }}</textarea><br>
<a style="font-size:75%" href="/hostbase/{{ host.id }}/dns/edit">edit detailed DNS information for this host</a>
<br>
this host is
<select name="status">
{% for choice in host.STATUS_CHOICES %}
{% ifequal host.status choice.0 %}
<option value="{{ choice.0 }}" selected="selected">{{ choice.1 }}
{% else %}
<option value="{{ choice.0 }}">{{ choice.1 }}
{% endifequal %}
{% endfor %}
</select><br>
last update on {{ host.last }}<br>
<input type="submit" value="submit">
<input type="reset" value="cancel" onclick="history.back()">
</form>

{% endblock %}