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 (support = nethost.get_attributes('support')) %] |
---|
15 | [% osupport = c.model('Accounts').db.get_object('support', support) %] |
---|
16 | <tr><th> |
---|
17 | Support |
---|
18 | </th></tr> |
---|
19 | <tr><td> |
---|
20 | l('Support Name'): [% osupport.id | html %]<br> |
---|
21 | </td></tr> |
---|
22 | [% END %] |
---|
23 | |
---|
24 | [% IF c.model('Accounts').db.check_acl('netzone', 'name', 'r') %] |
---|
25 | <tr><th>Zone de cette hÃŽte</th></tr> |
---|
26 | <tr><td> |
---|
27 | [% FOREACH z = nethost.get_attributes('netZone').sort %] |
---|
28 | <a href="[% c.uri_for('/netzones', z) %]"> |
---|
29 | [% z %]</a> ([% c.model('Accounts').db.get_object('netzone', z).get_attributes('type') %]) |
---|
30 | <br> |
---|
31 | [% END %] |
---|
32 | </td></tr> |
---|
33 | [% END %] |
---|
34 | |
---|
35 | <tr><td> |
---|
36 | [% IF c.model('Accounts').db.check_acl('nethost', 'ip', 'w') %] |
---|
37 | <fieldset> |
---|
38 | <legend>Ajouter une ip libre:</legend> |
---|
39 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
40 | <label for="zone">Zone:</label> <select name="zone" id="zone"> |
---|
41 | <option value="">--</value> |
---|
42 | [% FOREACH z = |
---|
43 | c.model('Accounts').db.search_objects('netzone', 'type=dhcp', 'net=*').sort %] |
---|
44 | [% zo = c.model('Accounts').db.get_object('netzone', z) %] |
---|
45 | [% NEXT IF NOT zo.get_attributes('freeIPCount') %] |
---|
46 | <option value="[% z | html %]">[% z | html %] ([% zo.get_attributes('freeIPCount') %])</option> |
---|
47 | [% END %] |
---|
48 | </select><br> |
---|
49 | |
---|
50 | <input id=ipselect type=text name=newip><br> |
---|
51 | <input type="submit" name="addip"> |
---|
52 | </form> |
---|
53 | </fieldset> |
---|
54 | |
---|
55 | <script> |
---|
56 | $(function() { |
---|
57 | $( '#zone' ).on( "change", function() { |
---|
58 | $( '#ipselect' ).autocomplete({ |
---|
59 | minLength: 0, |
---|
60 | delay: 0, |
---|
61 | source: '[% c.uri_for('/json', 'freeip') %]?zone=' + $( '#zone' ).val(), |
---|
62 | }); |
---|
63 | $( "#ipselect" ).focus(function() { $( "#ipselect" ).autocomplete("search", "" ); }); |
---|
64 | $( "#ipselect" ).click(function() { $( "#ipselect" ).autocomplete("search", "" ); }); |
---|
65 | return false; |
---|
66 | }); |
---|
67 | }); |
---|
68 | </script> |
---|
69 | [% END %] |
---|
70 | |
---|
71 | [% IF c.model('Accounts').db.check_acl('nethost', '@CREATE', 'w') %] |
---|
72 | <fieldset><legend>Renommer la machine en:</legend> |
---|
73 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
74 | <input type="text" name="to"><br> |
---|
75 | <input type="checkbox" name="addcname" id="addcname" checked="checked"> |
---|
76 | <label for="addcname">Ajouter le nom en CNAME</label><br> |
---|
77 | <input type="submit" name="rename"> |
---|
78 | </form> |
---|
79 | </fieldset> |
---|
80 | [% END %] |
---|
81 | |
---|
82 | </td></tr> |
---|
83 | </table> |
---|
84 | </div> |
---|
85 | |
---|
86 | [% END %] |
---|