Parcourir la source

框选添加service_name

wlf il y a 9 mois
Parent
commit
83fce3b684

+ 5 - 3
client/app/scripts/charts/edge.js

@@ -758,7 +758,8 @@ class Edge extends React.Component {
                 min_duration:minValue,
                 max_duration:maxValue,
                 failed:false,
-                app_alias:this.state.queryParams.app_alias
+                app_alias:this.state.queryParams.app_alias,
+                service_name:this.props.id,
               }
             }else{
               dataRange = {
@@ -767,7 +768,8 @@ class Edge extends React.Component {
                 min_duration:minValue,
                 max_duration:maxValue,
                 failed:true,
-                app_alias:this.state.queryParams.app_alias
+                app_alias:this.state.queryParams.app_alias,
+                service_name:this.props.id,
               }
             }
             
@@ -783,7 +785,7 @@ class Edge extends React.Component {
             // window.open(window.location.origin+"/"+href.href,"_blank")
             
            
-            let href = `${this.state.traceUrl}/#/latency/index?start_time=${dataRange.start_time}&end_time=${dataRange.end_time}&min_duration=${dataRange.min_duration}&max_duration=${dataRange.max_duration}&failed=${dataRange.failed}&app_alias=${this.state.queryParams.app_alias}`
+            let href = `${this.state.traceUrl}/#/latency/index?start_time=${dataRange.start_time}&end_time=${dataRange.end_time}&min_duration=${dataRange.min_duration}&max_duration=${dataRange.max_duration}&failed=${dataRange.failed}&app_alias=${this.state.queryParams.app_alias}&service_name=${this.props.id}`
               window.open(href,"_blank")
             setTimeout(()=>{
               chart.dispatchAction({

+ 12 - 10
client/app/scripts/components/node-details.js

@@ -102,13 +102,13 @@ class NodeDetails extends React.Component {
 
 
     //上线时打开开始
-    this.setQueryParams();//做为iframe嵌套时打开,上线时打开
-    const traceURL = `http://${parent.location.hostname}`
-    this.setState({
-      traceUrl:traceURL
-    },()=>{
-      console.log(this.state.traceUrl,'traceUrl,用于traceid跳转')
-    })
+    // this.setQueryParams();//做为iframe嵌套时打开,上线时打开
+    // const traceURL = `http://${parent.location.hostname}`
+    // this.setState({
+    //   traceUrl:traceURL
+    // },()=>{
+    //   console.log(this.state.traceUrl,'traceUrl,用于traceid跳转')
+    // })
      //上线时打开结束
 
     // this.getNodeBasic();
@@ -903,7 +903,8 @@ not found!
                 min_duration:minValue,
                 max_duration:maxValue,
                 failed:false,
-                app_alias:this.state.queryParams.app_alias
+                app_alias:this.state.queryParams.app_alias,
+                service_name:this.props.id,
               }
             }else{
               dataRange = {
@@ -912,7 +913,8 @@ not found!
                 min_duration:minValue,
                 max_duration:maxValue,
                 failed:true,
-                app_alias:this.state.queryParams.app_alias
+                app_alias:this.state.queryParams.app_alias,
+                service_name:this.props.id,
               }
             }
             
@@ -928,7 +930,7 @@ not found!
             // window.open(window.location.origin+"/"+href.href,"_blank")
             
            
-            let href = `${this.state.traceUrl}/#/latency/index?start_time=${dataRange.start_time}&end_time=${dataRange.end_time}&min_duration=${dataRange.min_duration}&max_duration=${dataRange.max_duration}&failed=${dataRange.failed}&app_alias=${this.state.queryParams.app_alias}`
+            let href = `${this.state.traceUrl}/#/latency/index?start_time=${dataRange.start_time}&end_time=${dataRange.end_time}&min_duration=${dataRange.min_duration}&max_duration=${dataRange.max_duration}&failed=${dataRange.failed}&app_alias=${this.state.queryParams.app_alias}&service_name=${this.props.id}`
               window.open(href,"_blank")
             setTimeout(()=>{
               chart.dispatchAction({

+ 2 - 0
client/app/scripts/utils/web-api-utils.js

@@ -15,6 +15,8 @@ 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;  //线上打开