This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git


The following commit(s) were added to refs/heads/refactor-with-go by this push:
     new ac9c6dd3 fix: Several requirements and small adjustments for the 
current front end (#1122)
ac9c6dd3 is described below

commit ac9c6dd329058abcea13bcaa899ff0cebf5e01b9
Author: SDUWYS <[email protected]>
AuthorDate: Wed May 17 10:31:05 2023 +0800

    fix: Several requirements and small adjustments for the current front end 
(#1122)
    
    Co-authored-by: Ken Liu <[email protected]>
---
 dubbo-admin-ui/src/api/menu.js                     |   4 +-
 dubbo-admin-ui/src/components/ServiceSearch.vue    |  99 +--
 .../src/components/metrics/ServiceMetrics.vue      | 733 +++++++++++----------
 dubbo-admin-ui/vue.config.js                       |   5 +-
 4 files changed, 424 insertions(+), 417 deletions(-)

diff --git a/dubbo-admin-ui/src/api/menu.js b/dubbo-admin-ui/src/api/menu.js
index 21eac3c8..5f4bbc5e 100644
--- a/dubbo-admin-ui/src/api/menu.js
+++ b/dubbo-admin-ui/src/api/menu.js
@@ -46,8 +46,8 @@ const Menu = [
   { title: 'serviceTest', path: '/test', icon: 'code' },
   { title: 'serviceMock', path: '/mock/rule', icon: 'build' },
   { title: 'serviceMetrics', path: '/metrics/index', icon: 'show_chart' }
-  // { title: 'configManage', path: '/management', icon: 'build' }
-  // { title: 'apiDocs', path: '/apiDocs', icon: 'code' },
+  // { title: 'configManage', path: '/management', icon: 'build' },
+  // { title: 'apiDocs', path: '/apiDocs', icon: 'code' }
 ]
 
 export default Menu
diff --git a/dubbo-admin-ui/src/components/ServiceSearch.vue 
b/dubbo-admin-ui/src/components/ServiceSearch.vue
index 264ec404..2531978e 100644
--- a/dubbo-admin-ui/src/components/ServiceSearch.vue
+++ b/dubbo-admin-ui/src/components/ServiceSearch.vue
@@ -130,53 +130,55 @@
 </template>
 <script>
 export default {
-  data: () => ({
-    items: [
-      { id: 0, title: 'serviceName', value: 'service' },
-      { id: 1, title: 'ip', value: 'ip' },
-      { id: 2, title: 'app', value: 'application' }
-    ],
-    options: [
-      {
-        title: 'routingRule',
-        value: 'routingRule'
-      },
-      {
-        title: 'tagRule',
-        value: 'tagRule'
-      },
-      {
-        title: 'dynamicConfig',
-        value: 'config'
-      },
-      {
-        title: 'accessControl',
-        value: 'access'
-      },
-      {
-        title: 'weightAdjust',
-        value: 'weight'
+  data () {
+    return {
+      items: [
+        { id: 0, title: 'serviceName', value: 'service' },
+        { id: 1, title: 'ip', value: 'ip' },
+        { id: 2, title: 'app', value: 'application' }
+      ],
+      options: [
+        {
+          title: 'routingRule',
+          value: 'routingRule'
+        },
+        {
+          title: 'tagRule',
+          value: 'tagRule'
+        },
+        {
+          title: 'dynamicConfig',
+          value: 'config'
+        },
+        {
+          title: 'accessControl',
+          value: 'access'
+        },
+        {
+          title: 'weightAdjust',
+          value: 'weight'
+        },
+        {
+          title: 'loadBalance',
+          value: 'loadbalance'
+        }
+      ],
+      timerID: null,
+      searchLoading: false,
+      selected: 0,
+      input: null,
+      typeAhead: [],
+      resultPage: {},
+      filter: '',
+      headers: [],
+      pagination: {
+        page: 1,
+        rowsPerPage: 10 // -1 for All
       },
-      {
-        title: 'loadBalance',
-        value: 'loadbalance'
-      }
-    ],
-    timerID: null,
-    searchLoading: false,
-    selected: 0,
-    input: null,
-    typeAhead: [],
-    resultPage: {},
-    filter: '',
-    headers: [],
-    pagination: {
-      page: 1,
-      rowsPerPage: 10 // -1 for All
-    },
-    totalItems: 0,
-    loadingServices: false
-  }),
+      totalItems: 0,
+      loadingServices: false
+    }
+  },
   computed: {
     queryBy () {
       return this.$t('by') + this.$t(this.items[this.selected].title)
@@ -338,8 +340,11 @@ export default {
           size
         }
       }).then(response => {
+        console.log(response)
         this.resultPage = response.data
-        this.totalItems = this.resultPage.totalElements
+        console.log(this.resultPage)
+        this.totalItems = 1
+        console.log(this.totalItems)
         if (rewrite) {
           this.$router.push({ path: 'service', query: { filter: filter, 
pattern: pattern } })
         }
diff --git a/dubbo-admin-ui/src/components/metrics/ServiceMetrics.vue 
b/dubbo-admin-ui/src/components/metrics/ServiceMetrics.vue
index 42789fb4..0cc7593d 100644
--- a/dubbo-admin-ui/src/components/metrics/ServiceMetrics.vue
+++ b/dubbo-admin-ui/src/components/metrics/ServiceMetrics.vue
@@ -17,7 +17,7 @@
 <template>
   <v-container grid-list-xl fluid>
     <v-layout row wrap>
-      <v-flex lg12>
+      <!-- <v-flex lg12>
         <breadcrumb title="metrics" :items="breads"></breadcrumb>
       </v-flex>
       <v-flex xs12 >
@@ -132,385 +132,386 @@
             </v-data-table>
           </v-tab-item>
         </v-tabs>
+      </v-flex> -->
+      <v-flex>
+        <iframe 
src="http://localhost:8081/dashboard-solo/new?utm_source=grafana_gettingstarted&orgId=1&from=1684139950126&to=1684161550126&panelId=1";
 width="1350" height="700" frameborder="0"></iframe>
       </v-flex>
     </v-layout>
   </v-container>
 </template>
 
 <script>
-import Material from 'vuetify/es5/util/colors'
-import Breadcrumb from '@/components/public/Breadcrumb'
-import Search from '@/components/public/Search'
+// import Material from 'vuetify/es5/util/colors'
 
 export default {
 
-  name: 'ServiceMetrics',
-  components: {
-    Breadcrumb,
-    Search
-  },
-  data () {
-    return {
-      provider: {
-        metrics: [
-          'dubbo.provider.qps', 'dubbo.provider.rt', 
'dubbo.provider.success_rate'
-        ],
-        qps: {
-          title: {
-            text: 'qps',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        },
-        rt: {
-          title: {
-            text: 'rt(ms)',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        },
-        success_rate: {
-          title: {
-            text: 'success rate',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        }
-      },
-      consumer: {
-        metrics: [
-          'dubbo.consumer.qps', 'dubbo.consumer.rt', 
'dubbo.consumer.success_rate'
-        ],
-        qps: {
-          title: {
-            text: 'qps',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
+  name: 'ServiceMetrics'
+  // components: {
+  //   Breadcrumb,
+  //   Search
+  // },
+  // data () {
+  //   return {
+  //     provider: {
+  //       metrics: [
+  //         'dubbo.provider.qps', 'dubbo.provider.rt', 
'dubbo.provider.success_rate'
+  //       ],
+  //       qps: {
+  //         title: {
+  //           text: 'qps',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       },
+  //       rt: {
+  //         title: {
+  //           text: 'rt(ms)',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       },
+  //       success_rate: {
+  //         title: {
+  //           text: 'success rate',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       }
+  //     },
+  //     consumer: {
+  //       metrics: [
+  //         'dubbo.consumer.qps', 'dubbo.consumer.rt', 
'dubbo.consumer.success_rate'
+  //       ],
+  //       qps: {
+  //         title: {
+  //           text: 'qps',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
 
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        },
-        rt: {
-          title: {
-            text: 'rt(ms)',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        },
-        success_rate: {
-          title: {
-            text: 'success rate',
-            padding: [50, 5, 5, 5],
-            textStyle: {
-              fontWeight: 200,
-              fontSize: 12
-            }
-          },
-          tooltip: {},
-          xAxis: {
-            show: false,
-            type: 'category',
-            data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-          },
-          yAxis: {
-            show: false
-          },
-          series: [{
-            type: 'line',
-            data: []
-          }]
-        }
-      },
-      threadPoolData: {
-        core: 0,
-        max: 0,
-        current: 0,
-        current_trending: '',
-        active: 0,
-        active_trending: '',
-        activert: 0
-      },
-      selectedTab: 'tab-1',
-      filter: '',
-      headers: [],
-      providerDetails: [],
-      consumerDetails: [],
-      option: null,
-      color: Material,
-      breads: [
-        {
-          text: 'metrics',
-          href: ''
-        }
-      ]
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       },
+  //       rt: {
+  //         title: {
+  //           text: 'rt(ms)',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       },
+  //       success_rate: {
+  //         title: {
+  //           text: 'success rate',
+  //           padding: [50, 5, 5, 5],
+  //           textStyle: {
+  //             fontWeight: 200,
+  //             fontSize: 12
+  //           }
+  //         },
+  //         tooltip: {},
+  //         xAxis: {
+  //           show: false,
+  //           type: 'category',
+  //           data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+  //         },
+  //         yAxis: {
+  //           show: false
+  //         },
+  //         series: [{
+  //           type: 'line',
+  //           data: []
+  //         }]
+  //       }
+  //     },
+  //     threadPoolData: {
+  //       core: 0,
+  //       max: 0,
+  //       current: 0,
+  //       current_trending: '',
+  //       active: 0,
+  //       active_trending: '',
+  //       activert: 0
+  //     },
+  //     selectedTab: 'tab-1',
+  //     filter: '',
+  //     headers: [],
+  //     providerDetails: [],
+  //     consumerDetails: [],
+  //     option: null,
+  //     color: Material,
+  //     breads: [
+  //       {
+  //         text: 'metrics',
+  //         href: ''
+  //       }
+  //     ]
 
-    }
-  },
-  /*
-    * */
-  methods: {
-    submit: function () {
-      this.searchByIp(this.filter, true)
-    },
-    searchByIp: function (filter, rewrite) {
-      if (this.filter === '') {
-        return
-      }
+  //   }
+  // },
+  // /*
+  //   * */
+  // methods: {
+  //   submit: function () {
+  //     this.searchByIp(this.filter, true)
+  //   },
+  //   searchByIp: function (filter, rewrite) {
+  //     if (this.filter === '') {
+  //       return
+  //     }
 
-      if (rewrite) {
-        this.$router.push({ path: '/metrics/index', query: { ip: this.filter } 
})
-      }
-      const url = '/metrics/ipAddr/?ip=' + filter + '&group=dubbo'
-      this.$axios.get(url)
-        .then(response => {
-          if (!response) {
-            throw new Error('ServerError')
-          }
-          if (!response.data) {
-            return
-          }
-          this.dealNormal(response.data)
-          this.dealMajor(response.data)
-          this.dealThreadPoolData(response.data)
-        })
-        .catch(error => {
-          if (error.message === 'ServerError') {
-            clearInterval(this.searchTimer)
-          }
-        })
-    },
-    dealThreadPoolData: function (data) {
-      for (const index in data) {
-        const metricsDTO = data[index]
-        if ((metricsDTO.metric).indexOf('threadPool') >= -1) {
-          const metric = 
metricsDTO.metric.substring(metricsDTO.metric.lastIndexOf('.') + 1)
-          if (metric === 'active' || metric === 'current') {
-            const trending = metric + '_trending'
-            this.threadPoolData[trending] = 
this.dealTrending(this.threadPoolData[metric], metricsDTO.value)
-          }
-          this.threadPoolData[metric] = metricsDTO.value
-        }
-      }
-      this.threadPoolData.activert = (100 * this.threadPoolData.active / 
this.threadPoolData.current).toFixed(2)
-    },
-    getKey: function (key) {
-      return key.substring(key.lastIndexOf('.') + 1)
-    },
-    dealMajor: function (data) {
-      for (const index in data) {
-        const metricsDTO = data[index]
-        if (this.provider.metrics.indexOf(metricsDTO.metric) !== -1) {
-          const key = this.getKey(metricsDTO.metric)
-          const data = this.provider[key].series[0].data
-          if (data.length === 10) {
-            data.push(metricsDTO.value)
-            data.shift()
-          } else {
-            data.push(metricsDTO.value)
-          }
-          this.provider[key].series.data = data
-        }
-        if (this.consumer.metrics.indexOf(metricsDTO.metric) !== -1) {
-          const key = this.getKey(metricsDTO.metric)
-          const data = this.consumer[key].series[0].data
-          if (data.length === 10) {
-            data.push(metricsDTO.value)
-            data.shift()
-          } else {
-            data.push(metricsDTO.value)
-          }
-          this.consumer[key].series.data = data
-        }
-      }
-    },
-    dealNormal: function (data) {
-      const serviceMethodMap = {}
-      for (const index in data) {
-        const metricsDTO = data[index]
-        if (metricsDTO.metricLevel === 'NORMAL') {
-          let metric = metricsDTO.metric + ''
-          const isProvider = metric.split('.')[1]
-          metric = isProvider + '.' + metric.substring(metric.lastIndexOf('.') 
+ 1)
+  //     if (rewrite) {
+  //       this.$router.push({ path: '/metrics/index', query: { ip: 
this.filter } })
+  //     }
+  //     const url = '/metrics/ipAddr/?ip=' + filter + '&group=dubbo'
+  //     this.$axios.get(url)
+  //       .then(response => {
+  //         if (!response) {
+  //           throw new Error('ServerError')
+  //         }
+  //         if (!response.data) {
+  //           return
+  //         }
+  //         this.dealNormal(response.data)
+  //         this.dealMajor(response.data)
+  //         this.dealThreadPoolData(response.data)
+  //       })
+  //       .catch(error => {
+  //         if (error.message === 'ServerError') {
+  //           clearInterval(this.searchTimer)
+  //         }
+  //       })
+  //   },
+  //   dealThreadPoolData: function (data) {
+  //     for (const index in data) {
+  //       const metricsDTO = data[index]
+  //       if ((metricsDTO.metric).indexOf('threadPool') >= -1) {
+  //         const metric = 
metricsDTO.metric.substring(metricsDTO.metric.lastIndexOf('.') + 1)
+  //         if (metric === 'active' || metric === 'current') {
+  //           const trending = metric + '_trending'
+  //           this.threadPoolData[trending] = 
this.dealTrending(this.threadPoolData[metric], metricsDTO.value)
+  //         }
+  //         this.threadPoolData[metric] = metricsDTO.value
+  //       }
+  //     }
+  //     this.threadPoolData.activert = (100 * this.threadPoolData.active / 
this.threadPoolData.current).toFixed(2)
+  //   },
+  //   getKey: function (key) {
+  //     return key.substring(key.lastIndexOf('.') + 1)
+  //   },
+  //   dealMajor: function (data) {
+  //     for (const index in data) {
+  //       const metricsDTO = data[index]
+  //       if (this.provider.metrics.indexOf(metricsDTO.metric) !== -1) {
+  //         const key = this.getKey(metricsDTO.metric)
+  //         const data = this.provider[key].series[0].data
+  //         if (data.length === 10) {
+  //           data.push(metricsDTO.value)
+  //           data.shift()
+  //         } else {
+  //           data.push(metricsDTO.value)
+  //         }
+  //         this.provider[key].series.data = data
+  //       }
+  //       if (this.consumer.metrics.indexOf(metricsDTO.metric) !== -1) {
+  //         const key = this.getKey(metricsDTO.metric)
+  //         const data = this.consumer[key].series[0].data
+  //         if (data.length === 10) {
+  //           data.push(metricsDTO.value)
+  //           data.shift()
+  //         } else {
+  //           data.push(metricsDTO.value)
+  //         }
+  //         this.consumer[key].series.data = data
+  //       }
+  //     }
+  //   },
+  //   dealNormal: function (data) {
+  //     const serviceMethodMap = {}
+  //     for (const index in data) {
+  //       const metricsDTO = data[index]
+  //       if (metricsDTO.metricLevel === 'NORMAL') {
+  //         let metric = metricsDTO.metric + ''
+  //         const isProvider = metric.split('.')[1]
+  //         metric = isProvider + '.' + 
metric.substring(metric.lastIndexOf('.') + 1)
 
-          let methodMap = serviceMethodMap[metricsDTO.tags.service]
-          if (!methodMap) {
-            methodMap = {}
-            serviceMethodMap[metricsDTO.tags.service] = methodMap
-          }
-          let metricMap = methodMap[metricsDTO.tags.method]
+  //         let methodMap = serviceMethodMap[metricsDTO.tags.service]
+  //         if (!methodMap) {
+  //           methodMap = {}
+  //           serviceMethodMap[metricsDTO.tags.service] = methodMap
+  //         }
+  //         let metricMap = methodMap[metricsDTO.tags.method]
 
-          if (!metricMap) {
-            metricMap = {}
-            serviceMethodMap[metricsDTO.tags.service][metricsDTO.tags.method] 
= metricMap
-          }
-          metricMap[metric] = metricsDTO.value
-        }
-      }
-      this.providerDetails = []
-      this.consumerDetails = []
-      for (const service in serviceMethodMap) {
-        for (const method in serviceMethodMap[service]) {
-          const metricsMap = serviceMethodMap[service][method]
-          this.addDataToDetails(this.providerDetails, service, method, 
metricsMap, 'provider')
-          this.addDataToDetails(this.consumerDetails, service, method, 
metricsMap, 'consumer')
-        }
-      }
-    },
-    addDataToDetails: function (sideDetails, service, method, metricsMap, 
side) {
-      if (metricsMap[side + '.qps'] && metricsMap[side + '.success_rate'] && 
metricsMap[side + '.success_bucket_count']) {
-        sideDetails.push({
-          service: service,
-          method: method,
-          qps: metricsMap[side + '.qps'].toFixed(2),
-          rt: metricsMap[side + '.rt'].toFixed(2),
-          successRate: metricsMap[side + '.success_rate'],
-          successCount: metricsMap[side + '.success_bucket_count']
-        })
-      }
-    },
-    dealTrending: function (oldValue, curValue) {
-      if (curValue > oldValue) {
-        return 'trending_up'
-      }
-      if (curValue < oldValue) {
-        return 'trending_down'
-      }
-      return ''
-    },
-    setHeaders: function () {
-      this.headers = [
-        {
-          text: this.$t('service'),
-          value: 'service'
-        },
-        {
-          text: this.$t('method'),
-          value: 'method'
-        },
-        {
-          text: this.$t('qps'),
-          value: 'qps'
-        },
-        {
-          text: this.$t('rt'),
-          value: 'rt'
-        },
-        {
-          text: this.$t('successRate'),
-          value: 'successRate'
-        }
-      ]
-    }
-  },
-  computed: {
-    area () {
-      return this.$i18n.locale
-    }
-  },
-  watch: {
-    area () {
-      this.setHeaders()
-    }
-  },
-  mounted: function () {
-    this.setHeaders()
-    let filter = null
-    const query = this.$route.query
-    Object.keys(query).forEach(function (key) {
-      if (key === 'ip') {
-        filter = query[key]
-      }
-    })
-    if (filter !== null) {
-      this.filter = filter
-      this.searchByIp(this.filter, false)
-      if (this.searchTimer !== null) {
-        clearInterval(this.searchTimer)
-      }
-      this.searchTimer = setInterval(() => {
-        this.searchByIp(this.filter, false)
-      }, 5000)
-    }
-  }
+  //         if (!metricMap) {
+  //           metricMap = {}
+  //           
serviceMethodMap[metricsDTO.tags.service][metricsDTO.tags.method] = metricMap
+  //         }
+  //         metricMap[metric] = metricsDTO.value
+  //       }
+  //     }
+  //     this.providerDetails = []
+  //     this.consumerDetails = []
+  //     for (const service in serviceMethodMap) {
+  //       for (const method in serviceMethodMap[service]) {
+  //         const metricsMap = serviceMethodMap[service][method]
+  //         this.addDataToDetails(this.providerDetails, service, method, 
metricsMap, 'provider')
+  //         this.addDataToDetails(this.consumerDetails, service, method, 
metricsMap, 'consumer')
+  //       }
+  //     }
+  //   },
+  //   addDataToDetails: function (sideDetails, service, method, metricsMap, 
side) {
+  //     if (metricsMap[side + '.qps'] && metricsMap[side + '.success_rate'] 
&& metricsMap[side + '.success_bucket_count']) {
+  //       sideDetails.push({
+  //         service: service,
+  //         method: method,
+  //         qps: metricsMap[side + '.qps'].toFixed(2),
+  //         rt: metricsMap[side + '.rt'].toFixed(2),
+  //         successRate: metricsMap[side + '.success_rate'],
+  //         successCount: metricsMap[side + '.success_bucket_count']
+  //       })
+  //     }
+  //   },
+  //   dealTrending: function (oldValue, curValue) {
+  //     if (curValue > oldValue) {
+  //       return 'trending_up'
+  //     }
+  //     if (curValue < oldValue) {
+  //       return 'trending_down'
+  //     }
+  //     return ''
+  //   },
+  //   setHeaders: function () {
+  //     this.headers = [
+  //       {
+  //         text: this.$t('service'),
+  //         value: 'service'
+  //       },
+  //       {
+  //         text: this.$t('method'),
+  //         value: 'method'
+  //       },
+  //       {
+  //         text: this.$t('qps'),
+  //         value: 'qps'
+  //       },
+  //       {
+  //         text: this.$t('rt'),
+  //         value: 'rt'
+  //       },
+  //       {
+  //         text: this.$t('successRate'),
+  //         value: 'successRate'
+  //       }
+  //     ]
+  //   }
+  // },
+  // computed: {
+  //   area () {
+  //     return this.$i18n.locale
+  //   }
+  // },
+  // watch: {
+  //   area () {
+  //     this.setHeaders()
+  //   }
+  // },
+  // mounted: function () {
+  //   this.setHeaders()
+  //   let filter = null
+  //   const query = this.$route.query
+  //   Object.keys(query).forEach(function (key) {
+  //     if (key === 'ip') {
+  //       filter = query[key]
+  //     }
+  //   })
+  //   if (filter !== null) {
+  //     this.filter = filter
+  //     this.searchByIp(this.filter, false)
+  //     if (this.searchTimer !== null) {
+  //       clearInterval(this.searchTimer)
+  //     }
+  //     this.searchTimer = setInterval(() => {
+  //       this.searchByIp(this.filter, false)
+  //     }, 5000)
+  //   }
+  // }
 }
 </script>
 
diff --git a/dubbo-admin-ui/vue.config.js b/dubbo-admin-ui/vue.config.js
index 6aff3def..515e4760 100644
--- a/dubbo-admin-ui/vue.config.js
+++ b/dubbo-admin-ui/vue.config.js
@@ -18,8 +18,10 @@
 const path = require('path');
 
 module.exports = {
-  outputDir: "target/dist",
+  outputDir: "dist",
   lintOnSave: "warning",
+  assetsDir: 'static',
+  publicPath: '/',
   devServer: {
     port: 38082,
     historyApiFallback: {
@@ -27,7 +29,6 @@ module.exports = {
         {from: /.*/, to: path.posix.join('/', 'index.html')},
       ],
     },
-    publicPath: '/',
     proxy: {
       '/': {
         target: 'http://localhost:38080/',

Reply via email to