Author: eallen
Date: 2009-10-22 12:50:27 -0400 (Thu, 22 Oct 2009)
New Revision: 3682
Modified:
mgmt/trunk/cumin/python/cumin/grid/negotiator.strings
mgmt/trunk/cumin/python/cumin/grid/pool.strings
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/resources/app.js
mgmt/trunk/cumin/resources/slots.swf
Log:
Added some error checking to the javascript for the flash charts to prevent flash methods
from being called before the controls are properly initialized.
Modified: mgmt/trunk/cumin/python/cumin/grid/negotiator.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/negotiator.strings 2009-10-22 15:52:21 UTC (rev
3681)
+++ mgmt/trunk/cumin/python/cumin/grid/negotiator.strings 2009-10-22 16:50:27 UTC (rev
3682)
@@ -167,9 +167,12 @@
var chart = cumin.getFlashChart(priority_chart_id);
if (chart) {
- var obj = {'values': new_values};
- var myJson = JSON.encode(obj);
- chart.setpieslice(changedEl.id, myJson);
+ if (chart.setpieslice != "undefined") {
+ var obj = {'values': new_values};
+ var myJson = JSON.encode(obj);
+ chart.setpieslice(changedEl.id, myJson);
+ } else
+ wooly.log("setpieslice not defined for " +
priority_chart_id);
}
}
}).set(initial_knob, false);
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.strings 2009-10-22 15:52:21 UTC (rev 3681)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.strings 2009-10-22 16:50:27 UTC (rev 3682)
@@ -64,10 +64,15 @@
function updatePoolSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
- if (typeof loadType != "undefined")
- chart.reload(chart.src, false);
- else
- chart.load(chart.src, false);
+ if (typeof loadType != "undefined") {
+ if (typeof chart.reload != "undefined")
+ chart.reload(chart.src, false);
+ } else {
+ if (typeof chart.load != "undefined")
+ chart.load(chart.src, false);
+ else
+ wooly.log("load not definded for " + id);
+ }
}
}
function vis_ready(vis) {
@@ -84,13 +89,19 @@
function vis_treemap_over(type, value) {
var chart = cumin.getFlashChart("{id}");
if (chart) {
- chart.highlight(type, value);
+ if (typeof chart.highlight != "undefined")
+ chart.highlight(type, value);
+ else
+ wooly.log("highlight not definded for " + id);
}
}
function vis_treemap_out(type, value) {
var chart = cumin.getFlashChart("{id}");
if (chart) {
- chart.lowlight(type, value);
+ if (typeof chart.lowlight != "undefined")
+ chart.lowlight(type, value);
+ else
+ wooly.log("lowlight not definded for " + id);
}
}
function slot_vis(state, a, id, href) {
@@ -119,9 +130,13 @@
var fsm = document.getElementById('flashSlotMap');
if (fsm)
fsm.style.display = "block";
+
+ var params = {menu: "false", scale: "noScale", allowFullscreen:
"true", allowScriptAccess: "always", bgcolor: "#FFFFFF"};
+ //var BackgroundGlass = document.getElementById('BackgroundGlass');
+ //alert(BackgroundGlass);
- swfobject.embedSWF("resource?name=slots.swf", "{id}_chart",
"{slot_chart_width}", "{slot_chart_height}", "9.0.0",
"", {vis:"slots"});
- swfobject.embedSWF("resource?name=slots.swf",
"{id}ctrl_chart", "{slot_chart_width}",
"{slot_ctrl_height}", "9.0.0", "", {vis:"ctrl"});
+ swfobject.embedSWF("resource?name=slots.swf", "{id}_chart",
"{slot_chart_width}", "{slot_chart_height}", "9.0.0",
"", {vis:"slots"}, params);
+ swfobject.embedSWF("resource?name=slots.swf",
"{id}ctrl_chart", "{slot_chart_width}",
"{slot_ctrl_height}", "9.0.0", "", {vis:"ctrl"},
params);
wooly.addPageUpdateListener(function () { updatePoolSlotVis('{id}',
"reload"); });
wooly.addPageUpdateListener(function () { updatePoolSlotVis('{id}ctrl',
"reload"); });
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-10-22 15:52:21 UTC (rev 3681)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-10-22 16:50:27 UTC (rev 3682)
@@ -233,7 +233,10 @@
setTimeout(function () {changeDuration(state, a, id, attempt+1);},
1000);
return false;
}
- chart.geturl("got_chart_url", id, state);
+ if (typeof chart.geturl != "undefined")
+ chart.geturl("got_chart_url", id, state);
+ else
+ wooly.log("geturl not definded for " + id);
}
return false;
}
@@ -249,7 +252,10 @@
branch['duration'] = state;
url = branch.marshal();
- chart.reload(url, true);
+ if (typeof chart.reload != "undefined")
+ chart.reload(url, true);
+ else
+ wooly.log("reload not definded for " + id);
}
function gotChartPoints(text, oImg) {
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2009-10-22 15:52:21 UTC (rev 3681)
+++ mgmt/trunk/cumin/resources/app.js 2009-10-22 16:50:27 UTC (rev 3682)
@@ -351,25 +351,17 @@
cumin.getFlashChart = function (id) {
var chart = $(id+"_chart");
- if (chart) {
- if (typeof chart.reload != "undefined")
- return chart;
- var pchart = $(id);
- var chart2 = pchart.getChildren(id+"_chart");
- if (navigator.appName.indexOf("Microsoft") != -1) {
- return window[id+"_chart"];
- } else {
- return document[id+"_chart"];
- }
- }
- return null;
+ return chart;
}
cumin.updateFlashChart = function (id) {
var chart = cumin.getFlashChart(id);
if (chart == null)
return false;
- chart.get_ymax(id)
+ if (typeof chart.get_ymax != "undefined")
+ chart.get_ymax(id)
+ else
+ wooly.log("get_ymax not definded for " + id);
}
/* called from .swf in response to chart.get_ymax() */
@@ -407,7 +399,10 @@
branch['vmax'] = vals_max;
href = branch.marshal();
- chart.reload(href, false);
+ if (typeof chart.reload != "undefined")
+ chart.reload(href, false);
+ else
+ wooly.log("reload not definded for " + id);
}
window.addEvent('domready',function () {
@@ -451,7 +446,10 @@
delete branch.elapsed;
href = branch.marshal();
- chart.reload(href, true);
+ if (typeof chart.reload != "undefined")
+ chart.reload(href, true);
+ else
+ wooly.log("reload not definded for " + id);
}
}
Modified: mgmt/trunk/cumin/resources/slots.swf
===================================================================
(Binary files differ)