1 | <!-- $Id$ --> |
---|
2 | [% IF NOT nethost %] |
---|
3 | No host [% nethostname | html %] found. |
---|
4 | [% ELSE %] |
---|
5 | |
---|
6 | [% INCLUDE 'nethosts/object_header.tt' %] |
---|
7 | |
---|
8 | <div class="objectformleft" id="objectform"> |
---|
9 | [% INCLUDE 'includes/form.tt' |
---|
10 | form = form |
---|
11 | form_uri = c.uri_for(nethostname) %] |
---|
12 | |
---|
13 | <table border=1> |
---|
14 | [% IF c.model('Accounts').db.check_acl('netzone', 'name', 'r') %] |
---|
15 | <tr><th>Zone de cette hÃŽte</th></tr> |
---|
16 | <tr><td> |
---|
17 | [% FOREACH z = nethost.get_attributes('netZone').sort %] |
---|
18 | <a href="[% c.uri_for('/netzones', z) %]"> |
---|
19 | [% z %]</a> ([% c.model('Accounts').db.get_object('netzone', z).get_attributes('type') %]) |
---|
20 | <br> |
---|
21 | [% END %] |
---|
22 | </td></tr> |
---|
23 | [% END %] |
---|
24 | |
---|
25 | <tr><td> |
---|
26 | [% IF c.model('Accounts').db.check_acl('nethost', 'ip', 'w') %] |
---|
27 | <fieldset> |
---|
28 | <legend>Ajouter une ip libre:</legend> |
---|
29 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
30 | <label for="zone">Zone:</label> <select name="zone" id="zone"> |
---|
31 | <option value="">--</value> |
---|
32 | [% FOREACH z = |
---|
33 | c.model('Accounts').db.search_objects('netzone', 'type=dhcp', 'net=*').sort %] |
---|
34 | [% zo = c.model('Accounts').db.get_object('netzone', z) %] |
---|
35 | [% NEXT IF NOT zo.get_attributes('freeIPCount') %] |
---|
36 | <option value="[% z | html %]">[% z | html %] ([% zo.get_attributes('freeIPCount') %])</option> |
---|
37 | [% END %] |
---|
38 | </select><br> |
---|
39 | |
---|
40 | <input id=ipselect type=text name=newip><br> |
---|
41 | <input type="submit" name="addip"> |
---|
42 | </form> |
---|
43 | </fieldset> |
---|
44 | |
---|
45 | <script> |
---|
46 | $(function() { |
---|
47 | $( '#zone' ).on( "change", function() { |
---|
48 | $( '#ipselect' ).autocomplete({ |
---|
49 | minLength: 0, |
---|
50 | delay: 0, |
---|
51 | source: '[% c.uri_for('/json', 'freeip') %]?zone=' + $( '#zone' ).val(), |
---|
52 | }); |
---|
53 | $( "#ipselect" ).focus(function() { $( "#ipselect" ).autocomplete("search", "" ); }); |
---|
54 | $( "#ipselect" ).click(function() { $( "#ipselect" ).autocomplete("search", "" ); }); |
---|
55 | return false; |
---|
56 | }); |
---|
57 | }); |
---|
58 | </script> |
---|
59 | [% END %] |
---|
60 | |
---|
61 | [% IF c.model('Accounts').db.check_acl('nethost', '@CREATE', 'w') %] |
---|
62 | <fieldset><legend>Renommer la machine en:</legend> |
---|
63 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
64 | <input type="text" name="to"><br> |
---|
65 | <input type="checkbox" name="addcname" id="addcname" checked="checked"> |
---|
66 | <label for="addcname">Ajouter le nom en CNAME</label><br> |
---|
67 | <input type="submit" name="rename"> |
---|
68 | </form> |
---|
69 | </fieldset> |
---|
70 | [% END %] |
---|
71 | |
---|
72 | </td></tr> |
---|
73 | </table> |
---|
74 | </div> |
---|
75 | |
---|
76 | [% END %] |
---|