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进行调试。