Permalink
Browse files

GADGETS-50: updated the response time chart with different operation.

  • Loading branch information...
1 parent d956f7e commit 7102d4fd9e7d6d61a101ce910734097f2ea665f5 @jeffyu jeffyu committed Mar 28, 2013
@@ -3,7 +3,7 @@
<project name="GadgetServer_Installer">
<!-- DEFAULT PROPERTY VALUES -->
- <property name="as7.home" value="/Users/jeffyu/deploy/switchyard-as7-0.7" />
+ <property name="as7.home" value="/Users/jeffyu/deploy/switchyard-as7-0.8" />
<property name="deploy.dir" value="${as7.home}/standalone/deployments" />
<property name="database" value="h2"/>
@@ -97,8 +97,10 @@ private Portlet(final String wid, final String pid) {
this.portalId = pid;
this.iframeId = "iframe-" + widgetId;
initWidget(uiBinder.createAndBindUi(this));
+
getElement().setId(id);
gadgetSpec.getElement().setId(iframeId);
+ gadgetSpec.getElement().setAttribute("frameborder", "0");
urlBase = getGadgetServerUrlBase();
@@ -1,17 +1,19 @@
function getUserPreferenceValue(name) {
var queryString, theQueryName, vars, prefs;
- queryString = window.location.search;
- prefs = new gadgets.Prefs();
- if (queryString != " " && queryString != "undefined") {
- queryString = queryString.substring(1);
- vars = queryString.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == name) {
- return pair[1];
- }
- }
+ if (window != "undefined" && window != undefined && window != null && window != " ") {
+ queryString = window.location.search;
+ if (queryString != " " && queryString != "undefined") {
+ queryString = queryString.substring(1);
+ vars = queryString.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == name) {
+ return pair[1];
+ }
+ }
+ }
}
+ prefs = new gadgets.Prefs();
return prefs.getString(name);
}
@@ -43,15 +43,15 @@
if (!isNotEmpty(service) && !isNotEmpty(operation)) {
postdata = "{\"collection\":\"ServiceResponseTimes\"}";
} else {
- postdata = "{\"parent\":\"ServiceResponseTimes\", \"collection\":\"CustomCollection\",\"predicate\":{\"type\":\"MVEL\",\"expression\":";
+ postdata = "{\"parent\":\"ServiceResponseTimes\",\"predicate\":{\"type\":\"MVEL\",\"expression\":";
if (isNotEmpty(service) && isNotEmpty(operation)) {
- postdata = postdata + "\"serviceType==\\\"" + service + "\\\" && operation == \\\"" + operation + "\\\"\"";
+ postdata = postdata + "\"serviceType==\\\"" + service + "\\\" && operation == \\\"" + operation + "\\\"\"}, \"collection\":\"service_" + service + "_" + operation+ "\" ";
} else if (isNotEmpty(service)) {
- postdata = postdata + "\"serviceType==\\\"" + service + "\\\"\"";
+ postdata = postdata + "\"serviceType==\\\"" + service + "\\\"\"}, \"collection\":\"service_" + service + "\"";
} else if (isNotEmpty(operation)) {
- postdata = postdata + "\"operation == \\\"" + operation + "\\\"\"";
+ postdata = postdata + "\"operation == \\\"" + operation + "\\\"\", \"collection\":\"operation_" + operation + "\" ";
}
- postdata = postdata + "} }";
+ postdata = postdata + "}";
}
console.log("the post data is: " + postdata);
@@ -87,9 +87,12 @@
var thesvcValue = getUserPreferenceValue("services");
var theopValue = getUserPreferenceValue("operations");
var thesvc = parent.$("#services");
+ var theop = parent.$("#operations");
exists = false;
thesvc.empty();
thesvc.append($("<option></option>").attr("value","all").text("all"));
+ theop.empty();
+ theop.append($("<option></option>").attr("value","all").text("all"));
if (response.data != undefined){
serviceDefs = new Array(response.data.length);
for (i = 0; i < serviceDefs.length; i++) {
@@ -131,7 +134,7 @@
selectedValue = parent.$("#services").val();
theop = parent.$("#operations");
- console.log("the op is: " + theop + " and the selected value is: " + selectedValue);
+ //console.log("the op is: " + theop + " and the selected value is: " + selectedValue);
theop.empty();
theop.append($("<option></option>").attr("value","all").text("all"));
@@ -220,12 +223,13 @@
min.push([i, rtResult.min, rtResult.serviceType, rtResult.operation, ts]);
max.push([i, rtResult.max, rtResult.serviceType, rtResult.operation, ts]);
duration.push([i, rtResult.average, rtResult.serviceType, rtResult.operation, ts]);
+
}
}
- return [{data:min, label:"Min"},
- {data:max, label:"Max"},
- {data:duration, label:"Average"}];
+ return [{data:duration, label:"Average"},
+ {data:min, label:"Min"},
+ {data:max, label:"Max"}];
}
@@ -1,17 +1,19 @@
function getUserPreferenceValue(name) {
var queryString, theQueryName, vars, prefs;
- queryString = window.location.search;
- prefs = new gadgets.Prefs();
- if (queryString != " " && queryString != "undefined") {
- queryString = queryString.substring(1);
- vars = queryString.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == name) {
- return pair[1];
- }
- }
+ if (window != "undefined" && window != undefined && window != null && window != " ") {
+ queryString = window.location.search;
+ if (queryString != " " && queryString != "undefined") {
+ queryString = queryString.substring(1);
+ vars = queryString.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == name) {
+ return pair[1];
+ }
+ }
+ }
}
+ prefs = new gadgets.Prefs();
return prefs.getString(name);
}
@@ -1,17 +1,19 @@
function getUserPreferenceValue(name) {
var queryString, theQueryName, vars, prefs;
- queryString = window.location.search;
- prefs = new gadgets.Prefs();
- if (queryString != " " && queryString != "undefined") {
- queryString = queryString.substring(1);
- vars = queryString.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == name) {
- return pair[1];
- }
- }
+ if (window != "undefined" && window != undefined && window != null && window != " ") {
+ queryString = window.location.search;
+ if (queryString != " " && queryString != "undefined") {
+ queryString = queryString.substring(1);
+ vars = queryString.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == name) {
+ return pair[1];
+ }
+ }
+ }
}
+ prefs = new gadgets.Prefs();
return prefs.getString(name);
}
@@ -1,17 +1,19 @@
function getUserPreferenceValue(name) {
var queryString, theQueryName, vars, prefs;
- queryString = window.location.search;
- prefs = new gadgets.Prefs();
- if (queryString != " " && queryString != "undefined") {
- queryString = queryString.substring(1);
- vars = queryString.split("&");
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split("=");
- if (pair[0] == name) {
- return pair[1];
- }
- }
+ if (window != "undefined" && window != undefined && window != null && window != " ") {
+ queryString = window.location.search;
+ if (queryString != " " && queryString != "undefined") {
+ queryString = queryString.substring(1);
+ vars = queryString.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == name) {
+ return pair[1];
+ }
+ }
+ }
}
+ prefs = new gadgets.Prefs();
return prefs.getString(name);
}

0 comments on commit 7102d4f

Please sign in to comment.