]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/tpl/overview.tpl
Renamed cleanup goto target into bail_out which is the prefered name from the develop...
[bacula/bacula] / gui / bweb / tpl / overview.tpl
1 <style type="text/css">
2 table.sample {
3         border-width: 1px 1px 1px 1px;
4         border-spacing: 3px;
5         border-style: solid solid solid solid;
6         border-color: black black black black;
7         border-collapse: collapse;
8         background-color: white;
9 }
10 table.sample th {
11         border-width: 1px 1px 1px 1px;
12         padding: 4px 4px 4px 4px;
13         border-style: solid solid solid solid;
14         border-color: gray gray gray gray;
15         background-color: white;
16 }
17 table.sample td {
18         border-width: 1px 1px 1px 1px;
19         padding: 4px 4px 4px 4px;
20         border-style: solid solid solid solid;
21         border-color: gray gray gray gray;
22         background-color: white;
23 }
24 </style>
25  <div class='titlediv'>
26   <h1 class='newstitle'> __Jobs overview__ (<TMPL_VAR label>)</h1>
27  </div>
28  <div class='bodydiv'>
29   <table class='sample' id='report'>
30    <tr id='days'><td/>
31   </table>
32  </div>
33
34
35
36 <script type="text/javascript" language="JavaScript">
37
38 var table = document.getElementById('report');
39 var nodate = new Array();
40 var nb_col=1;
41 var tr; var td; var img; var infos;
42 var all = new Array();
43 var max_cel=0;
44 var min_cel=200;
45
46 <TMPL_LOOP items>
47 infos = new Array();
48  <TMPL_LOOP events>
49  min_cel=(min_cel< <TMPL_VAR num>)?min_cel:<TMPL_VAR num>;
50  infos[<TMPL_VAR num>] = new Array('<TMPL_VAR num>', '<TMPL_VAR status>', 
51                                    '<TMPL_VAR joberrors>', '<TMPL_VAR title>');
52  </TMPL_LOOP>
53 max_cel=(max_cel>infos.length)?max_cel:infos.length;
54 all.push({ name: "<TMPL_VAR name>", values: infos});
55 </TMPL_LOOP>
56
57 //infos = new Array();
58 //infos[1] = new Array('2007-10-01', 'T', 8);
59 //infos[2] = new Array('2007-10-02', 'T', 8);
60 //infos[5] = new Array('2007-10-05', 'R', 8);
61 //
62 //max_cel=(max_cel>infos.length)?max_cel:infos.length;
63 //all.push({ name: "zog", values: infos});
64
65 function init_tab() // initialize the table
66 {
67     for(var j=min_cel; j < max_cel ; j++) {
68        var t=document.createElement("TD");
69        t.setAttribute("id", "day" + j);
70        nodate[j]=1;
71        document.getElementById("days").appendChild(t);
72     }
73 }
74
75 function add_client(name, infos)
76 {
77     tr=document.createElement("TR"); // client row
78     table.appendChild(tr);
79
80     td=document.createElement("TD"); // client name
81     tr.appendChild(td);
82     a=document.createElement("A");
83     a.setAttribute("href", "?action=<TMPL_VAR action>" + name);
84     a.appendChild(document.createTextNode(name));
85     td.appendChild(a);
86     var len = infos.length;
87
88     for(var j=min_cel; j < max_cel ; j++) { // one img for each days
89         td=document.createElement("TD"); 
90         tr.appendChild(td);
91         if (len > j && infos[j]) {
92             if (nodate[j] == 1) { // put the date in the first row if empty
93                var t = document.getElementById("day" + j);
94                t.appendChild(document.createTextNode(infos[j][0]));
95                nodate[j]=0;
96             }
97 //          a=document.createElement("A"); // create a link to action=job
98 //          a.setAttribute('href', "?action=job;client_group=" + name);
99             img=document.createElement("IMG");
100             img.setAttribute("src", bweb_get_job_img(infos[j][1],infos[j][2], 'B'));
101             img.setAttribute("title", infos[j][3]);
102 //          a.appendChild(img);
103             td.appendChild(img);
104         } else {
105 //            td.appendChild(document.createTextNode('N/A'));
106         }
107     }
108 }
109
110 init_tab();
111
112 for(var i=0; i<all.length; i++) {
113    var elt = all[i];
114    add_client(elt['name'], elt['values']);
115 }
116
117 </script>