Browse Source

网络拓扑修改http

wlf 8 months ago
parent
commit
42a6fc76e0
1 changed files with 38 additions and 38 deletions
  1. 38 38
      src/views/latency/components/TopoTree.vue

+ 38 - 38
src/views/latency/components/TopoTree.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script>
-// import { networkSpans } from '@/api/trace'
+import { networkSpans } from '@/api/trace'
 import screenfull from 'screenfull'
 import G6 from '@antv/g6';
 import insertCss from 'insert-css';
@@ -1015,44 +1015,11 @@ export default {
         if(source != ''){
           this.networkQuery.parent_span_id = source;
           this.networkQuery.span_id = target;
-          // networkSpans(this.networkQuery).then(res=>{
-          //   console.log(res,'network-spans网络拓扑')
+          networkSpans(this.networkQuery).then(res=>{
+            console.log(res,'network-spans网络拓扑')
 
-          //   if(res.OPT_STATUS.length!=0){
-          //     let optList = this.handleData(res.OPT_STATUS);
-          //     let newOptList = this.buildNestedTree(optList);
-
-          //     newFirstNode.children = newOptList;
-
-
-          //     let firstList =[newFirstNode];
-
-          //     let resultList = this.addDataToTree(firstList,newLastNode)
-
-          //     topoData = resultList[0]
-
-
-          //     this.networkOpen = true;
-          //     this.flag = true;
-          //     setTimeout(()=>{
-          //       this.initGraphNetwork(topoData,'networkContainer')
-          //     },300)
-
-
-          //   }else{
-          //     this.$message('暂无数据')
-          //   }
-          // })
-          this.$http({
-              // url: 'http://df-app.cestong.com.cn/v1/stats/querier/network-spans',
-              url:'http://app.cestong.com.cn/v1/stats/querier/network-spans',
-              method: 'post',
-              data:this.networkQuery
-          }).then(res=>{
-            console.log(res.data.OPT_STATUS,'network-spans网络拓扑')
-
-            if(res.data.OPT_STATUS.length!=0){
-              let optList = this.handleData(res.data.OPT_STATUS);
+            if(res.OPT_STATUS.length!=0){
+              let optList = this.handleData(res.OPT_STATUS);
               let newOptList = this.buildNestedTree(optList);
 
               newFirstNode.children = newOptList;
@@ -1076,6 +1043,39 @@ export default {
               this.$message('暂无数据')
             }
           })
+          // this.$http({
+          //     // url: 'http://df-app.cestong.com.cn/v1/stats/querier/network-spans',
+          //     url:'http://app.cestong.com.cn/v1/stats/querier/network-spans',
+          //     method: 'post',
+          //     data:this.networkQuery
+          // }).then(res=>{
+          //   console.log(res.data.OPT_STATUS,'network-spans网络拓扑')
+
+          //   if(res.data.OPT_STATUS.length!=0){
+          //     let optList = this.handleData(res.data.OPT_STATUS);
+          //     let newOptList = this.buildNestedTree(optList);
+
+          //     newFirstNode.children = newOptList;
+
+
+          //     let firstList =[newFirstNode];
+
+          //     let resultList = this.addDataToTree(firstList,newLastNode)
+
+          //     topoData = resultList[0]
+
+
+          //     this.networkOpen = true;
+          //     this.flag = true;
+          //     setTimeout(()=>{
+          //       this.initGraphNetwork(topoData,'networkContainer')
+          //     },300)
+
+
+          //   }else{
+          //     this.$message('暂无数据')
+          //   }
+          // })
         }
       });
       // 双击节点进行跳转