1){
+ r.innerHTML = " | "
+ r = t.insertRow(t.rows.length)
+ }
+ r.innerHTML = ""+name+""
+ }else{
+ graphrow(r, 1, name, 600, 300, 30, fill++, "")
+ }
+ }
+}
+
+function xpos(obj) {
+ var x = 0
+ if(obj.fixedx)
+ return obj.fixedx
+ if(obj.offsetParent){
+ while(obj.offsetParent){
+ x += obj.offsetLeft
+ obj = obj.offsetParent
+ }
+ }else if(obj.x)
+ x = obj.x
+ return x
+}
+
+function ypos(obj) {
+ var y = 0
+ if(obj.fixedy)
+ return obj.fixedy
+ if(obj.offsetParent){
+ while(obj.offsetParent){
+ y += obj.offsetTop
+ obj = obj.offsetParent
+ }
+ }else if(obj.y)
+ y = obj.y
+ return y
+}
+
+function scrollleft() {
+ return document.body.scrollLeft
+}
+
+function scrolltop() {
+ return document.body.scrollTop
+}
+
+function columnclick(e) {
+ if(e.which && e.which != 1)
+ return
+ var g = findgraph(scrollleft()+e.clientX, scrolltop()+e.clientY)
+ if(g && g.name.substring(0,1) != "!"){
+ biggraph = g.name
+ var t = document.getElementById("statgraphs")
+ graphrow(t.rows[0], 3, biggraph, 86400, 900, 30, 0, " – showing 24 hours")
+ graphrow(t.rows[1], 3, biggraph, 3600, 900, 30, 1, " – showing 1 hour")
+ }
+}
+
+function findgraph(x, y) {
+ var g
+
+ if(g = findgraphin(x, y, "column2", col2info))
+ return g
+ if(g = findgraphin(x, y, "column1", col1info))
+ return g
+ if(g = findgraphin(x, y, "column0", col0info))
+ return g
+ return
+}
+
+function findgraphin(x, y, tname, info) {
+ var t = document.getElementById(tname)
+ if(x < xpos(t))
+ return
+ y = y - ypos(t)
+ for(var i=info.length-2; i>=1; i--)
+ if(y > info[i].y)
+ return info[i]
+ return
+}
+
+function setof(name, val, list) {
+ var s = ""
+ for(var i=0; i"+val+""
+ else
+ s = s+" "+list[i]+""
+ }
+ return s
+}
+
+function loglinks(list) {
+ var s = ""
+ for(var i=0; i"+list[i]+""
+ }
+ return s
+}
+
+first = 1
+function redrawsettings() {
+ if(first){
+ loadsettings()
+ first = 0
+ }
+ var s = ""
+ s = s+"\n"
+ s = s+"logging:"+setof("logging", logging, loggingchoices)
+ s = s+" "
+ s = s+"stats:"+setof("stats", stats, statschoices)
+ s = s+"\n\n"
+ s = s+"compression:"+setof("compress", compress, compresschoices1)
+ s = s+" "+setof("compress", compress, compresschoices2)
+ s = s+"\n\n"
+ s = s+"index | storage | "
+ s = s+"log:"+loglinks(logs)
+ s = s+""
+ document.getElementById("settings").innerHTML = s
+}
+
+function set(name, value) {
+ eval(name+"= \""+value+"\"")
+ redrawsettings()
+ // Works in FireFox, not in Safari
+ parent.hidden.location.href = "/set/"+name+"/"+value
+}
diff --git a/src/cmd/venti/srv/www/status.js b/src/cmd/venti/srv/www/status.js
new file mode 100644
index 00000000..48e197d8
--- /dev/null
+++ b/src/cmd/venti/srv/www/status.js
@@ -0,0 +1,16 @@
+function loadsettings() {
+ logging = "off"
+ loggingchoices = new Array("0", "1")
+
+ stats = "on"
+ statschoices = new Array("0", "1")
+
+ compress = "whack"
+ compresschoices1 = new Array("none",
+ "flate1", "flate2", "flate3", "flate4", "flate5",
+ "flate6", "flate7", "flate8", "flate9")
+ compresschoices2 = new Array("smack1", "smack2", "smack3", "whack")
+
+ logs = new Array("all", "libventi/server", "disk", "lump", "block", "proc", "quiet", "rpc")
+}
+
diff --git a/src/cmd/venti/srv/www/status1.js b/src/cmd/venti/srv/www/status1.js
new file mode 100644
index 00000000..b0e284e3
--- /dev/null
+++ b/src/cmd/venti/srv/www/status1.js
@@ -0,0 +1,14 @@
+logging = "on"
+loggingchoices = new Array("off", "on")
+
+stats = "on"
+statschoices = new Array("off", "on")
+
+compress = "whack"
+compresschoices1 = new Array("none",
+ "flate1", "flate2", "flate3", "flate4", "flate5",
+ "flate6", "flate7", "flate8", "flate9")
+compresschoices2 = new Array("smack1", "smack2", "smack3", "whack")
+
+logs = new Array("all", "libventi/server", "disk", "lump", "block", "proc", "quiet", "rpc")
+
|