From f7ceadbd8b8d55a14f765ed6dc28d5d54a822d87 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Fri, 24 Oct 2014 15:05:11 +0200 Subject: darstellungsauswahl --- src/viz/index.html | 3 ++- src/viz/index.js | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/viz/index.html b/src/viz/index.html index 02a8149..f81a707 100644 --- a/src/viz/index.html +++ b/src/viz/index.html @@ -14,8 +14,9 @@

Sfive Stat Display

- +
+
diff --git a/src/viz/index.js b/src/viz/index.js index 2485912..de66d9c 100644 --- a/src/viz/index.js +++ b/src/viz/index.js @@ -1,6 +1,7 @@ var qintv_ms = 5000; var uripart = "/updates?"; var lastfrom = ""; +var possible_display_functions = {"Off":"none", "Value":showvalue, "Gauge":showgauge, "Graph":showasgraph}; var stuff_to_display = {"clients":"none","*":showvalue,"client-count":showvalue, "bytes-sent":showgauge, "fuckups-per-second":showasgraph}; var sidseen = []; @@ -21,9 +22,12 @@ function getstreamdiv(sid) { return elem; } -function killvalue(name) { +function killvalue(name, nosetselect) { stuff_to_display[name]="none"; $.each(sidseen,function(index,sid){ $("#li-"+sid+"_"+name).remove() }); + if (nosetselect != 1) { + document.getElementById("opts-"+name).selectedIndex=0; + } } function showvalue(sid, name, value, jsdate) { @@ -64,6 +68,31 @@ function showasgraph(sid, name, value, jsdate) { graphs[divid].updateOptions({'file':graphdata[divid]}); } +function showasetting(name) { + var setid = "opts-"+name; + if (! document.getElementById(setid)) { + var sts = $('