Pārlūkot izejas kodu

feat(tranceid 表格换接口)

liujing 2 nedēļas atpakaļ
vecāks
revīzija
9be005f54b
3 mainītis faili ar 14 papildinājumiem un 8 dzēšanām
  1. 6 0
      src/api/trace.js
  2. 2 2
      src/views/index/index.vue
  3. 6 6
      src/views/latency/index.vue

+ 6 - 0
src/api/trace.js

@@ -1,6 +1,7 @@
 import request from '@/utils/request'
 import Request from '@/utils/requestOther'
 const instance = new Request('/app')
+const instance2 = new Request('/core')
 // 修正版
 export function traceList(data) {
   return request({
@@ -43,3 +44,8 @@ export function getFlameData(data) {
   const url = '/v1/stats/querier/trace/complation'
   return instance.post(url, data)
 }
+// 快速获取trance table list
+export function fetchTranceList(data) {
+  const url = '/v1/trace/quick'
+  return instance2.get(url, data)
+}

+ 2 - 2
src/views/index/index.vue

@@ -617,7 +617,7 @@ export default {
         const res = await searchBizName(this.bizSearchQuery)
         if (res && res.code === 200) {
           this.bizSuggestions = res.data.list || []
-          this.bizPageTotal = res.data.count || 0
+          this.bizPageTotal = res.data.total || 0
           cb(this.bizSuggestions)
         }
       } catch (e) {
@@ -639,7 +639,7 @@ export default {
         const result = await searchBizName(this.suppilerListQuery)
         // 根据实际接口返回数据格式将数据插入到选项中
         this.$refs.bizCompleteRef.$data.suggestions = suggestions.concat(result.data.list || [])
-        this.bizPageTotal = result.data.count || 0
+        this.bizPageTotal = result.data.total || 0
       } catch (e) {
       // console.log(e)
       } finally {

+ 6 - 6
src/views/latency/index.vue

@@ -76,13 +76,13 @@
           <el-table-column label="包含的span数量" header-align="center" prop="span_num" align="center" />
         </el-table>
 
-        <pagination
+        <!-- <pagination
           v-show="total>0"
           :total="total"
           :page.sync="queryTrace.pageIndex"
           :limit.sync="queryTrace.pageSize"
           @pagination="getTraceList"
-        />
+        /> -->
 
         <div style="margin-top:32px;">
           <div class="css-container" style="margin-bottom:24px;">
@@ -831,7 +831,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { traceList, traceDetail, traceGraph } from '@/api/trace'
+import { fetchTranceList, traceDetail, traceGraph } from '@/api/trace'
 import Topo from './components/TopoTree'
 import storage from '@/utils/storage'
 import FlameGraph from './components/FlameGraph.vue'
@@ -909,7 +909,7 @@ export default {
         min_duration: 0, // 单位 ms
         max_duration: 0,
         pageIndex: 1,
-        pageSize: 10,
+        pageSize: 20,
         trace_id: '',
         app_alias: '',
         failed: false
@@ -1015,7 +1015,7 @@ export default {
         this.queryTrace.failed = JSON.parse(param.failed)
       }
       this.queryTrace.pageIndex = 1
-      this.queryTrace.pageSize = 10
+      this.queryTrace.pageSize = 20
       this.queryTrace.trace_id = ''
       this.getTraceList()
     }
@@ -1152,7 +1152,7 @@ export default {
     // 获取trace table 数据
     getTraceList() {
       this.loading = true
-      traceList(this.queryTrace).then(res => {
+      fetchTranceList(this.queryTrace).then(res => {
         this.loading = false
         this.graphData = {}
         this.graphflag = false