Code

26c980d4435ece762fed071959ab32f6d2a9b9a6
[gosa.git] / gosa-plugins / goto / addons / goto / deploy-list.tpl
1 <table style='width:100%;height:100%; ' summary="">
3   <tr>
4     <td style='width:100%;'>
6       <div class="contentboxh">
7         <p class="contentboxh">&nbsp;{$HEADLINE}&nbsp;{$SIZELIMIT}</p>
8       </div>
9       
10       <div class="contentboxb">
11        <div style='background:white;padding:3px;'>
12         <table><tr>
13           <td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td><td>{$RELOAD}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td>{t}Base{/t} {$BASE}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td>{image path="images/rocket.png"}
14 </td><td> {$ACTIONS}</td>
15         </tr></table>
16        </div>
17       </div>
18       
19       <div style='height:4px;'>
20       </div>
21       {$LIST}
22     </td>
23   </tr>
24 </table>
26 <input type="hidden" name="ignore">
29 <!--
30 JS to reload the progress bars.
32 -->
33 {literal}
34 <script type="text/javascript">
36 /* Get request object handler for this type of browser 
37  */
38 if (typeof XMLHttpRequest != 'undefined')
39 {
40     xmlHttpObject = new XMLHttpRequest();
41 }
42 if (!xmlHttpObject)
43 {
44     try
45     {
46         xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP");
47     }
48     catch(e)
49     {
50         try
51         {
52             xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
53         }
54         catch(e)
55         {
56             xmlHttpObject = null;
57         }
58     }
59 }
61 var fai_status = new Array();
63 function loadContent()
64 {
65         var c = 0;
67         /* Create array of available progress images once 
68          */
69         if(!fai_status.length){
70                 var progressBars= Form.getElements("mainform");
71                 progressBars.each(function(progressBar) {
72                         if(progressBar.id.match(/^progress_/)){
73                                 var mac = id.replace(/^progress_/,'');
74                                 mac = mac.replace(/_/g,':');
75                                 fai_status[c] = new Object();
76                                 fai_status[c]['MAC']  = mac;
77                                 fai_status[c]['PROGRESS'] = -1;
78                                 c ++;
79                         }
80                 }
81         }
83         /* Create string of macs used as parameter for getFAIstatus.php
84                 to retrieve all progress values.
85      */
86         var macs = "";
87         for (var i = 0; i < fai_status.length; i++) {
88                 macs += fai_status[i]['MAC'] + ","
89         }
91         /* Send request 
92      */
93     xmlHttpObject.open('get','getFAIstatus.php?mac=' + macs);
94     xmlHttpObject.onreadystatechange = handleContent;
95     xmlHttpObject.send(null);
96     return false;
97 }
100 function handleContent()
102     if (xmlHttpObject.readyState == 4)
103     {
104                 /* Get text and split by newline 
105          */
106         var text = xmlHttpObject.responseText;
107                 var data = text.split("\n");
109                 /* Walk through progress images and check if the 
110                    progress status has changed 
111                  */
112                 for (var e = 0; e < fai_status.length; e++) {
113                 
114                         /* Walk through returned values and parse out 
115                            mac and progress value */
116                         var found       = false;
118                         /* Create object id out of mac address 12:34:56:12:34:56 => progress_12_34_56_12_34_56 */
119                         var id          = fai_status[e]["MAC"].replace(/:/g,"_"); 
120                         id = "progress_" + id;
121                         var progressBar = document.getElementById(id);
123                         /* Continue if there is no image object iwth this id */
124                         if(!progressBar){
125                                 continue;
126                         }
128                         for (var i = 0; i < data.length; i++) {
129                                 var mac         = data[i].replace(/\|.*$/,"");
130                                 var progress= data[i].replace(/^.*\|/,"");
132                                 /* Match mac returned by the support daemon and 
133                                         the one out of our list */
134                                 if(fai_status[e]["MAC"] == mac){
135                                         found = true;   
137                                         /* Check if progress has changed 
138                                          */     
139                                         if(fai_status[e]["PROGRESS"] != progress){
140                                                 var woffset= Math.floor(0.85 * (100-progress));
142                                                 progressBar.setStyle({
143                                                    -moz-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)",
144                                                    -webkit-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)",
145                                                    box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)"
146                                                 });
147                                                 fai_status[e]["PROGRESS"] = progress;
149                                         }
150                                         break;
151                                 }
152                         }
153                         //document.getElementById("text1").value += "\n ";
155                         /* There was no status send for the current mac. 
156                            This means it was removed from the queue.
157                          */
158                         if(!found){
159                                 document.mainform.submit();                             
160                         }
161                 }
162                 timer=setTimeout('loadContent()',3000);
163     }
166 timer=setTimeout('loadContent()',3000);
167 </script>
168 {/literal}