|
@@ -15,11 +15,11 @@ import { layersTopologyIdsSelector } from '../selectors/resource-view/layout';
|
|
|
import { activeTopologyOptionsSelector } from '../selectors/topology';
|
|
|
|
|
|
const log = debug('scope:web-api-utils');
|
|
|
-// var apiRoot = process.env.API_ROOT; //线上打开
|
|
|
+var apiRoot = process.env.API_ROOT; //线上打开
|
|
|
|
|
|
|
|
|
//本地测试时候用;
|
|
|
-var apiRoot = 'http://observe-server.cestong.com.cn'
|
|
|
+// var apiRoot = 'http://observe-server.cestong.com.cn'
|
|
|
|
|
|
// 测试环境的时候
|
|
|
// var apiRoot='http://observe-front.cestong.com.cn/re'
|
|
@@ -131,31 +131,31 @@ let queryData ={
|
|
|
}
|
|
|
|
|
|
//上线打开开始
|
|
|
-// var strr = parent.location.href; //上线做为iframe嵌套时使用
|
|
|
-
|
|
|
-// let param = parseQueryString(strr); //全链路需要的参数多,因此解析成对象形式
|
|
|
-// if(parseInt(param.start_time)!=0 && param.start_time != 'NaN'){ //上线时打开
|
|
|
-// queryData.start_time = parseInt(param.start_time);
|
|
|
-// }else{
|
|
|
-// queryData.start_time = Math.round((new Date().getTime())/1000 - (1*60))
|
|
|
-// }
|
|
|
-
|
|
|
-// if(parseInt(param.end_time) !=0 && param.end_time != 'NaN'){ //上线时打开web-api
|
|
|
-// queryData.end_time=parseInt(param.end_time);
|
|
|
-// }else{
|
|
|
-// queryData.end_time=Math.round(new Date().getTime()/1000);
|
|
|
-// }
|
|
|
-// if(param.app_alias != undefined){
|
|
|
-// queryData.app_alias=param.app_alias; //上线时打开
|
|
|
-// }else{
|
|
|
-// queryData.app_alias= 'UNSET'
|
|
|
-// }
|
|
|
-
|
|
|
-// if(param.live != undefined){
|
|
|
-// queryData.live = param.live;
|
|
|
-// }else{
|
|
|
-// queryData.live = false;
|
|
|
-// }
|
|
|
+var strr = parent.location.href; //上线做为iframe嵌套时使用
|
|
|
+
|
|
|
+ let param = parseQueryString(strr); //全链路需要的参数多,因此解析成对象形式
|
|
|
+ if(parseInt(param.start_time)!=0 && param.start_time != 'NaN'){ //上线时打开
|
|
|
+ queryData.start_time = parseInt(param.start_time);
|
|
|
+ }else{
|
|
|
+ queryData.start_time = Math.round((new Date().getTime())/1000 - (1*60))
|
|
|
+ }
|
|
|
+
|
|
|
+ if(parseInt(param.end_time) !=0 && param.end_time != 'NaN'){ //上线时打开web-api
|
|
|
+ queryData.end_time=parseInt(param.end_time);
|
|
|
+ }else{
|
|
|
+ queryData.end_time=Math.round(new Date().getTime()/1000);
|
|
|
+ }
|
|
|
+ if(param.app_alias != undefined){
|
|
|
+ queryData.app_alias=param.app_alias; //上线时打开
|
|
|
+ }else{
|
|
|
+ queryData.app_alias= 'UNSET'
|
|
|
+ }
|
|
|
+
|
|
|
+ if(param.live != undefined){
|
|
|
+ queryData.live = param.live;
|
|
|
+ }else{
|
|
|
+ queryData.live = false;
|
|
|
+ }
|
|
|
|
|
|
//上线打开结束
|
|
|
|
|
@@ -172,12 +172,12 @@ export function topologiesUrlApi(state) {
|
|
|
//wsUrl携带参数的例子
|
|
|
// const wsUrl = 'ws://observe-server.cestong.com.cn/api/v1/ws/topology/services/ws?t=5s&app_alias=UNSET'
|
|
|
//本地环境用
|
|
|
-const wsUrl ='ws://observe-server.cestong.com.cn'
|
|
|
+// const wsUrl ='ws://observe-server.cestong.com.cn'
|
|
|
// 测试环境用
|
|
|
// const wsUrl='ws://observe-front.cestong.com.cn'
|
|
|
|
|
|
//上线时打开
|
|
|
-// const wsUrl = `ws://${parent.location.hostname}`
|
|
|
+const wsUrl = `ws://${parent.location.hostname}`
|
|
|
|
|
|
|
|
|
export function getWebsocketUrl(host = window.location.host, pathname = window.location.pathname) {
|