boss пре 5 дана
родитељ
комит
9a81ef8290
2 измењених фајлова са 4 додато и 4 уклоњено
  1. 2 1
      src/views/lobster/e2e-history/index.vue
  2. 2 3
      src/views/lobster/instance/index.vue

+ 2 - 1
src/views/lobster/e2e-history/index.vue

@@ -80,7 +80,8 @@ export default {
       this.loading = true
       try {
         const res = await listE2eRuns(this.query)
-        this.list = res.data || res || []
+        const d = res.data !== undefined ? res.data : res
+        this.list = Array.isArray(d) ? d : (d && d.list) || []
         this.stats = this.list.reduce((acc, x) => {
           if (x.status === 'SUCCESS') acc.success++
           else if (x.status === 'FAILED') acc.failed++

+ 2 - 3
src/views/lobster/instance/index.vue

@@ -199,9 +199,8 @@ export default {
     getList() {
       this.loading = true
       listInstances(this.queryParams).then(res => {
-        let data = res.data || {}
-        this.list = data.list || res.rows || []
-        // 计算统计
+        const data = res.data
+        this.list = Array.isArray(data) ? data : (data && data.list) || res.rows || []
         this.stats = { running: 0, paused: 0, pending_human: 0, completed: 0, terminated: 0 }
         this.list.forEach(item => {
           if (this.stats[item.status] !== undefined) this.stats[item.status]++