OpenTsdb UI(gwt)开发模式调式方法

OpenTsdb本地启动后调用地址为:http://localhost:4242

UI页面进行gwt开发模式后调用地址为:

http://127.0.0.1:8888/queryui.html?gwt.codesvr=127.0.0.1:9997

gwt在开发模式时,不能调用到服务端(OpenTsdb)的后台数据,将

    privatestaticfinal StringAGGREGATORS_URL="/aggregators";

    privatestaticfinal StringLOGS_URL ="/logs?json";

    privatestaticfinal StringSTATS_URL ="/stats?json";

    privatestaticfinal StringVERSION_URL ="/version?json";

这些URL加上http://localhost:4242后,服务器被是被调用了但结果不能返回到,原因是GWT(RequestBuilder)不支持跨域访问。

 

为了方便开发进行如下方法:

1、 QueryUi.java类编译到war/queryui目录下

2、  手写queryui.html放入到war/queryui目录下

<!doctype html>
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=utf-8">
<title>TSD</title>
<style>
<!--
body {
	font-family: arial, sans-serif;
	margin-left: 2em
}

A.l:link {
	color: #6f6f6f
}

A.u:link {
	color: green
}

.subg {
	background-color: #e2f4f7
}

.fwf {
	font-family: monospace;
	white-space: pre-wrap
}
//
-->
</style>
<script type=text/javascript language=javascript src=./queryui.nocache.js></script>
</head>
<body text=#000000 bgcolor=#ffffff>
<table border=0 cellpadding=2 cellspacing=0 width=100%>
	<tr>
		<td rowspan=3 width=1% nowrap><b><font color=#c71a32 size=10>T</font><font
			color=#00a189 size=10>S</font><font color=#1a65b7 size=10>D</font>  </b>
		<td> </td>
	</tr>
	<tr>
		<td class=subg><font color=#507e9b><b>Time Series
		Database</b></td>
	</tr>
	<tr>
		<td> </td>
	</tr>
</table>
<div id=queryuimain></div>
<noscript>You must have JavaScript enabled.</noscript>
<iframe src=javascript: '' id=__gwt_historyFrame tabIndex=-1
	style="position: absolute; width: 0; height: 0; border: 0"></iframe>
<table width=100% cellpadding=0 cellspacing=0>
	<tr>
		<td class=subg><img alt="" width=1 height=6></td>
	</tr>
</table>
</body>
</html>

3、  编辑QueryUi.java

4、  访问 http://127.0.0.1:4242/s/queryui.html?gwt.codesvr=127.0.0.1:9997进行调试。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值