]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/tpl/ach_add.tpl
d5c739459839164fa77b5c01b4c8394a9c32d28a
[bacula/bacula] / gui / bweb / tpl / ach_add.tpl
1 <br/>
2 <div class='titlediv'>
3   <h1 class='newstitle'><TMPL_UNLESS name>New</TMPL_UNLESS> Autochanger </h1>
4 </div>
5 <div class='bodydiv'>
6    <form name='form1' action="?" method='get'>
7     <table>
8      <tr><td>Name :</td>     
9          <td>
10           <select name='ach' class='formulaire' id='ach'>
11 <TMPL_LOOP devices><option value='<TMPL_VAR name>'><TMPL_VAR name></option></TMPL_LOOP>
12           </select>
13          </td>
14      </tr>
15      <tr><td>Pre-command :</td> 
16          <td> <input class="formulaire" type='text' id='precmd' value='sudo'
17            title='can be "sudo" or "ssh storage@storagehost"...' name='precmd'>
18          </td>
19      </tr>
20      <tr><td>mtx command :</td> 
21          <td> <input class="formulaire" type='text' name='mtxcmd' size='32'
22                value='/usr/sbin/mtx' id='mtxcmd'>
23          </td>
24      </tr>
25      <tr><td>Device :</td> 
26          <td> <input class="formulaire" type='text' name='device' 
27                value='/dev/changer' id='device'>
28          </td>
29      </tr>
30     <tr><td><b>Drives</b></td><td/></tr>
31     <TMPL_LOOP devices>
32     <tr>
33      <td><input class='formulaire' type='checkbox' id='drive_<TMPL_VAR name>'
34                 name='drives' value='<TMPL_VAR name>'><TMPL_VAR name>
35      </td>
36      <td>index <input type='text' title='drive index' class='formulaire'
37                 id='index_<TMPL_VAR name>' value='' 
38                 name='index_<TMPL_VAR name>' size='3'>
39      </td>
40     </tr>
41     </TMPL_LOOP>
42     </table>
43     <button name='action' value='ach_add' class='formulaire'>
44      <img src='/bweb/save.png'>
45     </button>
46    </form>
47 </div>
48
49 <script language="JavaScript">
50   <TMPL_IF name>
51   for (var i=0; i < document.form1.ach.length; ++i) {
52      if (document.form1.ach[i].value == '<TMPL_VAR name>') {
53         document.form1.ach[i].selected = true;
54      }
55   }
56   </TMPL_IF>
57   <TMPL_IF mtxcmd>
58      document.getElementById('mtxcmd').value='<TMPL_VAR mtxcmd>';
59   </TMPL_IF>
60   <TMPL_IF precmd>
61      document.getElementById('precmd').value='<TMPL_VAR precmd>';
62   </TMPL_IF>
63   <TMPL_IF device>
64      document.getElementById('device').value='<TMPL_VAR device>';
65   </TMPL_IF>
66   <TMPL_IF drives>
67    <TMPL_LOOP drives>
68      document.getElementById('drive_<TMPL_VAR name>').checked=true;
69      document.getElementById('index_<TMPL_VAR name>').value=<TMPL_VAR index>;
70    </TMPL_LOOP>
71   </TMPL_IF>
72 </script>