From 66e8752b890076a6d95fa40f0de677cf685f48e3 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Thu, 23 Oct 2014 06:12:58 +0200 Subject: value del button --- src/viz/index.css | 8 +++++++- src/viz/index.js | 14 +++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/viz/index.css b/src/viz/index.css index 73c6f42..656f85d 100644 --- a/src/viz/index.css +++ b/src/viz/index.css @@ -61,7 +61,6 @@ main { h2.dispstreamheader { font-variant: small-caps; - } ul.controls { @@ -149,6 +148,13 @@ div.dispvalueheader { padding-top: 10px; } +input.dispvalueheaderafter { + float:right; + display:inline; + margin-top:-35px; +} + + div.dispvaluevalue { margin-top:10px; margin-left:10px; diff --git a/src/viz/index.js b/src/viz/index.js index e282026..2485912 100644 --- a/src/viz/index.js +++ b/src/viz/index.js @@ -2,6 +2,7 @@ var qintv_ms = 5000; var uripart = "/updates?"; var lastfrom = ""; var stuff_to_display = {"clients":"none","*":showvalue,"client-count":showvalue, "bytes-sent":showgauge, "fuckups-per-second":showasgraph}; +var sidseen = []; $(document).ready(function() @@ -20,11 +21,16 @@ function getstreamdiv(sid) { return elem; } +function killvalue(name) { + stuff_to_display[name]="none"; + $.each(sidseen,function(index,sid){ $("#li-"+sid+"_"+name).remove() }); +} + function showvalue(sid, name, value, jsdate) { var divid = sid+"_"+name; var elem = $("#"+divid); if (elem.length<1) { - getstreamdiv(sid).append('
  • '+ name +'
  • '); + getstreamdiv(sid).append('
  • '+ name +'
  • '); elem = $("#"+divid); } elem.html(""+value+"
    @"+jsdate.toLocaleDateString()+" "+jsdate.toLocaleTimeString()+""); @@ -35,7 +41,7 @@ function showgauge(sid, name, value) { var divid = sid+"_"+name; var elem = document.getElementById(divid); if (!elem) { - getstreamdiv(sid).append('
  • '+ name +'
  • '); + getstreamdiv(sid).append('
  • '+ name +'
  • '); elem = document.getElementById(divid); gauges[divid] = new google.visualization.Gauge(elem); } @@ -49,7 +55,7 @@ function showasgraph(sid, name, value, jsdate) { var divid = sid+"_"+name; var elem = document.getElementById(divid); if (!elem) { - getstreamdiv(sid).append('
  • '+ name +'
  • '); + getstreamdiv(sid).append('
  • '+ name +'
  • '); elem = document.getElementById(divid); graphdata[divid]=[]; graphs[divid] = new Dygraph(elem,graphdata[divid],{legend:'none',title:sid+"-"+name,labels:["Date/Time",name]}); @@ -59,8 +65,10 @@ function showasgraph(sid, name, value, jsdate) { } function graphS5Status(data) { + sidseen=[]; $.each(data, function(index, stream) { var sid = stream["streamer-id"].format + '-' + stream["streamer-id"].quality; + sidseen.push(sid); lastfrom = "from="+stream["start-time"]; var jsdate = new Date(stream["start-time"]); qintv_ms = stream["duration-ms"]; //doesnt really change anything yet -- cgit v1.2.3