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

xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit f273aaa6bef7fbca943fbe61408cce035429a7a9
Author: Qian Xia <lauraxiaq...@gmail.com>
AuthorDate: Wed Apr 12 15:35:50 2023 +0800

    KYLIN-5503 no project issue
---
 kystudio/src/components/common/DataSourceBar/index.vue     | 14 ++++++++------
 kystudio/src/components/query/insight.vue                  |  5 ++++-
 kystudio/src/components/query/query_history_table.vue      | 10 ++++++----
 .../src/components/studio/StudioModel/ModelList/index.vue  |  1 +
 kystudio/src/components/studio/snapshot/snapshot.vue       |  1 +
 kystudio/src/locale/en.js                                  |  2 +-
 6 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/kystudio/src/components/common/DataSourceBar/index.vue 
b/kystudio/src/components/common/DataSourceBar/index.vue
index ab0836f50a..e78f4c68ec 100644
--- a/kystudio/src/components/common/DataSourceBar/index.vue
+++ b/kystudio/src/components/common/DataSourceBar/index.vue
@@ -208,7 +208,7 @@ export default class DataSourceBar extends Vue {
   treeKey = 'pagetree' + Number(new Date())
   filterText = ''
   isSearchIng = false
-  isLoadingTreeData = true // 用于处理查询搜索时loading 效果
+  isLoadingTreeData = false // 用于处理查询搜索时loading 效果
   datasources = []
   sourceTypes = sourceTypes
   allWords = []
@@ -310,10 +310,12 @@ export default class DataSourceBar extends Vue {
     this.$on('filter', (event) => {
       this.$refs.treeList && this.$refs.treeList.$emit('filter', event)
     })
-    this.initTree()
-    const tableLayout = document.getElementsByClassName('table-layout')
-    if (tableLayout && tableLayout.length) {
-      this.dataSourceDragData.limit.width[1] = tableLayout[0].offsetWidth - 60
+    if (this.projectName) {
+      this.initTree()
+      const tableLayout = document.getElementsByClassName('table-layout')
+      if (tableLayout && tableLayout.length) {
+        this.dataSourceDragData.limit.width[1] = tableLayout[0].offsetWidth - 
60
+      }
     }
   }
   addPagination (data) {
@@ -343,7 +345,7 @@ export default class DataSourceBar extends Vue {
       // }
       // freshTreeOrder(this)
       // this.selectFirstTable()
-      this.isLoadingTreeData = false
+      // this.isLoadingTreeData = false
       await this.loadTreeData()
     } catch (e) {
       handleError(e)
diff --git a/kystudio/src/components/query/insight.vue 
b/kystudio/src/components/query/insight.vue
index 11ad7de46b..8e87909107 100644
--- a/kystudio/src/components/query/insight.vue
+++ b/kystudio/src/components/query/insight.vue
@@ -223,6 +223,7 @@ export default class NewQuery extends Vue {
       })
     }, (res) => {
       this.savedSize = 0
+      handleError(res)
     })
   }
   loadSavedQuery (pageIndex) {
@@ -417,7 +418,9 @@ export default class NewQuery extends Vue {
         index: 0,
         cancelQuery: false
       }]
-    this.loadSavedQuerySize()
+    if (this.currentSelectedProject) {
+      this.loadSavedQuerySize()
+    }
   }
 }
 </script>
diff --git a/kystudio/src/components/query/query_history_table.vue 
b/kystudio/src/components/query/query_history_table.vue
index bf32a9f1f9..b121aa337a 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -72,7 +72,7 @@
                     <span class="text">{{props.row.query_id}}</span>
                   </p>
                   <p class="list">
-                    <span 
class="label">{{$t('kylinLang.query.duration')}}:</span>
+                    <span 
class="label">{{$t('kylinLang.query.latency_th')}}:</span>
                     <span class="text">
                       <el-popover
                         placement="bottom"
@@ -526,10 +526,12 @@ export default class QueryHistoryTable extends Vue {
   }
 
   created () {
-    if (this.queryHistoryFilter.includes('filterActions')) {
-      this.loadFilterSubmitterList()
+    if (this.currentSelectedProject) {
+      if (this.queryHistoryFilter.includes('filterActions')) {
+        this.loadFilterSubmitterList()
+      }
+      this.loadFilterHitModelsList() // 普通用户也支持筛选查询对象
     }
-    this.loadFilterHitModelsList() // 普通用户也支持筛选查询对象
   }
 
   // 清除查询开始事件筛选项
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/index.vue 
b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
index 80670ea147..3e246bfeef 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
@@ -745,6 +745,7 @@ export default class ModelList extends Vue {
   }
   // 加载模型列表
   loadModelsList () {
+    if (!this.currentSelectedProject) return
     this.prevExpendContent = this.modelArray.filter(item => 
this.expandedRows.includes(item.alias))
     this.loadingModels = true
     this.$el.click()
diff --git a/kystudio/src/components/studio/snapshot/snapshot.vue 
b/kystudio/src/components/studio/snapshot/snapshot.vue
index e28557b70b..8bf289e2fe 100644
--- a/kystudio/src/components/studio/snapshot/snapshot.vue
+++ b/kystudio/src/components/studio/snapshot/snapshot.vue
@@ -778,6 +778,7 @@ export default class Snapshot extends Vue {
     }
   }
   async getSnapshotList () {
+    if (!this.currentSelectedProject) return
     try {
       this.loadingSnapshotTable = true
       this.filter.project = this.currentSelectedProject
diff --git a/kystudio/src/locale/en.js b/kystudio/src/locale/en.js
index 8e205af8ca..fa9d97ad4c 100644
--- a/kystudio/src/locale/en.js
+++ b/kystudio/src/locale/en.js
@@ -398,7 +398,7 @@ exports.default = {
     type: 'Type',
     original: 'Original',
     startTime_th: 'Start Time',
-    latency_th: 'Duration',
+    latency_th: 'Query Time',
     realization_th: 'Answered By',
     acceleration_th: 'Acceleration',
     sqlContent_th: ' SQL Statement',

Reply via email to