Skip to content
Browse files

GADGETS-33: removing the serviceUrl from the gadgets.

  • Loading branch information...
1 parent a6a91a7 commit 9fe7bd0c275ccfdaa6d64ed80c938c4fef4a34c8 @jeffyu jeffyu committed Dec 17, 2012
View
5 gadgets/src/main/webapp/calltrace-gadget/gadget.xml
@@ -6,7 +6,6 @@
<Require feature="setprefs"/>
<Require feature="dynamic-height" />
</ModulePrefs>
- <UserPref name="host" display_name="Host:" default_value="localhost:8080" />
<UserPref name="identifier" display_name="Identifier:" default_value="" />
<UserPref name="refreshCycle" display_name="Refresh Interval(sec):"
default_value="30" datatype="enum">
@@ -42,7 +41,7 @@
function makeJSONRequest(){
var prefs = new gadgets.Prefs();
//hack for now.
- var host = parent.document.getElementById("host");
+ var host = parent.window.location.host;
var ident = parent.document.getElementById("identifier");
if (ident.value == "") {
@@ -52,7 +51,7 @@
$("#promptDiv").hide();
}
- var restUrl = "http://" + host.value + "/overlord-bam/call/trace/instance?identifier=" + ident.value;
+ var restUrl = "http://" + host + "/overlord-bam/call/trace/instance?identifier=" + ident.value;
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
View
6 gadgets/src/main/webapp/rt-gadget/gadget.xml
@@ -4,7 +4,6 @@
author="Jeff Yu" author_email="jeff.yuchang@gmail.com">
<Require feature="setprefs" />
</ModulePrefs>
- <UserPref name="serviceUrl" display_name="Service URL:" default_value="http://localhost:8080/overlord-bam/acm/query" />
<UserPref name="serviceType" display_name="Service Type:" datatype="list"></UserPref>
<UserPref name="operations" display_name="Operations:" datatype="list"></UserPref>
<UserPref name="record" display_name="record:" default_value="10" datatype="enum">
@@ -42,7 +41,7 @@
var serviceDefs;
function makeJSONRequest() {
- var prefs, params, restUrl, postdata, svcDef;
+ var prefs, params, restUrl, postdata, svcDef, host;
prefs = new gadgets.Prefs();
postdata = "{\"collection\":\"ServiceResponseTimes\"}";
@@ -53,7 +52,8 @@
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA]= postdata;
- restUrl = prefs.getString("serviceUrl");
+ host = parent.window.location.host;
+ restUrl = "http://" + host + "/overlord-bam/acm/query";
gadgets.io.makeRequest(restUrl, updateUI, params);
View
6 gadgets/src/main/webapp/situation-gadget/gadget.xml
@@ -2,7 +2,6 @@
<Module>
<ModulePrefs title="Situation" description="Situation gadget"
author="Jeff Yu" author_email="jeff.yuchang@gmail.com" />
- <UserPref name="serviceUrl" display_name="Service URL:" default_value="http://localhost:8080/overlord-bam/acm/query" />
<UserPref name="pageSize" display_name="Size:" default_value="10" datatype="enum">
<EnumValue value="5" />
<EnumValue value="10" />
@@ -30,7 +29,7 @@
<script type="text/javascript">
function makeJSONRequest() {
- var prefs, params, restUrl, postdata;
+ var prefs, params, restUrl, postdata, host;
prefs = new gadgets.Prefs();
postdata = "{\"collection\":\"Situations\"}";
@@ -41,7 +40,8 @@
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA]= postdata;
- restUrl = prefs.getString("serviceUrl");
+ host = parent.window.location.host;
+ restUrl = "http://" + host + "/overlord-bam/acm/query";
gadgets.io.makeRequest(restUrl, updateResponse, params);
}
View
7 gadgets/src/main/webapp/so-gadget/gadget.xml
@@ -4,7 +4,6 @@
author="Jeff Yu" author_email="jeff.yuchang@gmail.com">
<Require feature="views" />
</ModulePrefs>
- <UserPref name="serviceUrl" display_name="Service URL:" default_value="http://localhost:8080/overlord-bam/service/dependency/overview" />
<UserPref name="refreshCycle" display_name="Refresh Interval(sec):" default_value="30" datatype="enum">
<EnumValue value="30" />
<EnumValue value="60" />
@@ -16,14 +15,16 @@
<script type="text/javascript">
function makeJSONRequest() {
- var prefs, params, restUrl, postdata;
+ var prefs, params, restUrl, postdata, host;
prefs = new gadgets.Prefs();
params = {};
params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = prefs.getInt("refreshCycle");
- restUrl = prefs.getString("serviceUrl");
+ host = parent.window.location.host;
+ restUrl = "http://" + host + "/overlord-bam-services/service/dependency/overview";
+
if (getViewName() == "default") {
restUrl = restUrl + "?width=300";
}

0 comments on commit 9fe7bd0

Please sign in to comment.
Something went wrong with that request. Please try again.