1 | <!-- $Id$ --> |
---|
2 | [% IF NOT nethost %] |
---|
3 | No group [% 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 | <div class="oform"> |
---|
14 | <table border=1> |
---|
15 | [% IF c.model('Accounts').db.check_acl('netzone', 'name', 'r') %] |
---|
16 | <tr><th>Zone de cette hÃŽte</th></tr> |
---|
17 | <tr><td> |
---|
18 | [% FOREACH z = nethost.get_attributes('netZone').sort %] |
---|
19 | <a href="[% c.uri_for('/netzones', z) %]"> |
---|
20 | [% z %]</a> ([% c.model('Accounts').db.get_object('netzone', z).get_attributes('type') %]) |
---|
21 | <br> |
---|
22 | [% END %] |
---|
23 | </td></tr> |
---|
24 | [% END %] |
---|
25 | |
---|
26 | <tr><td> |
---|
27 | [% IF c.model('Accounts').db.check_acl('nethost', 'ip', 'w') %] |
---|
28 | <fieldset> |
---|
29 | <legend>Ajouter une ip libre:</legend> |
---|
30 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
31 | <label for="zone">Zone:</label> <select name="zone" id="zone"> |
---|
32 | <option value="">--</value> |
---|
33 | [% FOREACH z = |
---|
34 | c.model('Accounts').db.search_objects('netzone', 'type=dhcp', 'net=*').sort %] |
---|
35 | [% zo = c.model('Accounts').db.get_object('netzone', z) %] |
---|
36 | [% NEXT IF NOT zo.get_attributes('freeIPCount') %] |
---|
37 | <option value="[% z | html %]">[% z | html %] ([% zo.get_attributes('freeIPCount') %])</option> |
---|
38 | [% END %] |
---|
39 | </select><br> |
---|
40 | |
---|
41 | [% c.prototype.observe_field('zone', { |
---|
42 | update => 'zone_span', |
---|
43 | url => c.uri_for('/ajax', 'select_freeip_select'), |
---|
44 | frequency => 1, |
---|
45 | with => "'zone='+element.options[element.selectedIndex].value", |
---|
46 | } ) %] |
---|
47 | <span id="zone_span"></span><br> |
---|
48 | <input type="submit" name="addip"> |
---|
49 | </form> |
---|
50 | </fieldset> |
---|
51 | [% END %] |
---|
52 | |
---|
53 | [% IF c.model('Accounts').db.check_acl('nethost', '@CREATE', 'w') %] |
---|
54 | <fieldset><legend>Renommer la machine en:</legend> |
---|
55 | <form action="[% c.uri_for(nethostname) %]" method="POST"> |
---|
56 | <input type="text" name="to"><br> |
---|
57 | <input type="checkbox" name="addcname" id="addcname" checked="checked"> |
---|
58 | <label for="addcname">Ajouter le nom en CNAME</label><br> |
---|
59 | <input type="submit" name="rename"> |
---|
60 | </form> |
---|
61 | </fieldset> |
---|
62 | [% END %] |
---|
63 | |
---|
64 | [% IF c.model('Accounts').db.check_acl('nethost', '@DELETE', 'w') %] |
---|
65 | <script LANGUAGE="JavaScript"> |
---|
66 | <!-- |
---|
67 | function confirmSubmit() |
---|
68 | { |
---|
69 | var agree=confirm("Supprimer l'hÃŽte [% nethost.id %] ?"); |
---|
70 | if (agree) |
---|
71 | return true ; |
---|
72 | else |
---|
73 | return false ; |
---|
74 | } |
---|
75 | // --> |
---|
76 | </script> |
---|
77 | <fieldset> |
---|
78 | <legend>Supprimer cet hÃŽte</legend> |
---|
79 | <form action="[% c.uri_for(nethostname) %]" method="POST" onsubmit="return confirmSubmit()"> |
---|
80 | <input type="image" name="delete" value="Supprimer" title="Supprimer" alt="effacer" src="[% |
---|
81 | c.uri_for('/static', 'images', 'edit-delete.png') %]"> |
---|
82 | <input type="hidden" name="delete" value="Supprimer"> |
---|
83 | </form> |
---|
84 | </fieldset> |
---|
85 | [% END %] |
---|
86 | |
---|
87 | </td></tr> |
---|
88 | </table> |
---|
89 | </div> |
---|
90 | </div> |
---|
91 | |
---|
92 | [% END %] |
---|