]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Add pool view
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 16 Aug 2006 17:27:14 +0000 (17:27 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 16 Aug 2006 17:27:14 +0000 (17:27 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3287 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/html/bweb.css
gui/bweb/html/bweb.js
gui/bweb/html/pix.png [new file with mode: 0644]

index bb6e678b4cd7d6bde41469632f408f188f553abe..72abfc7d0c0484a0805b44415e152492a2108b71 100644 (file)
@@ -4,8 +4,38 @@ a { text-decoration: none;}
                         border: 1px solid #9d9d94;
 }
 
-abutton.formulaire { class: formulaire; font-size: 9; height: 48px; width: 80px; background-color: transparent; }
+abutton.formulaire { font-size: 9; height: 48px; width: 80px; background-color: transparent; }
 
-button.formulaire { class: formulaire; border: 0px; font-size: 9;  background-color: transparent; }
+button.formulaire { border: 0px; font-size: 9;  background-color: transparent; }
 
 td.joberr { background-color: red; font-color: white;}
+
+
+.pSlice, .pSliceFull, .pSliceError, .pSliceAppend, .pSlicePurged, .pSliceRecycle, pSliceArchive, pSliceUsed, pSliceRead_Only, pSliceDisabled {
+  width: 2px;
+  height: 9px;
+  margin-right: 1px;
+  margin-bottom: 1px;
+  border: solid 1px #CCCCCC;
+  background-color: #E6E6E6;   
+}
+
+.pSliceFull, pSliceRead_Only,pSliceArchive, pSliceUsed, pSliceDisabled {
+ border: solid 1px #BD0C10;
+ background-color: #FF3029;
+}
+
+.pSliceError {
+ border: solid 1px #000000;
+ background-color: #020202;
+}
+
+.pSliceAppend {
+ border: solid 1px #CD6500;
+ background-color: #FFCE00;
+}
+
+.pSlicePurged, .pSliceRecycle {
+ border: solid 1px #009900;
+ background-color: #00FF00;
+}
index 69fc2477383765e4637ea83f15c5f9c3342121b3..e92340ccf97f5b1af5888c04c2c2c17934ec08ed 100644 (file)
@@ -53,3 +53,73 @@ function bweb_add_refresh(){
        window.setInterval("bweb_refresh()",refresh_time);
 }
 
+//
+// percent_display("row2", [ { nb: 1, name: "Full"   },
+//                        { nb: 2, name: "Error"  },
+//                        { nb: 5, name: "Append" },
+//                        { nb: 2, name: "Purged" },
+//                         {}                               # last element must be {}
+//                      ]);
+
+function percent_get_img(type)
+{
+   var img=document.createElement('img');
+   if (type) {
+      img.className="pSlice" + type ;
+   } else {
+      img.className="pSlice";
+   }
+   img.src="/bweb/pix.png";
+   img.alt="";
+   return img;
+}
+
+function percent_display(parent, hash_values)
+{
+   var nb_elt=20;
+   var tips= "";
+
+   if (typeof parent != "object") {
+      parent = document.getElementById(parent);
+   } 
+
+   if (!parent) {
+       alert("E : display_percent(): Can't find parent " + parent);
+       return;
+   }
+
+   hash_values.pop(); // drop last element {}
+
+   var nb_displayed = 0;
+   var nb_max = 0;
+
+   for(var i=0;i<hash_values.length;i++) {
+        nb_max += hash_values[i]['nb'];
+   }
+
+   for(var i=0;i<hash_values.length;i++) {
+        var elt = hash_values[i];
+        var cur_nb = (elt['nb'] * nb_elt)/nb_max;
+        var cur_name = elt['name'];
+        cur_name.replace(/-/,"_");
+
+        tips = tips + " " + elt['nb'] + " " + cur_name;
+
+        while ((nb_displayed < nb_elt) && (cur_nb >=1)) {
+            nb_displayed++;
+            cur_nb--;
+
+            var img= percent_get_img(cur_name);
+            parent.appendChild(img);
+        }       
+   }
+
+   while (nb_displayed < nb_elt) {
+      nb_displayed++;
+      var img= percent_get_img();
+      parent.appendChild(img);
+  }     
+
+  parent.title = tips;
+
+}
diff --git a/gui/bweb/html/pix.png b/gui/bweb/html/pix.png
new file mode 100644 (file)
index 0000000..de3da90
Binary files /dev/null and b/gui/bweb/html/pix.png differ