|
From: <net...@us...> - 2010-12-10 21:33:42
|
Revision: 192
http://openautomation.svn.sourceforge.net/openautomation/?rev=192&view=rev
Author: netzkind
Date: 2010-12-10 21:33:36 +0000 (Fri, 10 Dec 2010)
Log Message:
-----------
fixed https://sourceforge.net/tracker/?func=detail&aid=3128530&group_id=296426&atid=1251141
"Refresh in diagram doesn't work"
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-10 21:21:48 UTC (rev 191)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-10 21:33:36 UTC (rev 192)
@@ -1,4 +1,4 @@
-/* structure_plugin.js (c) 2010 by Christian Mayer [CometVisu at ChristianMayer dot de]
+/* structure_plugin.js (c) 2010 by Julian Hartmann [julian dot hartmann at gmail dot com]
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -16,9 +16,8 @@
*/
/**
- * This is a custom function that extends the available widgets.
- * It's purpose is to change the design of the visu during runtime
- * to demonstrate all available
+ * This plugins integrates flot (diagrams in javascript) into the visualization.
+ * server-side data-storage is rrd
*/
$("body").append("<script type=\"text/javascript\" src=\"plugins/diagram/flot/jquery.flot.js\"></script>");
@@ -59,14 +58,8 @@
diagram.data("unit", $p.attr("unit") || "");
diagram.data("series", $p.attr("series") || "day");
diagram.data("label", page.textContent);
+ diagram.data("refresh", $p.attr("refresh"));
- if ($(page).attr("refresh")) {
- // reload regularly
- window.setInterval(function(actor) {
- $(diagram).triggerHandler("refresh.widget");
- }, $p.attr("refresh") * 1000, actor);
- }
-
refreshDiagram(diagram, {});
return ret_val;
@@ -117,14 +110,8 @@
diagram.data("unit", $p.attr("unit") || "");
diagram.data("series", $p.attr("series") || "day");
diagram.data("label", page.textContent);
+ diagram.data("refresh", $p.attr("refresh"));
- if ($(page).attr("refresh")) {
- // reload regularly
- window.setInterval(function(actor) {
- $(actor).triggerHandler("refresh.widget");
- }, $p.attr("refresh") * 1000, actor);
- }
-
var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
diagram.addClass("clickable");
@@ -154,11 +141,12 @@
function refreshDiagram(diagram, flotoptions, data) {
var diagram = $(diagram);
- var c = jQuery.extend(true, {series: diagram.data("series")}, data || {});
+ var config = jQuery.extend(true, {series: diagram.data("series")}, data || {});
var unit = diagram.data("unit");
var rrd = diagram.data("rrd");
var label = diagram.data("label");
+ var refresh = diagram.data("refresh");
var series = {
day: {label: "day", res: "300", start: "-1day", end: "now"},
@@ -194,18 +182,30 @@
},
flotoptions);
- var s = series[c.series];
+ var s = series[config.series];
- // init
- $.ajax({
- url: "/cgi-bin/rrdfetch?rrd=" + rrd + ".rrd&ds=AVERAGE&start=end" + s.start + "&end=" + s.end + "&res=" + s.res,
- dataType: "json",
- type: "GET",
- success: function(data) {
- $.plot(diagram, [{data: data}], options);
+ if (s) {
+ // init
+ $.ajax({
+ url: "/cgi-bin/rrdfetch?rrd=" + rrd + ".rrd&ds=AVERAGE&start=end" + s.start + "&end=" + s.end + "&res=" + s.res,
+ dataType: "json",
+ type: "GET",
+ success: function(data) {
+ $.plot(diagram, [{data: data}], options);
+ }
+ });
+
+ if (typeof (refresh) != "undefined" && refresh) {
+ // reload regularly
+ window.setTimeout(function(diagram, flotoptions, data) {
+ refreshDiagram(diagram, flotoptions, data)
+ }, refresh * 1000, diagram, flotoptions, data);
}
- });
+ }
+
+
+
return false;
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2010-12-11 23:03:50
|
Revision: 201
http://openautomation.svn.sourceforge.net/openautomation/?rev=201&view=rev
Author: netzkind
Date: 2010-12-11 23:03:44 +0000 (Sat, 11 Dec 2010)
Log Message:
-----------
fixed bug with inline-diagrams
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-11 21:09:36 UTC (rev 200)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-11 23:03:44 UTC (rev 201)
@@ -45,10 +45,6 @@
diagram.css("height", $p.attr("height"));
}
- $("#" + id, actor).css({width: w, height: h});
-
- //$("#" + id, actor).css({paddingBottom: "1em"});
-
ret_val.append(label).append(actor);
diagram.data("id", id);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-12-12 11:31:34
|
Revision: 203
http://openautomation.svn.sourceforge.net/openautomation/?rev=203&view=rev
Author: mayerch
Date: 2010-12-12 11:31:28 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
Fixed a bug that resulted in an error and no diagram beeing shown when
$("<span class='link'><a href='#' /></a>").find("a").css("color")
didn't return a color. Just fall back to the grid color then...
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-11 23:58:22 UTC (rev 202)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2010-12-12 11:31:28 UTC (rev 203)
@@ -184,7 +184,8 @@
dataType: "json",
type: "GET",
success: function(data) {
- $.plot(diagram, [{color: diagramColors.data, data: data}], options);
+ var color = diagramColors.data || options.grid.color;
+ $.plot(diagram, [{color: color, data: data}], options);
}
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2011-02-11 22:35:58
|
Revision: 292
http://openautomation.svn.sourceforge.net/openautomation/?rev=292&view=rev
Author: netzkind
Date: 2011-02-11 22:35:52 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
missed changes to diagram/structure_plugin.js
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-02-11 22:06:12 UTC (rev 291)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-02-11 22:35:52 UTC (rev 292)
@@ -63,7 +63,7 @@
width: {type: "string", required: false},
height: {type: "string", required: false},
unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {day: "day", week: "week", month: "month", year: "year"}},
+ series: {type: "list", required: false, list: {day: "1 day", week: "1 week", month: "1 month", year: "1 year"}},
refresh: {type: "numeric", required: false}
},
content: {type: "string", required: true}
@@ -122,7 +122,7 @@
attributes: {
rrd: {type: "string", required: true},
unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {day: "day", week: "week", month: "month", year: "year"}},
+ series: {type: "list", required: false, list: {day: "1 day", week: "1 week", month: "1 month", year: "1 year"}},
refresh: {type: "numeric", required: false}
},
content: {type: "string", required: true}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-05-09 15:19:36
|
Revision: 324
http://openautomation.svn.sourceforge.net/openautomation/?rev=324&view=rev
Author: makki1
Date: 2011-05-09 15:19:30 +0000 (Mon, 09 May 2011)
Log Message:
-----------
diagrams: Fix Grid timezone and add periods+datasource
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-05-08 20:26:11 UTC (rev 323)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-05-09 15:19:30 UTC (rev 324)
@@ -51,6 +51,8 @@
diagram.data("rrd", $p.attr("rrd"));
diagram.data("unit", $p.attr("unit") || "");
diagram.data("series", $p.attr("series") || "day");
+ diagram.data("period", $p.attr("period") || 1);
+ diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
diagram.data("label", page.textContent);
diagram.data("refresh", $p.attr("refresh"));
@@ -63,7 +65,9 @@
width: {type: "string", required: false},
height: {type: "string", required: false},
unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {day: "1 day", week: "1 week", month: "1 month", year: "1 year"}},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
refresh: {type: "numeric", required: false}
},
content: {type: "string", required: true}
@@ -99,6 +103,8 @@
diagram.data("rrd", $p.attr("rrd"));
diagram.data("unit", $p.attr("unit") || "");
diagram.data("series", $p.attr("series") || "day");
+ diagram.data("period", $p.attr("period") || 1);
+ diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
diagram.data("label", page.textContent);
diagram.data("refresh", $p.attr("refresh"));
@@ -130,8 +136,9 @@
var x = item.datapoint[0],
y = item.datapoint[1].toFixed(2);
- var dte = new Date(x);
-
+ //This is a mess but toLocaleString expects UTC again
+ var offset = new Date().getTimezoneOffset() * 60 * 1000;
+ var dte = new Date(x + offset);
showDiagramTooltip(item.pageX, item.pageY,
dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
}
@@ -161,7 +168,9 @@
attributes: {
rrd: {type: "string", required: true},
unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {day: "1 day", week: "1 week", month: "1 month", year: "1 year"}},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
refresh: {type: "numeric", required: false},
tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
},
@@ -190,12 +199,15 @@
var rrd = diagram.data("rrd");
var label = diagram.data("label");
var refresh = diagram.data("refresh");
+ var datasource = diagram.data("datasource") || "AVERAGE";
+ var period = diagram.data("period") || 1;
var series = {
- day: {label: "day", res: "300", start: "-1day", end: "now"},
- week: {label: "week", res: "1800", start: "-1week", end: "now"},
- month: {label: "month", res: "21600", start: "-1month", end: "now"},
- year: {label: "year", res: "432000", start: "-1year", end: "now"}
+ hour: {label: "hour", res: "60", start: "hour", end: "now"},
+ day: {label: "day", res: "300", start: "day", end: "now"},
+ week: {label: "week", res: "1800", start: "week", end: "now"},
+ month: {label: "month", res: "21600", start: "month", end: "now"},
+ year: {label: "year", res: "432000", start: "year", end: "now"},
};
var options = jQuery.extend(true,
@@ -230,11 +242,16 @@
if (s) {
// init
$.ajax({
- url: "/cgi-bin/rrdfetch?rrd=" + rrd + ".rrd&ds=AVERAGE&start=end" + s.start + "&end=" + s.end + "&res=" + s.res,
+ url: "/cgi-bin/rrdfetch?rrd=" + rrd + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
dataType: "json",
type: "GET",
success: function(data) {
var color = diagramColors.data || options.grid.color;
+ var offset = new Date().getTimezoneOffset() * 60 * 1000;
+ //TODO: find a better way
+ for (var j = 0; j < data.length; j++) {
+ data[j][0] -= offset;
+ }
$.plot(diagram, [{color: color, data: data}], options);
}
});
@@ -252,4 +269,5 @@
return false;
-}
\ No newline at end of file
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-30 11:50:23
|
Revision: 480
http://openautomation.svn.sourceforge.net/openautomation/?rev=480&view=rev
Author: mayerch
Date: 2011-10-30 11:50:17 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
Remove Log-Message - no place for it in a release
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-10-26 19:40:12 UTC (rev 479)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-10-30 11:50:17 UTC (rev 480)
@@ -255,7 +255,7 @@
data[j][1] = parseFloat( data[j][1][0] );
}
p = $.plot(diagram, [{color: color, data: data}], options);
- console.log( p, p.width(), p.height(), p.getPlotOffset() );
+ //console.log( p, p.width(), p.height(), p.getPlotOffset() );
}
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2011-12-12 17:46:19
|
Revision: 571
http://openautomation.svn.sourceforge.net/openautomation/?rev=571&view=rev
Author: j-n-k
Date: 2011-12-12 17:46:08 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
Fixed error in diagram_info update-function
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-12-12 17:32:32 UTC (rev 570)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2011-12-12 17:46:08 UTC (rev 571)
@@ -305,7 +305,11 @@
return ret_val;
},
- update: defaultUpdate,
+ update: function(e,d) {
+ var element = $(this);
+ var value = defaultUpdate( e, d, element );
+ element.addClass('switchUnpressed');
+ },
attributes: {
rrd: {type: "string", required: true},
unit: {type: "string", required: false},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-11-12 19:50:23
|
Revision: 1128
http://openautomation.svn.sourceforge.net/openautomation/?rev=1128&view=rev
Author: j-n-k
Date: 2012-11-12 19:50:17 +0000 (Mon, 12 Nov 2012)
Log Message:
-----------
Added series "fullday" to diagram plugin (suggested by NetFritz@KNXUF): display whole day (i.e. from 00:00-23:59)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-11-12 07:31:06 UTC (rev 1127)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-11-12 19:50:17 UTC (rev 1128)
@@ -384,6 +384,7 @@
var series = {
hour: {label: "hour", res: "60", start: "hour", end: "now"},
day: {label: "day", res: "300", start: "day", end: "now"},
+ fullday:{label: "fullday", res: "300", start: "day", end: "midnight+24hour"},
week: {label: "week", res: "1800", start: "week", end: "now"},
month: {label: "month", res: "21600", start: "month", end: "now"},
year: {label: "year", res: "432000", start: "year", end: "now"},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-03 20:45:50
|
Revision: 1406
http://openautomation.svn.sourceforge.net/openautomation/?rev=1406&view=rev
Author: mayerch
Date: 2013-02-03 20:45:44 +0000 (Sun, 03 Feb 2013)
Log Message:
-----------
Postpone diagram data recieval by 100 ms to speed up the start of the other part of the page
(See also https://sourceforge.net/tracker/?func=detail&aid=3338493&group_id=296426&atid=1251144)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-03 20:39:47 UTC (rev 1405)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-03 20:45:44 UTC (rev 1406)
@@ -368,6 +368,12 @@
}
function refreshDiagram(diagram, flotoptions, data) {
+ window.setTimeout(function(diagram, flotoptions, data) {
+ doRefreshDiagram(diagram, flotoptions, data);
+ }, 100, diagram, flotoptions, data );
+};
+
+function doRefreshDiagram(diagram, flotoptions, data) {
var diagram = $(diagram);
var config = jQuery.extend(true, {series: diagram.data("series")}, data || {});
@@ -469,7 +475,7 @@
if (typeof (refresh) != "undefined" && refresh) {
// reload regularly
window.setTimeout(function(diagram, flotoptions, data) {
- refreshDiagram(diagram, flotoptions, data);
+ doRefreshDiagram(diagram, flotoptions, data);
}, refresh * 1000, diagram, flotoptions, data );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-10 13:14:10
|
Revision: 1459
http://openautomation.svn.sourceforge.net/openautomation/?rev=1459&view=rev
Author: mayerch
Date: 2013-02-10 13:14:00 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
Fix for commit error at Revision: 1458 containted a wrong file... (Part 1)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-10 12:13:23 UTC (rev 1458)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-10 13:14:00 UTC (rev 1459)
@@ -193,14 +193,14 @@
bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
}
- refreshDiagram(bDiagram, bDiagramOpts);
+ //refreshDiagram(bDiagram, bDiagramOpts);
return false;
});
}
if ((oldType=="inline") || ($p.attr("previewlabels") == "true")) {
- refreshDiagram(diagram, {});
+ //refreshDiagram(diagram, {});
} else {
- refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
+ //refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
}
return ret_val;
@@ -341,7 +341,7 @@
bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
}
- refreshDiagram(bDiagram, bDiagramOpts);
+ //refreshDiagram(bDiagram, bDiagramOpts);
return false;
});
@@ -482,3 +482,13 @@
return false;
}
+
+$(window).bind( 'scrolltopage', function( event, page_id ){
+ var pagedivs = $('div', '#' + page_id);
+ for ( var i = 0; i < pagedivs.length; i++) { // check for inline diagrams &
+ // refresh
+ if (/diagram_inline/.test(pagedivs[i].className)) {
+ refreshDiagram(pagedivs[i]);
+ }
+ }
+});
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-02-02 18:59:12
|
Revision: 680
http://openautomation.svn.sourceforge.net/openautomation/?rev=680&view=rev
Author: j-n-k
Date: 2012-02-02 18:59:06 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Fixed wrong function name in diagramplugin (.setWidgetLayout instead of .setWidgetStyle)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-02 16:42:10 UTC (rev 679)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-02 18:59:06 UTC (rev 680)
@@ -33,7 +33,7 @@
var id = "diagram_" + uniqid();
var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ ret_val.setWidgetStyle($p).makeWidgetLabel($p);
var actor = $("<div class=\"actor\"><div class=\"diagram_inline\" id=\"" + id + "\">loading...</div></div>");
var diagram = $("#" + id, actor);
@@ -98,7 +98,7 @@
var id = "diagram_" + uniqid();
var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ ret_val.setWidgetStyle($p).makeWidgetLabel($p);
var actor = $("<div class=\"actor\"><div class=\"diagram_preview\" id=\"" + id + "\">loading...</div></div>");
var diagram = $("#" + id, actor);
@@ -220,7 +220,7 @@
var id = "diagram_" + uniqid();
var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ ret_val.setWidgetStyle($p).makeWidgetLabel($p);
var actor = '<div class="actor switchUnpressed ';
if ( $p.attr( 'align' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-02-05 17:53:43
|
Revision: 685
http://openautomation.svn.sourceforge.net/openautomation/?rev=685&view=rev
Author: j-n-k
Date: 2012-02-05 17:53:36 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
Fix broken diagram-refresh
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-05 17:11:48 UTC (rev 684)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-05 17:53:36 UTC (rev 685)
@@ -429,7 +429,7 @@
if (typeof (refresh) != "undefined" && refresh) {
// reload regularly
window.setTimeout(function(diagram, flotoptions, data) {
- refreshDiagram(diagram, flotoptions, data)
+ refreshDiagram(diagram, flotoptions, data);
}, refresh * 1000, diagram, flotoptions, data);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-02-05 18:40:20
|
Revision: 687
http://openautomation.svn.sourceforge.net/openautomation/?rev=687&view=rev
Author: j-n-k
Date: 2012-02-05 18:40:14 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
Fix broken diagram-Widget (forgot 2 renames in svn-copy)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-05 18:04:08 UTC (rev 686)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-05 18:40:14 UTC (rev 687)
@@ -98,7 +98,7 @@
var id = "diagram_" + uniqid();
var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetStyle($p).makeWidgetLabel($p);
+ ret_val.setWidgetLayout($p).makeWidgetLabel($p);
var actor = $("<div class=\"actor\"><div class=\"diagram_preview\" id=\"" + id + "\">loading...</div></div>");
var diagram = $("#" + id, actor);
@@ -220,7 +220,7 @@
var id = "diagram_" + uniqid();
var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetStyle($p).makeWidgetLabel($p);
+ ret_val.setWidgetLayout($p).makeWidgetLabel($p);
var actor = '<div class="actor switchUnpressed ';
if ( $p.attr( 'align' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-02-23 18:10:05
|
Revision: 714
http://openautomation.svn.sourceforge.net/openautomation/?rev=714&view=rev
Author: j-n-k
Date: 2012-02-23 18:09:58 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
reworked diagram-code, including diff by netsrac, new widget "diagram",
diagram_popup and diagram_inline still supported but deprecated
added short documentation at file-header
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-22 06:46:10 UTC (rev 713)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-02-23 18:09:58 UTC (rev 714)
@@ -19,422 +19,444 @@
* This plugins integrates flot (diagrams in javascript) into the visualization.
* server-side data-storage is rrd
*/
+
+ /**
+ * short documentation
+ *
+ * recommended widgets:
+ * - diagram
+ * - diagram_info
+ *
+ * deprecated widgets:
+ * - diagram_inline (use diagram with option previewlabels="true" instead)
+ * - diagram_popup (use diagram with option popup="true" instead)
+ *
+ * attributes:
+ * - rrd: required, name of RRD
+ * - unit: optional, unit for axis-labels
+ * - series: optional, "hour", "day" (default), "week", "month", "year"
+ * - period: optional, ?
+ * - datasource: optional, RRD-datasource, "MIN", "AVERAGE" (default), "MAX"
+ * - refresh: optional, refresh-rate in seconds, no refresh if missing
+ * - yaxismin, yaxismax: optional, limits for y-axis
+ * - linecolor, gridcolor: optional, color for dataline and grid, HTML-colorcode
+ * - width, height: optional, width and height of "inline"-diagram
+ * - previewlabels: optional, show labels on "inline"-diagram
+ * - popup: optional, make diagram clickable and open popup
+ *
+ * functions:
+ * - createDiagram(page, path, oldType)
+ * - refreshDiagram(diagram, flotoptions, data)
+ *
+*/
+
+
$("body").append("<script type=\"text/javascript\" src=\"plugins/diagram/flot/jquery.flot.js\"></script>");
-VisuDesign_Custom.prototype.addCreator("diagram_inline", {
- create: function( page, path ) {
- var $p = $(page);
+function createDiagram( page, path, oldType ) {
+ var $p = $(page);
- function uniqid() {
- var newDate = new Date;
- return newDate.getTime();
- }
+ function uniqid() {
+ var newDate = new Date;
+ return newDate.getTime();
+ }
- var id = "diagram_" + uniqid();
+ var id = "diagram_" + uniqid();
- var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ var ret_val = $('<div class="widget clearfix diagram" />');
+ ret_val.setWidgetLayout($p).makeWidgetLabel($p);
- var actor = $("<div class=\"actor\"><div class=\"diagram_inline\" id=\"" + id + "\">loading...</div></div>");
- var diagram = $("#" + id, actor);
+ var actor = $("<div class=\"actor\"><div class=\"diagram_inline\" id=\"" + id + "\">loading...</div></div>");
+ var diagram = $("#" + id, actor);
- if ($p.attr("width")) {
- diagram.css("width", $p.attr("width"));
- }
- if ($p.attr("height")) {
- diagram.css("height", $p.attr("height"));
- }
+ if ($p.attr("width")) {
+ diagram.css("width", $p.attr("width"));
+ }
+ if ($p.attr("height")) {
+ diagram.css("height", $p.attr("height"));
+ }
- ret_val.append(actor);
+ ret_val.append(actor);
- diagram.data("id", id);
- diagram.data("rrd", $p.attr("rrd"));
- diagram.data("unit", $p.attr("unit") || "");
- diagram.data("series", $p.attr("series") || "day");
- diagram.data("period", $p.attr("period") || 1);
- diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- diagram.data("label", $('.label', ret_val).text() || '');
- diagram.data("refresh", $p.attr("refresh"));
- diagram.data("yaxismin", $p.attr("yaxismin"));
- diagram.data("yaxismax", $p.attr("yaxismax"));
- diagram.data("linecolor", $p.attr("linecolor") || "");
- diagram.data("gridcolor", $p.attr("gridcolor") || "");
+ diagram.data("id", id);
+ diagram.data("rrd", $p.attr("rrd"));
+ diagram.data("unit", $p.attr("unit") || "");
+ diagram.data("series", $p.attr("series") || "day");
+ diagram.data("period", $p.attr("period") || 1);
+ diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
+ diagram.data("label", $('.label', ret_val).text() || '');
+ diagram.data("refresh", $p.attr("refresh"));
+ diagram.data("yaxismin", $p.attr("yaxismin"));
+ diagram.data("yaxismax", $p.attr("yaxismax"));
+ diagram.data("linecolor", $p.attr("linecolor") || "");
+ diagram.data("gridcolor", $p.attr("gridcolor") || "");
- refreshDiagram(diagram, {});
-
- return ret_val;
- },
- attributes: {
- rrd: {type: "string", required: true},
- width: {type: "string", required: false},
- height: {type: "string", required: false},
- unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
- period: {type: "numeric", required: false},
- datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
- refresh: {type: "numeric", required: false},
- yaxismin: {type: "numeric", required: false},
- yaxismax: {type: "numeric", required: false},
- linecolor: {type: "string", required: false},
- colspan: {type: "numeric", required: false},
- rowspan: {type: "numeric", required: false},
- gridcolor: {type: "string", required: false}
- },
- elements: {
- label: { type: 'string', required: false, multi: false }
- },
- content: false
-});
-
-VisuDesign_Custom.prototype.addCreator("diagram_popup", {
- create: function( page, path ) {
- var $p = $(page);
-
- function uniqid() {
- var newDate = new Date;
- return newDate.getTime();
- }
-
- var id = "diagram_" + uniqid();
-
- var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
- var actor = $("<div class=\"actor\"><div class=\"diagram_preview\" id=\"" + id + "\">loading...</div></div>");
- var diagram = $("#" + id, actor);
+ diagram.addClass("clickable");
+ var data = jQuery.extend({}, diagram.data());
- if ($p.attr("width")) {
- diagram.css("width", $p.attr("width"));
- }
- if ($p.attr("height")) {
- diagram.css("height", $p.attr("height"));
- }
-
- ret_val.append(actor);
-
- diagram.data("id", id);
- diagram.data("rrd", $p.attr("rrd"));
- diagram.data("unit", $p.attr("unit") || "");
- diagram.data("series", $p.attr("series") || "day");
- diagram.data("period", $p.attr("period") || 1);
- diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- diagram.data("label", $('.label', ret_val).text() || '');
- diagram.data("refresh", $p.attr("refresh"));
- diagram.data("yaxismin", $p.attr("yaxismin"));
- diagram.data("yaxismax", $p.attr("yaxismax"));
- diagram.data("linecolor", $p.attr("linecolor") || "");
- diagram.data("gridcolor", $p.attr("gridcolor") || "");
-
- var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
-
- diagram.addClass("clickable");
- var data = jQuery.extend({}, diagram.data());
-
- diagram.bind("click", function() {
- bDiagram.data(data);
- bDiagram.css({height: "90%"});
-
- showPopup("unknown", {title: page.textContent, content: bDiagram});
- bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
+ if ((oldType=="popup") || ($p.attr("popup")=="true")) {
+ diagram.bind("click", function() {
+ bDiagram.data(data);
+ bDiagram.css({height: "90%"});
+ showPopup("unknown", {title: page.textContent, content: bDiagram});
+ bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
- var bDiagramOpts = {yaxis: {labelWidth: null}};
- if ($p.attr("tooltip") == "true") {
- // if we want to display a tooltip, we need to listen to the event
- var previousPoint = null;
- jQuery(bDiagram).bind("plothover", function (event, pos, item) {
- jQuery("#x").text(pos.x.toFixed(2));
- jQuery("#y").text(pos.y.toFixed(2));
+ var bDiagramOpts = {yaxis: {labelWidth: null}};
+ if ($p.attr("tooltip") == "true") {
+ // if we want to display a tooltip, we need to listen to the event
+ var previousPoint = null;
+ jQuery(bDiagram).bind("plothover", function (event, pos, item) {
+ jQuery("#x").text(pos.x.toFixed(2));
+ jQuery("#y").text(pos.y.toFixed(2));
- if (item) {
- if (previousPoint != item.datapoint) {
- previousPoint = item.datapoint;
-
- $("#diagramTooltip").remove();
- var x = item.datapoint[0],
- y = item.datapoint[1].toFixed(2);
-
- //This is a mess but toLocaleString expects UTC again
- var offset = new Date().getTimezoneOffset() * 60 * 1000;
- var dte = new Date(x + offset);
- showDiagramTooltip(item.pageX, item.pageY,
- dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
- }
- }
- else {
- $("#diagramTooltip").remove();
- previousPoint = null;
- }
-
- })
- .bind("click", function(event) {
- // don't let the popup know about the click, or it will close on touch-displays
- event.stopPropagation();
- });
-
- bDiagramOpts = jQuery.extend(bDiagramOpts, {grid: {hoverable: true, clickable: true} });
+ if (item) {
+ if (previousPoint != item.datapoint) {
+ previousPoint = item.datapoint;
+
+ $("#diagramTooltip").remove();
+ var x = item.datapoint[0],
+ y = item.datapoint[1].toFixed(2);
+
+ //This is a mess but toLocaleString expects UTC again
+ var offset = new Date().getTimezoneOffset() * 60 * 1000;
+ var dte = new Date(x + offset);
+ showDiagramTooltip(item.pageX, item.pageY,
+ dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
}
-
- refreshDiagram(bDiagram, bDiagramOpts);
- return false;
+ } else {
+ $("#diagramTooltip").remove();
+ previousPoint = null;
+ }
+ })
+ .bind("click", function(event) {
+ // don't let the popup know about the click, or it will close on touch-displays
+ event.stopPropagation();
});
+
+ bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
+ }
- refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
+ refreshDiagram(bDiagram, bDiagramOpts);
+ return false;
+ });
+ }
+ if ((oldType=="inline") || ($p.attr("previewlabels") == "true")) {
+ refreshDiagram(diagram, {});
+ } else {
+ refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
+ }
- return ret_val;
- },
- attributes: {
- rrd: {type: "string", required: true},
- unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
- period: {type: "numeric", required: false},
- datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
- refresh: {type: "numeric", required: false},
- yaxismin: {type: "numeric", required: false},
- yaxismax: {type: "numeric", required: false},
- linecolor: {type: "string", required: false},
- gridcolor: {type: "string", required: false},
- tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
- },
- elements: {
- label: { type: 'string', required: false, multi: false }
- },
- content: false
+ return ret_val;
+}
+
+
+VisuDesign_Custom.prototype.addCreator("diagram_inline", {
+ create: function( page, path ) {
+ return createDiagram(page, path, "inline");
+ },
+ attributes: {
+ rrd: {type: "string", required: true},
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ unit: {type: "string", required: false},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
+ refresh: {type: "numeric", required: false},
+ yaxismin: {type: "numeric", required: false},
+ yaxismax: {type: "numeric", required: false},
+ linecolor: {type: "string", required: false},
+ colspan: {type: "numeric", required: false},
+ rowspan: {type: "numeric", required: false},
+ gridcolor: {type: "string", required: false}
+ },
+ elements: {
+ label: { type: 'string', required: false, multi: false }
+ },
+ content: false
});
+VisuDesign_Custom.prototype.addCreator("diagram_popup", {
+ create: function(page,path) {
+ return createDiagram(page, path, "popup");
+ },
+ attributes: {
+ rrd: {type: "string", required: true},
+ unit: {type: "string", required: false},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
+ refresh: {type: "numeric", required: false},
+ yaxismin: {type: "numeric", required: false},
+ yaxismax: {type: "numeric", required: false},
+ linecolor: {type: "string", required: false},
+ gridcolor: {type: "string", required: false},
+ tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ },
+ elements: {
+ label: { type: 'string', required: false, multi: false }
+ },
+ content: false
+});
+
+VisuDesign_Custom.prototype.addCreator("diagram", {
+ create: function(page,path) {
+ return createDiagram(page, path, "none");
+ },
+ attributes: {
+ rrd: {type: "string", required: true},
+ unit: {type: "string", required: false},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
+ refresh: {type: "numeric", required: false},
+ yaxismin: {type: "numeric", required: false},
+ yaxismax: {type: "numeric", required: false},
+ linecolor: {type: "string", required: false},
+ gridcolor: {type: "string", required: false},
+ tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ previewlabels: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ popup: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ },
+ elements: {
+ label: { type: 'string', required: false, multi: false }
+ },
+ content: false
+});
+
VisuDesign_Custom.prototype.addCreator("diagram_info", {
- create: function( page, path ) {
- var $p = $(page);
+ create: function( page, path ) {
+ var $p = $(page);
- var address = {};
- $p.find('address').each( function(){
- var src = this.textContent;
- ga_list.push( src )
- address[ '_' + src ] = [ this.getAttribute('transform') ];
- });
+ var address = {};
+ $p.find('address').each( function(){
+ var src = this.textContent;
+ ga_list.push( src )
+ address[ '_' + src ] = [ this.getAttribute('transform') ];
+ });
- function uniqid() {
- var newDate = new Date;
- return newDate.getTime();
- }
+ function uniqid() {
+ var newDate = new Date;
+ return newDate.getTime();
+ }
- var id = "diagram_" + uniqid();
+ var id = "diagram_" + uniqid();
- var ret_val = $('<div class="widget clearfix diagram" />');
- ret_val.setWidgetLayout($p).makeWidgetLabel($p);
+ var ret_val = $('<div class="widget clearfix diagram" />');
+ ret_val.setWidgetLayout($p).makeWidgetLabel($p);
- var actor = '<div class="actor switchUnpressed ';
- if ( $p.attr( 'align' ) )
- actor += $p.attr( 'align' );
- actor += '">';
- var map = $p.attr('mapping');
- if( mappings[map] && mappings[map][value] )
- actor += '<div class="value">' + mappings[map][value] + '</div>';
- else
- actor += '<div class="value">-</div>';
- actor += '</div>';
+ var actor = '<div class="actor switchUnpressed ';
+ if ( $p.attr( 'align' ) )
+ actor += $p.attr( 'align' );
+ actor += '">';
+ var map = $p.attr('mapping');
+ if( mappings[map] && mappings[map][value] )
+ actor += '<div class="value">' + mappings[map][value] + '</div>';
+ else
+ actor += '<div class="value">-</div>';
+ actor += '</div>';
- var $actor = $(actor).data({
- 'address' : address,
- 'format' : $p.attr('format'),
- 'mapping' : $p.attr('mapping'),
- 'styling' : $p.attr('styling')
- });
- for( var addr in address ) $actor.bind( addr, this.update );
+ var $actor = $(actor).data({
+ 'address' : address,
+ 'format' : $p.attr('format'),
+ 'mapping' : $p.attr('mapping'),
+ 'styling' : $p.attr('styling')
+ });
+ for( var addr in address ) $actor.bind( addr, this.update );
- ret_val.append($actor);
+ ret_val.append($actor);
- $actor.addClass("clickable");
+ $actor.addClass("clickable");
- var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
+ var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
- bDiagram.data("id", id);
- bDiagram.data("rrd", $p.attr("rrd"));
- bDiagram.data("unit", $p.attr("unit") || "");
- bDiagram.data("series", $p.attr("series") || "day");
- bDiagram.data("period", $p.attr("period") || 1);
- bDiagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- bDiagram.data("label", $('.label', ret_val).text() || '');
- bDiagram.data("refresh", $p.attr("refresh"));
- bDiagram.data("yaxismin", $p.attr("yaxismin"));
- bDiagram.data("yaxismax", $p.attr("yaxismax"));
- bDiagram.data("linecolor", $p.attr("linecolor") || "");
- bDiagram.data("gridcolor", $p.attr("gridcolor") || "");
+ bDiagram.data("id", id);
+ bDiagram.data("rrd", $p.attr("rrd"));
+ bDiagram.data("unit", $p.attr("unit") || "");
+ bDiagram.data("series", $p.attr("series") || "day");
+ bDiagram.data("period", $p.attr("period") || 1);
+ bDiagram.data("datasource", $p.attr("datasource") || "AVERAGE");
+ bDiagram.data("label", $('.label', ret_val).text() || '');
+ bDiagram.data("refresh", $p.attr("refresh"));
+ bDiagram.data("yaxismin", $p.attr("yaxismin"));
+ bDiagram.data("yaxismax", $p.attr("yaxismax"));
+ bDiagram.data("linecolor", $p.attr("linecolor") || "");
+ bDiagram.data("gridcolor", $p.attr("gridcolor") || "");
- var data = jQuery.extend({}, bDiagram.data());
+ var data = jQuery.extend({}, bDiagram.data());
- $actor.bind("click", function() {
- bDiagram.data(data);
- bDiagram.css({height: "90%"});
+ $actor.bind("click", function() {
+ bDiagram.data(data);
+ bDiagram.css({height: "90%"});
- showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
- bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
+ showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
+ bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
- var bDiagramOpts = {yaxis: {labelWidth: null}};
- if ($p.attr("tooltip") == "true") {
- // if we want to display a tooltip, we need to listen to the event
- var previousPoint = null;
- jQuery(bDiagram).bind("plothover", function (event, pos, item) {
- jQuery("#x").text(pos.x.toFixed(2));
- jQuery("#y").text(pos.y.toFixed(2));
-
- if (item) {
- if (previousPoint != item.datapoint) {
- previousPoint = item.datapoint;
-
- $("#diagramTooltip").remove();
- var x = item.datapoint[0],
- y = item.datapoint[1].toFixed(2);
-
- //This is a mess but toLocaleString expects UTC again
- var offset = new Date().getTimezoneOffset() * 60 * 1000;
- var dte = new Date(x + offset);
- showDiagramTooltip(item.pageX, item.pageY,
- dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
- }
- }
- else {
- $("#diagramTooltip").remove();
- previousPoint = null;
- }
-
- })
- .bind("click", function(event) {
- // don't let the popup know about the click, or it will close on touch-displays
- event.stopPropagation();
- });
-
- bDiagramOpts = jQuery.extend(bDiagramOpts, {grid: {hoverable: true, clickable: true} });
+ var bDiagramOpts = {yaxis: {labelWidth: null}};
+ if ($p.attr("tooltip") == "true") {
+ // if we want to display a tooltip, we need to listen to the event
+ var previousPoint = null;
+ jQuery(bDiagram).bind("plothover", function (event, pos, item) {
+ jQuery("#x").text(pos.x.toFixed(2));
+ jQuery("#y").text(pos.y.toFixed(2));
+
+ if (item) {
+ if (previousPoint != item.datapoint) {
+ previousPoint = item.datapoint;
+
+ $("#diagramTooltip").remove();
+ var x = item.datapoint[0],
+ y = item.datapoint[1].toFixed(2);
+
+ //This is a mess but toLocaleString expects UTC again
+ var offset = new Date().getTimezoneOffset() * 60 * 1000;
+ var dte = new Date(x + offset);
+ showDiagramTooltip(item.pageX, item.pageY,
+ dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
}
-
- refreshDiagram(bDiagram, bDiagramOpts);
- return false;
+ } else {
+ $("#diagramTooltip").remove();
+ previousPoint = null;
+ }
+ })
+ .bind("click", function(event) {
+ // don't let the popup know about the click, or it will close on touch-displays
+ event.stopPropagation();
});
+
+ bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
+ }
- return ret_val;
- },
- update: function(e,d) {
- var element = $(this);
- var value = defaultUpdate( e, d, element );
- element.addClass('switchUnpressed');
- },
- attributes: {
- rrd: {type: "string", required: true},
- unit: {type: "string", required: false},
- series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
- period: {type: "numeric", required: false},
- datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
- refresh: {type: "numeric", required: false},
- tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
- linecolor: {type: "string", required: false},
- gridcolor: {type: "string", required: false},
- yaxismin: {type: "numeric", required: false},
- yaxismax: {type: "numeric", required: false},
- format: { type: 'format', required: false },
- mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
- },
- elements: {
- label: { type: 'string', required: true, multi: false },
- address: { type: 'address', required: true, multi: true }
- },
- content: {type: "string", required: true}
+ refreshDiagram(bDiagram, bDiagramOpts);
+ return false;
+ });
+
+ return ret_val;
+ },
+ update: function(e,d) {
+ var element = $(this);
+ var value = defaultUpdate( e, d, element );
+ element.addClass('switchUnpressed');
+ },
+ attributes: {
+ rrd: {type: "string", required: true},
+ unit: {type: "string", required: false},
+ series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
+ period: {type: "numeric", required: false},
+ datasource: {type: "list", required: false, list: {'MIN': "Min", 'AVERAGE': "Avg", 'MAX': "Max"}},
+ refresh: {type: "numeric", required: false},
+ tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ linecolor: {type: "string", required: false},
+ gridcolor: {type: "string", required: false},
+ yaxismin: {type: "numeric", required: false},
+ yaxismax: {type: "numeric", required: false},
+ format: { type: 'format', required: false },
+ mapping: { type: 'mapping', required: false },
+ styling: { type: 'styling', required: false }
+ },
+ elements: {
+ label: { type: 'string', required: true, multi: false },
+ address: { type: 'address', required: true, multi: true }
+ },
+ content: {type: "string", required: true}
});
diagramColors = {
- data: $("<span class='link'><a href='#' /></a>").find("a").css("color")
+ data: $("<span class='link'><a href='#' /></a>").find("a").css("color")
};
function showDiagramTooltip(x, y, contents) {
- $('<div id="diagramTooltip">' + contents + '</div>').css( {
- position: 'absolute',
- display: 'none',
- top: y + 5,
- left: x + 5,
- }).appendTo("body").fadeIn(200);
+ $('<div id="diagramTooltip">' + contents + '</div>').css( {
+ position: 'absolute',
+ display: 'none',
+ top: y + 5,
+ left: x + 5,
+ }).appendTo("body").fadeIn(200);
}
-
function refreshDiagram(diagram, flotoptions, data) {
- var diagram = $(diagram);
- var config = jQuery.extend(true, {series: diagram.data("series")}, data || {});
+ var diagram = $(diagram);
+ var config = jQuery.extend(true, {series: diagram.data("series")}, data || {});
- var unit = diagram.data("unit");
- var rrd = diagram.data("rrd");
- var label = diagram.data("label");
- var refresh = diagram.data("refresh");
- var datasource = diagram.data("datasource") || "AVERAGE";
- var period = diagram.data("period") || 1;
- var linecolor = diagram.data("linecolor") || diagramColors.data;
- var gridcolor = diagram.data("gridcolor") || "#81664B";
- var yaxismin = diagram.data("yaxismin") || null;
- var yaxismax = diagram.data("yaxismax") || null;
+ var unit = diagram.data("unit");
+ var rrd = diagram.data("rrd");
+ var label = diagram.data("label");
+ var refresh = diagram.data("refresh");
+ var datasource = diagram.data("datasource") || "AVERAGE";
+ var period = diagram.data("period") || 1;
+ var linecolor = diagram.data("linecolor") || diagramColors.data;
+ var gridcolor = diagram.data("gridcolor") || "#81664B";
+ var yaxismin = diagram.data("yaxismin") || null;
+ var yaxismax = diagram.data("yaxismax") || null;
- var series = {
- hour: {label: "hour", res: "60", start: "hour", end: "now"},
- day: {label: "day", res: ...
[truncated message content] |
|
From: <j-...@us...> - 2012-04-27 12:56:30
|
Revision: 766
http://openautomation.svn.sourceforge.net/openautomation/?rev=766&view=rev
Author: j-n-k
Date: 2012-04-27 12:56:20 +0000 (Fri, 27 Apr 2012)
Log Message:
-----------
1) basic functionality for more than one rrd/diagram
2) fix bug in refresh
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-04-26 08:40:50 UTC (rev 765)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-04-27 12:56:20 UTC (rev 766)
@@ -52,7 +52,6 @@
$("body").append("<script type=\"text/javascript\" src=\"plugins/diagram/flot/jquery.flot.js\"></script>");
-
function createDiagram( page, path, oldType ) {
var $p = $(page);
@@ -63,6 +62,19 @@
var id = "diagram_" + uniqid();
+ var rrd = {};
+ var rrdnum = 0;
+ if ($p.attr('rrd')) {
+ rrd[ '_'+$p.attr('rrd') ] = [ $p.attr('linecolor') || "", ""];
+ rrdnum=1;
+ } else {
+ $p.find('rrd').each( function() {
+ var src = this.textContent;
+ rrd[ '_'+src ] = [ this.getAttribute('color'), this.getAttribute('label') || src ];
+ rrdnum ++;
+ });
+ }
+
var ret_val = $('<div class="widget clearfix diagram" />');
ret_val.setWidgetLayout($p).makeWidgetLabel($p);
@@ -83,7 +95,8 @@
ret_val.append(actor);
diagram.data("id", id);
- diagram.data("rrd", $p.attr("rrd"));
+ diagram.data("rrd", rrd);
+ diagram.data("rrdnum", rrdnum);
diagram.data("unit", $p.attr("unit") || "");
diagram.data("series", $p.attr("series") || "day");
diagram.data("period", $p.attr("period") || 1);
@@ -92,7 +105,6 @@
diagram.data("refresh", $p.attr("refresh"));
diagram.data("yaxismin", $p.attr("yaxismin"));
diagram.data("yaxismax", $p.attr("yaxismax"));
- diagram.data("linecolor", $p.attr("linecolor") || "");
diagram.data("gridcolor", $p.attr("gridcolor") || "");
var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
@@ -104,9 +116,9 @@
diagram.bind("click", function() {
bDiagram.data(data);
bDiagram.css({height: "90%"});
- showPopup("unknown", {title: page.textContent, content: bDiagram});
+ showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
-
+ bDiagram.empty();
var bDiagramOpts = {yaxis: {labelWidth: null}};
if ($p.attr("tooltip") == "true") {
// if we want to display a tooltip, we need to listen to the event
@@ -161,7 +173,7 @@
return createDiagram(page, path, "inline");
},
attributes: {
- rrd: {type: "string", required: true},
+ rrd: {type: "string", required: false},
width: {type: "string", required: false},
height: {type: "string", required: false},
unit: {type: "string", required: false},
@@ -177,7 +189,8 @@
gridcolor: {type: "string", required: false}
},
elements: {
- label: { type: 'string', required: false, multi: false }
+ label: { type: 'string', required: false, multi: false },
+ rrd: { type: 'string', required: false, multi: true },
},
content: false
});
@@ -187,7 +200,7 @@
return createDiagram(page, path, "popup");
},
attributes: {
- rrd: {type: "string", required: true},
+ rrd: {type: "string", required: false},
unit: {type: "string", required: false},
series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
period: {type: "numeric", required: false},
@@ -202,7 +215,8 @@
height: {type: "string", required: false},
},
elements: {
- label: { type: 'string', required: false, multi: false }
+ label: { type: 'string', required: false, multi: false },
+ rrd: { type: 'string', required: false, multi: true },
},
content: false
});
@@ -212,7 +226,7 @@
return createDiagram(page, path, "none");
},
attributes: {
- rrd: {type: "string", required: true},
+ rrd: {type: "string", required: false},
unit: {type: "string", required: false},
series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
period: {type: "numeric", required: false},
@@ -229,7 +243,8 @@
popup: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
},
elements: {
- label: { type: 'string', required: false, multi: false }
+ label: { type: 'string', required: false, multi: false },
+ rrd: { type: 'string', required: false, multi: true },
},
content: false
});
@@ -244,7 +259,20 @@
ga_list.push( src )
address[ '_' + src ] = [ this.getAttribute('transform') ];
});
-
+
+ var rrd = {};
+ var rrdnum = 0;
+ if ($p.attr('rrd')) {
+ rrd[ '_'+$p.attr('rrd') ] = [ $p.attr('linecolor') || "", ""];
+ rrdnum=1;
+ } else {
+ $p.find('rrd').each( function() {
+ var src = this.textContent;
+ rrd[ '_'+src ] = [ this.getAttribute('color'), this.getAttribute('label') || src ];
+ rrdnum ++;
+ });
+ }
+
function uniqid() {
var newDate = new Date;
return newDate.getTime();
@@ -281,7 +309,8 @@
var bDiagram = $("<div class=\"diagram\" id=\"" + id + "_big\"/>");
bDiagram.data("id", id);
- bDiagram.data("rrd", $p.attr("rrd"));
+ bDiagram.data("rrd", rrd);
+ bDiagram.data("rrdnum", rrdnum);
bDiagram.data("unit", $p.attr("unit") || "");
bDiagram.data("series", $p.attr("series") || "day");
bDiagram.data("period", $p.attr("period") || 1);
@@ -290,7 +319,6 @@
bDiagram.data("refresh", $p.attr("refresh"));
bDiagram.data("yaxismin", $p.attr("yaxismin"));
bDiagram.data("yaxismax", $p.attr("yaxismax"));
- bDiagram.data("linecolor", $p.attr("linecolor") || "");
bDiagram.data("gridcolor", $p.attr("gridcolor") || "");
var data = jQuery.extend({}, bDiagram.data());
@@ -301,7 +329,7 @@
showPopup("unknown", {title: bDiagram.data('label'), content: bDiagram});
bDiagram.parent("div").css({height: "100%", width: "90%", margin: "auto"}); // define parent as 100%!
-
+ bDiagram.empty();
var bDiagramOpts = {yaxis: {labelWidth: null}};
if ($p.attr("tooltip") == "true") {
// if we want to display a tooltip, we need to listen to the event
@@ -349,7 +377,7 @@
element.addClass('switchUnpressed');
},
attributes: {
- rrd: {type: "string", required: true},
+ rrd: {type: "string", required: false},
unit: {type: "string", required: false},
series: {type: "list", required: false, list: {hour: "hours", day: "days", week: "weeks", month: "months", year: "years"}},
period: {type: "numeric", required: false},
@@ -360,13 +388,14 @@
gridcolor: {type: "string", required: false},
yaxismin: {type: "numeric", required: false},
yaxismax: {type: "numeric", required: false},
- format: { type: 'format', required: false },
- mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
+ format: { type: 'format', required: false },
+ mapping: { type: 'mapping', required: false },
+ styling: { type: 'styling', required: false }
},
elements: {
- label: { type: 'string', required: true, multi: false },
- address: { type: 'address', required: true, multi: true }
+ label: { type: 'string', required: false, multi: false },
+ address: { type: 'address', required: true, multi: true },
+ rrd: { type: 'string', required: false, multi: true },
},
content: {type: "string", required: true}
});
@@ -390,11 +419,12 @@
var unit = diagram.data("unit");
var rrd = diagram.data("rrd");
+ var rrdnum = diagram.data("rrdnum");
var label = diagram.data("label");
var refresh = diagram.data("refresh");
var datasource = diagram.data("datasource") || "AVERAGE";
var period = diagram.data("period") || 1;
- var linecolor = diagram.data("linecolor") || diagramColors.data;
+ //var linecolor = diagram.data("linecolor") || diagramColors.data;
var gridcolor = diagram.data("gridcolor") || "#81664B";
var yaxismin = diagram.data("yaxismin") || null;
var yaxismax = diagram.data("yaxismax") || null;
@@ -437,28 +467,51 @@
if (s) {
// init
- $.ajax({
- url: "/cgi-bin/rrdfetch?rrd=" + rrd + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
- dataType: "json",
- type: "GET",
- success: function(data) {
- var color = linecolor || options.grid.color;
- var offset = new Date().getTimezoneOffset() * 60 * 1000;
- //TODO: find a better way
- for (var j = 0; j < data.length; j++) {
- data[j][0] -= offset;
- data[j][1] = parseFloat( data[j][1][0] );
+ var num = 0;
+ var fulldata = [];
+ var rrdloaded = 0;
+ $.each(rrd, function(index, value) {
+ var src = index.slice(1);
+ var linecolor = value[0];
+ var label = value[1];
+ var idx = num;
+
+ $.ajax({
+ url: "/cgi-bin/rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
+ dataType: "json",
+ type: "GET",
+ success: function(data) {
+ var color = linecolor || options.grid.color;
+ var offset = new Date().getTimezoneOffset() * 60 * 1000;
+ //TODO: find a better way
+ for (var j = 0; j < data.length; j++) {
+ data[j][0] -= offset;
+ data[j][1] = parseFloat( data[j][1][0] );
+ }
+ fulldata[idx] = {label: label, color: color, data: data};
+ rrdloaded++;
+ if (rrdloaded==rrdnum) {
+ if (!diagram.data("plotted")) {
+ diagram.data("PLOT", $.plot(diagram, fulldata, options));
+ diagram.data("plotted", true);
+ } else {
+ var PLOT = diagram.data("PLOT");
+ PLOT.setData(fulldata);
+ PLOT.setupGrid();
+ PLOT.draw();
+ }
+ }
+ //console.log( p, p.width(), p.height(), p.getPlotOffset() );
}
- p = $.plot(diagram, [{color: color, data: data}], options);
- //console.log( p, p.width(), p.height(), p.getPlotOffset() );
- }
+ });
+ num++;
});
-
+
if (typeof (refresh) != "undefined" && refresh) {
// reload regularly
window.setTimeout(function(diagram, flotoptions, data) {
refreshDiagram(diagram, flotoptions, data);
- }, refresh * 1000, diagram, flotoptions, data);
+ }, refresh * 1000, diagram, flotoptions, data );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-08-31 18:46:42
|
Revision: 994
http://openautomation.svn.sourceforge.net/openautomation/?rev=994&view=rev
Author: j-n-k
Date: 2012-08-31 18:46:36 +0000 (Fri, 31 Aug 2012)
Log Message:
-----------
Added optional title to diagram-plugins:
attribute title="foo" sets the popup-title to "foo" instead of the content
of the label-element
(important for configs where label-elements are not used and/or were
replaced by text-widgets)
if title is ommitted the label-element content is used or the title is empty
if no label element exists (i.e. existings config can be used without any
changes)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-08-29 13:50:29 UTC (rev 993)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-08-31 18:46:36 UTC (rev 994)
@@ -43,6 +43,7 @@
* - width, height: optional, width and height of "inline"-diagram
* - previewlabels: optional, show labels on "inline"-diagram
* - popup: optional, make diagram clickable and open popup
+ * - title: optional, diagram title (overrides label-content)
*
* functions:
* - createDiagram(page, path, oldType)
@@ -130,7 +131,11 @@
diagram.data("series", $p.attr("series") || "day");
diagram.data("period", $p.attr("period") || 1);
diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- diagram.data("label", $('.label', ret_val).text() || '');
+ if ($p.attr("title")) {
+ diagram.data("label", $p.attr("title"));
+ } else {
+ diagram.data("label", $('.label', ret_val).text() || '');
+ }
diagram.data("refresh", $p.attr("refresh"));
diagram.data("gridcolor", $p.attr("gridcolor") || "");
@@ -213,7 +218,8 @@
linecolor: {type: "string", required: false},
colspan: {type: "numeric", required: false},
rowspan: {type: "numeric", required: false},
- gridcolor: {type: "string", required: false}
+ gridcolor: {type: "string", required: false},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -240,6 +246,7 @@
tooltip: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
width: {type: "string", required: false},
height: {type: "string", required: false},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -268,6 +275,7 @@
height: {type: "string", required: false},
previewlabels: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
popup: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
@@ -329,7 +337,12 @@
bDiagram.data("series", $p.attr("series") || "day");
bDiagram.data("period", $p.attr("period") || 1);
bDiagram.data("datasource", $p.attr("datasource") || "AVERAGE");
- bDiagram.data("label", $('.label', ret_val).text() || '');
+ if ($p.attr("title")) {
+ bDiagram.data("label", $p.attr("title"));
+ } else {
+ bDiagram.data("label", $('.label', ret_val).text() || '');
+ }
+
bDiagram.data("refresh", $p.attr("refresh"));
bDiagram.data("gridcolor", $p.attr("gridcolor") || "");
@@ -402,7 +415,8 @@
yaxismax: {type: "numeric", required: false},
format: { type: 'format', required: false },
mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false }
+ styling: { type: 'styling', required: false },
+ title: {type: "string", required: false}
},
elements: {
label: { type: 'string', required: false, multi: false },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-09-27 18:07:38
|
Revision: 1021
http://openautomation.svn.sourceforge.net/openautomation/?rev=1021&view=rev
Author: j-n-k
Date: 2012-09-27 18:07:29 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
Fixed "undefined" in diagram tooltip (axis-unit is displayed)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-09-27 08:56:47 UTC (rev 1020)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-09-27 18:07:29 UTC (rev 1021)
@@ -72,7 +72,7 @@
var unit = this.getAttribute('unit') || "";
axes[ axesnum ] = { axisLabel:this.getAttribute('label') || null, position: this.getAttribute('position') || "left",
min: this.getAttribute('min') || null, max: this.getAttribute('max') || null,
- tickFormatter: function (v, axis) { return v.toFixed(axis.tickDecimals)+unit; }
+ unit: unit, tickFormatter: function (v, axis) { return v.toFixed(axis.tickDecimals)+unit; }
};
axesnames ['_'+name] = axesnum+1;
axesnum ++;
@@ -176,7 +176,7 @@
var offset = new Date().getTimezoneOffset() * 60 * 1000;
var dte = new Date(x + offset);
showDiagramTooltip(item.pageX, item.pageY,
- dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
+ dte.toLocaleString() + ": " + y + item.series.yaxis.options.unit);
}
} else {
$("#diagramTooltip").remove();
@@ -384,7 +384,7 @@
var offset = new Date().getTimezoneOffset() * 60 * 1000;
var dte = new Date(x + offset);
showDiagramTooltip(item.pageX, item.pageY,
- dte.toLocaleString() + ": " + y + jQuery(this).data("unit"));
+ dte.toLocaleString() + ": " + y + item.series.yaxis.options.unit);
}
} else {
$("#diagramTooltip").remove();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2013-01-19 13:23:01
|
Revision: 1344
http://openautomation.svn.sourceforge.net/openautomation/?rev=1344&view=rev
Author: peuter
Date: 2013-01-19 13:22:55 +0000 (Sat, 19 Jan 2013)
Log Message:
-----------
fix for rrd-url in diagram plugin
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-19 13:20:47 UTC (rev 1343)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-19 13:22:55 UTC (rev 1344)
@@ -431,7 +431,7 @@
var idx = num;
$.ajax({
- url: backend+"rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
+ url: templateEngine.backend+"rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
dataType: "json",
type: "GET",
context: this,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2013-01-19 13:56:40
|
Revision: 1346
http://openautomation.svn.sourceforge.net/openautomation/?rev=1346&view=rev
Author: peuter
Date: 2013-01-19 13:56:34 +0000 (Sat, 19 Jan 2013)
Log Message:
-----------
added missing slash in rrd path
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-19 13:53:17 UTC (rev 1345)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-01-19 13:56:34 UTC (rev 1346)
@@ -431,7 +431,7 @@
var idx = num;
$.ajax({
- url: templateEngine.backend+"rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
+ url: templateEngine.backend+"/rrdfetch?rrd=" + src + ".rrd&ds=" + datasource + "&start=end-" + period + s.start + "&end=" + s.end + "&res=" + s.res,
dataType: "json",
type: "GET",
context: this,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2013-02-10 21:20:19
|
Revision: 1466
http://openautomation.svn.sourceforge.net/openautomation/?rev=1466&view=rev
Author: mayerch
Date: 2013-02-10 21:20:11 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
Fix popups of diagrams
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-10 20:46:50 UTC (rev 1465)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2013-02-10 21:20:11 UTC (rev 1466)
@@ -193,14 +193,14 @@
bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
}
- //refreshDiagram(bDiagram, bDiagramOpts);
+ doRefreshDiagram(bDiagram, bDiagramOpts);
return false;
});
}
if ((oldType=="inline") || ($p.attr("previewlabels") == "true")) {
//refreshDiagram(diagram, {});
} else {
- //refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
+ refreshDiagram(diagram, {xaxes: [{ticks: 0}], yaxes: [{ticks: 0}]});
}
return ret_val;
@@ -341,7 +341,7 @@
bDiagramOpts = jQuery.extend(bDiagramOpts, { grid: {hoverable: true, clickable: true} });
}
- //refreshDiagram(bDiagram, bDiagramOpts);
+ doRefreshDiagram(bDiagram, bDiagramOpts);
return false;
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|