You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2023/04/21 08:49:00 UTC

[kylin] branch kylin5 updated (2312dbf4ba -> d5dac0f4b4)

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

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


    from 2312dbf4ba [maven-release-plugin] prepare for next development iteration
     new 17f21a47ca KYLIN-5500 refine dimension trim issue
     new f3a3a061b7 KYLIN-5501 diagnostic last 30 days issue
     new a8fec1286b KYLIN-5502 filter snapshot values issue
     new f273aaa6be KYLIN-5503 no project issue
     new 73d0d5c387 KYLIN-5504 data-pick issue
     new bc9ae6188e KYLIN-5505 remove cc column when delete fact tabel
     new e230e0a782 KYLIN-5506 assign user group pagesize issue
     new a65978dbc0 KYLIN-5507 bulid snapshot values issue
     new eb07871c71 KYLIN-5508 show the query time of failed sql
     new beec59208d KYLIN-5509 add the select all option when export models
     new dedbb24031 KYLIN-5510 support modify the model description
     new 48e571344d KYLIN-5511 resolve the problem of RegExp in IE
     new 0f9c9ae761 KYLIN-5512 refine search history local
     new 69fc2624f9 KYLIN-5515 add search fields is_fuzzy
     new 0df2ab7836 KYLIN-5516 snapshot setting issue
     new 63cc18fb53 KYLIN-5517 export all models
     new d5dac0f4b4 KYLIN-5518 export tds add add fields

The 17 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 kystudio/package.json                              |   2 +-
 kystudio/src/components/admin/Diagnostic/index.vue |   9 +-
 .../src/components/admin/Diagnostic/locales.js     |   5 +-
 .../src/components/common/DataSourceBar/index.vue  |  20 +--
 .../src/components/common/GroupEditModal/index.vue |   1 +
 .../common/ModelsExportModal/ModelsExportModal.vue |  46 ++++---
 .../components/common/ModelsExportModal/locales.js |   3 +-
 .../src/components/common/UserEditModal/index.vue  | 116 ++++++++++++++++--
 .../src/components/common/UserEditModal/store.js   |   4 +-
 kystudio/src/components/common/editor.vue          |   9 +-
 kystudio/src/components/query/insight.vue          |   5 +-
 .../src/components/query/query_history_table.vue   |  22 ++--
 .../setting/SettingAdvanced/SettingAdvanced.vue    | 134 +++++++++++++++------
 .../components/setting/SettingAdvanced/handler.js  |  14 ++-
 .../components/setting/SettingAdvanced/locales.js  |   6 +
 .../studio/StudioModel/DimensionsModal/index.vue   |   3 +-
 .../studio/StudioModel/ModelEdit/index.vue         |   1 +
 .../studio/StudioModel/ModelEdit/locales.js        |   2 +-
 .../studio/StudioModel/ModelEdit/model.js          |  10 +-
 .../ModelList/ModelBuildModal/build.vue            |   2 -
 .../ModelList/ModelRenameModal/locales.js          |   3 +-
 .../ModelList/ModelRenameModal/rename.vue          |  10 +-
 .../studio/StudioModel/ModelList/index.vue         |   1 +
 .../snapshot/SnapshotModel/SnapshotModel.vue       |  46 +++++--
 .../src/components/studio/snapshot/snapshot.vue    |  47 ++++++--
 kystudio/src/locale/en.js                          |   2 +-
 kystudio/src/main.js                               |   6 +
 kystudio/src/service/model.js                      |   2 +-
 kystudio/src/service/user.js                       |   2 +-
 29 files changed, 407 insertions(+), 126 deletions(-)


[kylin] 15/17: KYLIN-5516 snapshot setting issue

Posted by xx...@apache.org.
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 0df2ab7836a45697f3b0120a63d22e632a8ebb6b
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Apr 14 16:12:13 2023 +0800

    KYLIN-5516 snapshot setting issue
---
 .../setting/SettingAdvanced/SettingAdvanced.vue    | 134 +++++++++++++++------
 .../components/setting/SettingAdvanced/handler.js  |  14 ++-
 .../components/setting/SettingAdvanced/locales.js  |   6 +
 .../studio/StudioModel/ModelEdit/index.vue         |   1 +
 4 files changed, 120 insertions(+), 35 deletions(-)

diff --git a/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue b/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
index 0ea34355a8..1c99c32203 100644
--- a/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
+++ b/kystudio/src/components/setting/SettingAdvanced/SettingAdvanced.vue
@@ -160,40 +160,6 @@
         </div>
       </el-form>
     </EditableBlock>
-    <!-- 分层存储 -->
-    <!-- <EditableBlock
-      :header-content="$t('secondaryStorage')"
-      :is-keep-editing="true"
-      :is-edited="!form.second_storage_enabled&&isFormEdited(form, 'sec-storage') || (form.second_storage_enabled && new_nodes.length > 0)"
-      :is-reset="false"
-      v-if="isShowSecondStorage"
-      @submit="(scb, ecb) => handleSubmit('sec-storage', scb, ecb)">
-      <div class="setting-item">
-        <span class="setting-label font-medium">{{$t('supportSecStorage')}}</span><span class="setting-value fixed ksd-fs-12">
-          <el-switch
-            v-model="form.second_storage_enabled"
-            :active-text="$t('kylinLang.common.OFF')"
-            :inactive-text="$t('kylinLang.common.ON')">
-          </el-switch>
-        </span>
-        <div class="setting-desc">{{$t('supportSecStorageDesc')}}</div>
-      </div>
-      <div class="setting-item">
-        <span class="setting-label font-medium">{{$t('storageNode')}}</span>
-        <ul class="sec-nodes" v-if="form.second_storage_nodes&&form.second_storage_nodes.length">
-          <li v-for="n in form.second_storage_nodes" :key="n.name">
-            <span class="node-name">{{n.name}}</span>
-            <span class="node-ip">{{n.ip}}:{{n.port}}</span>
-          </li>
-        </ul>
-        <el-select class="setting-desc secondary-storage-nodes" value-key="name" multiple v-model="new_nodes" :placeholder="$t('chooseNode')">
-          <el-option v-for="item in nodes" :label="`${item.name} ${item.ip}:${item.port}`" :key="item.name" :value="item">
-            <span class="node-name">{{item.name}}</span>
-            <span class="node-ip">{{item.ip}}:{{item.port}}</span>
-          </el-option>
-        </el-select>
-      </div>
-    </EditableBlock> -->
     <!-- 多级分区 -->
     <EditableBlock
       :header-content="$t('mulPartitionSettings')"
@@ -228,6 +194,43 @@
         </span>
         <div class="setting-desc">{{$t('snapshotDesc')}}</div>
       </div>
+      <div class="setting-item" v-if="form.snapshot_manual_management_enabled">
+        <span class="setting-label font-medium">{{$t('snapshotAutoRefresh')}}</span><span class="setting-value fixed ksd-fs-12">
+          <el-switch
+            v-model="form.snapshot_automatic_refresh_enabled"
+            :active-text="$t('kylinLang.common.OFF')"
+            :inactive-text="$t('kylinLang.common.ON')"
+            @input="value => handleSnapshotSwitchAutoRefresh(value)">
+          </el-switch>
+        </span>
+      </div>
+      <div class="setting-item" v-if="form.snapshot_manual_management_enabled&&form.snapshot_automatic_refresh_enabled">
+        <span class="setting-label font-medium">{{$t('frequency')}}</span><span class="setting-value fixed ksd-fs-12">
+          <el-input-number style="width:100px" size="small" @change="handleChangeRefreshTimeInterval" v-model.trim="form.snapshot_automatic_refresh_time_interval" v-number4="form.snapshot_automatic_refresh_time_interval" controls-position="right" :min="1" content-align="left">
+          </el-input-number><el-select
+            class="ksd-ml-16"
+            size="small"
+            style="width: 100px;"
+            v-model="form.snapshot_automatic_refresh_time_mode"
+            @change="handleChangeRefreshTimeMode"
+            :placeholder="$t('kylinLang.common.pleaseChoose')">
+            <el-option
+              v-for="frequencyType in frequencyTypes"
+              :key="frequencyType"
+              :label="$t(frequencyType.toLowerCase())"
+              :value="frequencyType">
+            </el-option>
+          </el-select>
+        </span><span v-if="form.snapshot_automatic_refresh_time_mode==='DAY'" class="setting-label font-medium ksd-ml-16">{{$t('timed')}}</span><span v-if="form.snapshot_automatic_refresh_time_mode==='DAY'" class="setting-value fixed ksd-fs-12">
+          <el-time-picker
+            style="width: 136px;"
+            size="small"
+            align="right"
+            @change="handleChangeRefreshTime"
+            v-model="form.snapshot_timed">
+          </el-time-picker>
+        </span>
+      </div>
     </EditableBlock>
     <!-- 可计算列 -->
     <EditableBlock
@@ -325,6 +328,7 @@ import { kylinConfirm } from 'util/business'
 import { apiUrl } from '../../../config'
 import {
   validate,
+  frequencyTypes,
   _getJobAlertSettings,
   _getDefaultDBSettings,
   _getYarnNameSetting,
@@ -402,6 +406,7 @@ export default class SettingAdvanced extends Vue {
   pageSize = pageCount
   convertedProperties = []
   pageRefTags = pageRefTags
+  frequencyTypes = frequencyTypes
   jobNotificationStateTypes=jobNotificationStateTypes
 
   dbList = []
@@ -422,6 +427,10 @@ export default class SettingAdvanced extends Vue {
     fileList: [],
     file: null,
     snapshot_manual_management_enabled: this.project.snapshot_manual_management_enabled,
+    snapshot_automatic_refresh_enabled: this.project.snapshot_automatic_refresh_enabled,
+    snapshot_automatic_refresh_time_interval: this.project.snapshot_automatic_refresh_time_interval || 1,
+    snapshot_automatic_refresh_time_mode: this.project.snapshot_automatic_refresh_time_mode || 'DAY',
+    snapshot_timed: new Date(new Date().setHours(+this.project.snapshot_automatic_refresh_trigger_hours, +this.project.snapshot_automatic_refresh_trigger_minute, +this.project.snapshot_automatic_refresh_trigger_second, 0)),
     multi_partition_enabled: this.project.multi_partition_enabled,
     scd2_enabled: this.project.scd2_enabled,
     second_storage_enabled: true,
@@ -554,6 +563,63 @@ export default class SettingAdvanced extends Vue {
       handleError(e)
     }
   }
+  async handleSnapshotSwitchAutoRefresh (value) {
+    const submitData = _getSnapshotSetting(this.project)
+    submitData.snapshot_automatic_refresh_enabled = value
+    try {
+      await this.updateSnapshotConfig(submitData)
+      this.$emit('reload-setting')
+      this.$message({ type: 'success', message: this.$t('kylinLang.common.updateSuccess') })
+    } catch (e) {
+      this.form.snapshot_snapshot_automatic_refresh_enabled = !value
+      handleError(e)
+    }
+  }
+  async handleChangeRefreshTimeInterval (value) {
+    const submitData = _getSnapshotSetting(this.project)
+    const oldValue = submitData.snapshot_automatic_refresh_time_interval
+    submitData.snapshot_automatic_refresh_time_interval = value
+    try {
+      await this.updateSnapshotConfig(submitData)
+      this.$emit('reload-setting')
+      this.$message({ type: 'success', message: this.$t('kylinLang.common.updateSuccess') })
+    } catch (e) {
+      submitData.snapshot_automatic_refresh_time_interval = oldValue
+      handleError(e)
+    }
+  }
+  async handleChangeRefreshTimeMode (value) {
+    const submitData = _getSnapshotSetting(this.project)
+    const oldValue = submitData.snapshot_automatic_refresh_time_mode
+    submitData.snapshot_automatic_refresh_time_mode = value
+    try {
+      await this.updateSnapshotConfig(submitData)
+      this.$emit('reload-setting')
+      this.$message({ type: 'success', message: this.$t('kylinLang.common.updateSuccess') })
+    } catch (e) {
+      submitData.snapshot_automatic_refresh_time_mode = oldValue
+      handleError(e)
+    }
+  }
+  async handleChangeRefreshTime (value) {
+    const submitData = _getSnapshotSetting(this.project)
+    const oldHoures = submitData.snapshot_automatic_refresh_trigger_hours
+    const oldMinute = submitData.snapshot_automatic_refresh_trigger_minute
+    const oldSecond = submitData.snapshot_automatic_refresh_trigger_second
+    submitData.snapshot_automatic_refresh_trigger_hours = new Date(value).getHours()
+    submitData.snapshot_automatic_refresh_trigger_minute = new Date(value).getMinutes()
+    submitData.snapshot_automatic_refresh_trigger_second = new Date(value).getSeconds()
+    try {
+      await this.updateSnapshotConfig(submitData)
+      this.$emit('reload-setting')
+      this.$message({ type: 'success', message: this.$t('kylinLang.common.updateSuccess') })
+    } catch (e) {
+      submitData.snapshot_automatic_refresh_trigger_hours = oldHoures
+      submitData.snapshot_automatic_refresh_trigger_minute = oldMinute
+      submitData.snapshot_automatic_refresh_trigger_second = oldSecond
+      handleError(e)
+    }
+  }
   async handleSwitch (value) {
     try {
       const submitData = _getExposeCCSetting(this.project)
diff --git a/kystudio/src/components/setting/SettingAdvanced/handler.js b/kystudio/src/components/setting/SettingAdvanced/handler.js
index 3ab1a8c307..f52c177b9f 100644
--- a/kystudio/src/components/setting/SettingAdvanced/handler.js
+++ b/kystudio/src/components/setting/SettingAdvanced/handler.js
@@ -65,10 +65,22 @@ export function _getSecStorageSetting (data) {
   }
 }
 
+export const frequencyTypes = [
+  'DAY',
+  'HOURS',
+  'MINUTE'
+]
+
 export function _getSnapshotSetting (data) {
   return {
     project: data.project,
-    snapshot_manual_management_enabled: data.snapshot_manual_management_enabled
+    snapshot_manual_management_enabled: data.snapshot_manual_management_enabled,
+    snapshot_automatic_refresh_enabled: data.snapshot_automatic_refresh_enabled,
+    snapshot_automatic_refresh_time_mode: data.snapshot_automatic_refresh_time_mode,
+    snapshot_automatic_refresh_time_interval: data.snapshot_automatic_refresh_time_interval,
+    snapshot_automatic_refresh_trigger_hours: data.snapshot_automatic_refresh_trigger_hours,
+    snapshot_automatic_refresh_trigger_minute: data.snapshot_automatic_refresh_trigger_minute,
+    snapshot_automatic_refresh_trigger_second: data.snapshot_automatic_refresh_trigger_second
   }
 }
 
diff --git a/kystudio/src/components/setting/SettingAdvanced/locales.js b/kystudio/src/components/setting/SettingAdvanced/locales.js
index 0afc2e478e..6c790d3969 100644
--- a/kystudio/src/components/setting/SettingAdvanced/locales.js
+++ b/kystudio/src/components/setting/SettingAdvanced/locales.js
@@ -68,6 +68,12 @@ export default {
     snapshotTitle: 'Snapshot Management',
     snapshotManagment: 'Support Snapshot Management',
     snapshotDesc: 'The snapshot is a read-only static view of a source table. Snapshot could reduce costs for building costs in some cases.',
+    snapshotAutoRefresh: 'Auto Refresh',
+    frequency: 'Frequency',
+    timed: 'Timed',
+    minute: 'Minute',
+    hours: 'Hour(s)',
+    day: 'Day(s)',
     openSnapshotTitle: 'Turn On Snapshot Management',
     openManualTips: 'After turning on this option, the system will no longer automatically build, refresh, delete snapshots. You could manage them in Snapshot page under Studio.<br/>If a snapshot is being built at this time, it will show in the snapshot list after the job is completed.<br/>Do you want to continue?',
     closeSnapshotTitle: 'Turn Off Snapshot Management',
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
index 5796b529a1..a88223201a 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
@@ -3365,6 +3365,7 @@ export default class ModelEdit extends Vue {
     .column-list-box {
       overflow: auto;
       overflow-x: hidden;
+      transform: perspective(10px);
       flex: 1;
       border-radius: 0 0 5px 5px;
       &.ksd-drag-box *[draggable="true"]:not(.is-link):hover {


[kylin] 17/17: KYLIN-5518 export tds add add fields

Posted by xx...@apache.org.
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 d5dac0f4b41ecf98a0d8bd46a3fce4f5a1fb76cc
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Apr 14 16:39:51 2023 +0800

    KYLIN-5518 export tds add add fields
---
 kystudio/src/service/model.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kystudio/src/service/model.js b/kystudio/src/service/model.js
index a563b3de6b..51004d16d5 100644
--- a/kystudio/src/service/model.js
+++ b/kystudio/src/service/model.js
@@ -328,6 +328,6 @@ export default {
     return Vue.resource(apiUrl + 'query/query_history/tired_storage_metrics').get(para)
   },
   validateExportTds: (para) => {
-    return Vue.resource(apiUrl + 'models/validate_export?project=' + para.project + '&model=' + para.modelId).get()
+    return Vue.resource(apiUrl + 'models/validate_export?project=' + para.project + '&model=' + para.modelId + '&element=' + para.element).get()
   }
 }


[kylin] 08/17: KYLIN-5507 bulid snapshot values issue

Posted by xx...@apache.org.
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 a65978dbc0b8c0a8113b208b6ffcde6bdd8a7545
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 16:49:38 2023 +0800

    KYLIN-5507 bulid snapshot values issue
---
 kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue b/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
index 6c0237370d..f7e891e3eb 100644
--- a/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
+++ b/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
@@ -715,7 +715,7 @@ export default class SnapshotModel extends Vue {
           partitions_to_build: item.partition_column ? item.partition_values : null
         }
       })
-      const incrementalBuildErrorList = Object.keys(options).filter(key => options[key].incremental_build && options[key].partitions_to_build.length === 0)
+      const incrementalBuildErrorList = Object.keys(options).filter(key => options[key].incremental_build && options[key].partitions_to_build && options[key].partitions_to_build.length === 0)
       this.incrementalBuildErrorList = incrementalBuildErrorList
       if (incrementalBuildErrorList.length > 0) return
       this.submitLoading = true


[kylin] 05/17: KYLIN-5504 data-pick issue

Posted by xx...@apache.org.
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 73d0d5c387bdd66e86469ea3f77b45c04d8230d6
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 15:48:14 2023 +0800

    KYLIN-5504 data-pick issue
---
 .../components/studio/StudioModel/ModelList/ModelBuildModal/build.vue   | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
index fa2941c6c7..9882c587a0 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
@@ -158,7 +158,6 @@
                   type="datetime"
                   style="width: 44%;"
                   :class="['ksd-mr-5', {'is-error': dateErrorMsg}]"
-                  :key="`prevPicker_${new Date(modelBuildMeta.dataRangeVal[0]).getTime()}`"
                   ref="prevPicker"
                   v-model="modelBuildMeta.dataRangeVal[0]"
                   :disabled="modelBuildMeta.isLoadExisted || isLoadingNewRange"
@@ -173,7 +172,6 @@
                   style="width: 44%;"
                   ref="nextPicker"
                   :class="{'is-error': dateErrorMsg}"
-                  :key="`prevPicker_${new Date(modelBuildMeta.dataRangeVal[1]).getTime()}`"
                   v-model="modelBuildMeta.dataRangeVal[1]"
                   :disabled="modelBuildMeta.isLoadExisted || isLoadingNewRange"
                   value-format="timestamp"


[kylin] 02/17: KYLIN-5501 diagnostic last 30 days issue

Posted by xx...@apache.org.
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 f3a3a061b7a452b018aa3146e6d237a964402647
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 11:48:45 2023 +0800

    KYLIN-5501 diagnostic last 30 days issue
---
 kystudio/src/components/admin/Diagnostic/index.vue  | 9 +++++----
 kystudio/src/components/admin/Diagnostic/locales.js | 5 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/kystudio/src/components/admin/Diagnostic/index.vue b/kystudio/src/components/admin/Diagnostic/index.vue
index 9fe385e43a..8886c79ccf 100644
--- a/kystudio/src/components/admin/Diagnostic/index.vue
+++ b/kystudio/src/components/admin/Diagnostic/index.vue
@@ -218,7 +218,7 @@ export default class Diagnostic extends Vue {
       {text: this.$t('lastHour'), label: 'lastHour'},
       {text: this.$t('lastDay'), label: 'lastDay'},
       {text: this.$t('lastThreeDay'), label: 'lastThreeDay'},
-      {text: this.$t('lastMonth'), label: 'lastMonth'},
+      {text: this.$t('lastThirtyDay'), label: 'lastThirtyDay'},
       {text: this.$t('custom'), label: 'custom'}
     ]
   }
@@ -263,7 +263,7 @@ export default class Diagnostic extends Vue {
   }
   // 日期在5分钟~1个月内
   get getDateTimeValid () {
-    return !this.dateTime.prev || !this.dateTime.next || this.getTimes(this.dateTime.prev) > this.getTimes(this.dateTime.next) || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) < 300000 || (this.getTimes(getPrevTimeValue({ date: this.dateTime.next, m: 1 })) - this.getTimes(this.dateTime.prev)) > 0
+    return !this.dateTime.prev || !this.dateTime.next || this.getTimes(this.dateTime.prev) > this.getTimes(this.dateTime.next) || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) < 300000 || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) > 30 * 24 * 60 * 60 * 1000
   }
   // 是否展示手动下载提示
   // get showManualDownloadLayout () {
@@ -349,8 +349,9 @@ export default class Diagnostic extends Vue {
         this.dateTime.prev = new Date(t)
         this.dateTime.next = date
         break
-      case 'lastMonth':
-        this.dateTime.prev = new Date(getPrevTimeValue({ date, m: 1 }))
+        case 'lastThirtyDay':
+        t = dt - 30 * 24 * 60 * 60 * 1000
+        this.dateTime.prev = new Date(t)
         this.dateTime.next = date
         break
       case 'custom':
diff --git a/kystudio/src/components/admin/Diagnostic/locales.js b/kystudio/src/components/admin/Diagnostic/locales.js
index 86374ae905..fb35bedb23 100644
--- a/kystudio/src/components/admin/Diagnostic/locales.js
+++ b/kystudio/src/components/admin/Diagnostic/locales.js
@@ -9,9 +9,10 @@ export default {
     lastHour: 'Last 1 Hour',
     lastDay: 'Last 1 Day',
     lastThreeDay: 'Last 3 Days',
+    lastThirtyDay: 'Last 30 Days',
     lastMonth: 'Last 1 Month',
     custom: 'Customize',
-    customTimeTip: 'The time range could vary from 5 minutes to 1 month.',
+    customTimeTip: 'The time range could vary from 5 minutes to 30 days.',
     selectDatePlaceholder: 'Select Date',
     server: 'Server',
     downloadTip: 'The diagnostic package would be downloaded automatically once it\'s successfully generated.',
@@ -33,7 +34,7 @@ export default {
     modelTitle: 'Notice',
     confrimBtn: 'Discard',
     cancelBtn: 'Cancel',
-    timeErrorMsg: 'The time range must be greater than or equal to 5 minutes and less than or equal  to 1 month. Please reselect.',
+    timeErrorMsg: 'The time range must be greater than or equal to 5 minutes and less than or equal  to 30 days. Please reselect.',
     selectServerTip: 'Please select the server(s)',
     selectServerPlaceHolder: 'Please select server',
     downloadJobDiagPackage1: 'The diagnostic package includes this job’s logs for the executor, driver and project metadata. For other error like query error, please download system diagnostic package in ',


[kylin] 13/17: KYLIN-5512 refine search history local

Posted by xx...@apache.org.
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 0f9c9ae7619da69cd4bb5a26407c51d33fe09834
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 18:39:54 2023 +0800

    KYLIN-5512 refine search history local
---
 kystudio/src/components/query/query_history_table.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index 232cfdcad9..d9c8ec41c3 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -337,7 +337,7 @@ import Diagnostic from 'components/admin/Diagnostic/index'
     'en': {
       queryDetails: 'Query Details',
       ruleDesc: 'Favorite Condition:<br/>Query Frequency (default by daily);<br/>Query Duration;<br/>From user/ user group;<br/>Pushdown Query.',
-      searchSQL: 'Search one keyword or query ID',
+      searchSQL: 'Search Query ID or SQL Statement',
       noSpaceTips: 'Invalide entering: cannot search space',
       sqlDetailTip: 'Please click sql to get more informations',
       taskStatus: 'Task Status',


[kylin] 03/17: KYLIN-5502 filter snapshot values issue

Posted by xx...@apache.org.
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 a8fec1286b2ebe410bf46dd451582ff403fa79cf
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 15:07:56 2023 +0800

    KYLIN-5502 filter snapshot values issue
---
 kystudio/src/components/admin/Diagnostic/index.vue |  2 +-
 .../snapshot/SnapshotModel/SnapshotModel.vue       | 44 +++++++++++++++++----
 .../src/components/studio/snapshot/snapshot.vue    | 46 +++++++++++++++++-----
 3 files changed, 74 insertions(+), 18 deletions(-)

diff --git a/kystudio/src/components/admin/Diagnostic/index.vue b/kystudio/src/components/admin/Diagnostic/index.vue
index 8886c79ccf..7f3dbd3468 100644
--- a/kystudio/src/components/admin/Diagnostic/index.vue
+++ b/kystudio/src/components/admin/Diagnostic/index.vue
@@ -349,7 +349,7 @@ export default class Diagnostic extends Vue {
         this.dateTime.prev = new Date(t)
         this.dateTime.next = date
         break
-        case 'lastThirtyDay':
+      case 'lastThirtyDay':
         t = dt - 30 * 24 * 60 * 60 * 1000
         this.dateTime.prev = new Date(t)
         this.dateTime.next = date
diff --git a/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue b/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
index 4248ba97dd..6c0237370d 100644
--- a/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
+++ b/kystudio/src/components/studio/snapshot/SnapshotModel/SnapshotModel.vue
@@ -134,6 +134,9 @@
                 multiple
                 collapse-tags
                 filterable
+                remote
+                :remote-method="query => filterPartitionValues(item, query)"
+                @blur="filterPartitionValues(item, '')"
                 :loading="item.loadPatitionValues"
                 @change="changePartitionValues(item)"
                 :disabled="!item.partition_column"
@@ -141,26 +144,26 @@
                 <el-option-group
                   class="group-partitions"
                   :label="$t('readyPartitions')">
-                  <span class="partition-count">{{item.readyPartitions.length}}</span>
+                  <span class="partition-count">{{item.readyPartitionsFilter.length}}</span>
                   <el-option
-                    v-for="item in item.readyPartitions.slice(0, item.pageSize * item.pageReadyPartitionsSize)"
+                    v-for="item in item.readyPartitionsFilter.slice(0, item.pageSize * item.pageReadyPartitionsSize)"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value">
                   </el-option>
-                  <p class="page-value-more" v-show="item.pageReadyPartitionsSize * item.pageSize < item.readyPartitions.length" @click.stop="item.pageReadyPartitionsSize += 1">{{$t('kylinLang.common.loadMore')}}</p>
+                  <p class="page-value-more" v-show="item.pageReadyPartitionsSize * item.pageSize < item.readyPartitionsFilter.length" @click.stop="item.pageReadyPartitionsSize += 1">{{$t('kylinLang.common.loadMore')}}</p>
                 </el-option-group>
                 <el-option-group
                   class="group-partitions"
                   :label="$t('notReadyPartitions')">
-                  <span class="partition-count">{{item.notReadyPartitions.length}}</span>
+                  <span class="partition-count">{{item.notReadyPartitionsFilter.length}}</span>
                   <el-option
-                    v-for="item in item.notReadyPartitions.slice(0, item.pageSize * item.pageNotReadyPartitions)"
+                    v-for="item in item.notReadyPartitionsFilter.slice(0, item.pageSize * item.pageNotReadyPartitions)"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value">
                   </el-option>
-                  <p class="page-value-more" v-show="item.pageNotReadyPartitions * item.pageSize < item.notReadyPartitions.length" @click.stop="item.pageNotReadyPartitions += 1">{{$t('kylinLang.common.loadMore')}}</p>
+                  <p class="page-value-more" v-show="item.pageNotReadyPartitions * item.pageSize < item.notReadyPartitionsFilter.length" @click.stop="item.pageNotReadyPartitions += 1">{{$t('kylinLang.common.loadMore')}}</p>
                 </el-option-group>
               </el-select>
               <p class="error-tip" v-if="incrementalBuildErrorList.includes(`${item.database}.${item.table}`)">{{$t('noPartitionValuesError')}}</p>
@@ -214,6 +217,7 @@ import TreeList from '../../../common/TreeList'
 import arealabel from '../../../common/area_label.vue'
 import { getTableTree, getDatabaseTablesTree } from './handler'
 import Scrollbar from 'smooth-scrollbar'
+import { objectClone } from '../../../../util'
 
 vuex.registerModule(['modals', 'SnapshotModel'], store)
 @Component({
@@ -610,8 +614,8 @@ export default class SnapshotModel extends Vue {
           const values = partitionValues[`${item.database}.${item.table}`]
           self.readyPartitions = values.ready_partitions.map(it => ({label: it, value: it}))
           self.notReadyPartitions = values.not_ready_partitions.map(it => ({label: it, value: it}))
-          // this.$set(item, 'readyPartitions', values.ready_partitions.map(it => ({label: it, value: it})))
-          // this.$set(item, 'notReadyPartitions', values.not_ready_partitions.map(it => ({label: it, value: it})))
+          self.readyPartitionsFilter = objectClone(self.readyPartitions)
+          self.notReadyPartitionsFilter = objectClone(self.notReadyPartitions)
           this.refreshSelectValue = false
           this.$nextTick(() => {
             this.refreshSelectValue = true
@@ -620,12 +624,16 @@ export default class SnapshotModel extends Vue {
           item.partition_values = []
           item.readyPartitions = []
           item.notReadyPartitions = []
+          item.readyPartitionsFilter = []
+          item.notReadyPartitionsFilter = []
         }
         self.loadPatitionValues = false
       } else {
         item.partition_values = []
         item.readyPartitions = []
         item.notReadyPartitions = []
+        item.readyPartitionsFilter = []
+        item.notReadyPartitionsFilter = []
       }
 
       this.partitionOptions[`${item.database}.${item.table}`] = {
@@ -674,7 +682,9 @@ export default class SnapshotModel extends Vue {
             fetchError: false,
             undefinedPartitionColErrorTip: false,
             notReadyPartitions: [],
+            notReadyPartitionsFilter: [],
             readyPartitions: [],
+            readyPartitionsFilter: [],
             loadPatitionValues: false,
             pageReadyPartitionsSize: 1,
             pageNotReadyPartitions: 1,
@@ -764,6 +774,24 @@ export default class SnapshotModel extends Vue {
     this.searchDBOrTableName = ''
   }
 
+  filterPartitionValues (item, query) {
+    if (query !== '') {
+      item.loadPatitionValues = true
+      this.$nextTick(() => {
+        item.readyPartitionsFilter = item.readyPartitions.filter(p => {
+          return p.value.indexOf(query) !== -1
+        })
+        item.notReadyPartitionsFilter = item.notReadyPartitions.filter(p => {
+          return p.value.indexOf(query) !== -1
+        })
+        item.loadPatitionValues = false
+      })
+    } else {
+      item.readyPartitionsFilter = objectClone(item.readyPartitions)
+      item.notReadyPartitionsFilter = objectClone(item.notReadyPartitions)
+    }
+  }
+
   // 改变分区列的值
   changePartitionValues (column) {
     const index = this.incrementalBuildErrorList.findIndex(it => it === `${column.database}.${column.table}`)
diff --git a/kystudio/src/components/studio/snapshot/snapshot.vue b/kystudio/src/components/studio/snapshot/snapshot.vue
index d75e6c2adc..e28557b70b 100644
--- a/kystudio/src/components/studio/snapshot/snapshot.vue
+++ b/kystudio/src/components/studio/snapshot/snapshot.vue
@@ -285,32 +285,36 @@
                   :disabled="!scope.row.select_partition_col"
                   multiple
                   @change="changePartitionValues(scope)"
-                  :placeholder="scope.row.select_partition_col && (scope.row.readyPartitions.length > 0 || scope.row.notReadyPartitions.length > 0) ? $t('kylinLang.common.pleaseSelect') : ''"
+                  :placeholder="scope.row.select_partition_col && (scope.row.readyPartitionsFilter.length > 0 || scope.row.notReadyPartitionsFilter.length > 0) ? $t('kylinLang.common.pleaseSelect') : ''"
                   collapse-tags
+                  :loading="scope.row.loadPatitionValues"
+                  remote
+                  :remote-method="query => filterPartitionValues(scope.row, query)"
+                  @blur="filterPartitionValues(scope.row, '')"
                   filterable>
                   <el-option-group
                     class="group-partitions"
                     :label="$t('readyPartitions')">
-                    <span class="partition-count">{{scope.row.readyPartitions.length}}</span>
+                    <span class="partition-count">{{scope.row.readyPartitionsFilter.length}}</span>
                     <el-option
-                      v-for="item in scope.row.readyPartitions.slice(0, scope.row.pageReadyPartitionsSize * scope.row.pageSize)"
+                      v-for="item in scope.row.readyPartitionsFilter.slice(0, scope.row.pageReadyPartitionsSize * scope.row.pageSize)"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value">
                     </el-option>
-                    <p class="page-value-more" v-show="scope.row.pageReadyPartitionsSize * scope.row.pageSize < scope.row.readyPartitions.length" @click.stop="scope.row.pageReadyPartitionsSize += 1">{{$t('kylinLang.common.loadMore')}}</p>
+                    <p class="page-value-more" v-show="scope.row.pageReadyPartitionsSize * scope.row.pageSize < scope.row.readyPartitionsFilter.length" @click.stop="scope.row.pageReadyPartitionsSize += 1">{{$t('kylinLang.common.loadMore')}}</p>
                   </el-option-group>
                   <el-option-group
                     class="group-partitions"
                     :label="$t('notReadyPartitions')">
-                    <span class="partition-count">{{scope.row.notReadyPartitions.length}}</span>
+                    <span class="partition-count">{{scope.row.notReadyPartitionsFilter.length}}</span>
                     <el-option
-                      v-for="item in scope.row.notReadyPartitions.slice(0, scope.row.pageNotReadyPartitions * scope.row.pageSize)"
+                      v-for="item in scope.row.notReadyPartitionsFilter.slice(0, scope.row.pageNotReadyPartitions * scope.row.pageSize)"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value">
                     </el-option>
-                    <p class="page-value-more" v-show="scope.row.pageNotReadyPartitions * scope.row.pageSize < scope.row.notReadyPartitions.length" @click.stop="scope.row.pageNotReadyPartitions += 1">{{$t('kylinLang.common.loadMore')}}</p>
+                    <p class="page-value-more" v-show="scope.row.pageNotReadyPartitions * scope.row.pageSize < scope.row.notReadyPartitionsFilter.length" @click.stop="scope.row.pageNotReadyPartitions += 1">{{$t('kylinLang.common.loadMore')}}</p>
                   </el-option-group>
                 </el-select>
                 <p class="error-tip" v-if="incrementalBuildErrorList.includes(`${scope.row.database}.${scope.row.table}`)">{{$t('noPartitionValuesError')}}</p>
@@ -343,7 +347,7 @@ import { mapGetters, mapActions } from 'vuex'
 import { Component } from 'vue-property-decorator'
 
 import locales from './locales'
-import { handleSuccessAsync, handleError, kylinConfirm, sliceNumber } from '../../../util'
+import { handleSuccessAsync, handleError, kylinConfirm, sliceNumber, objectClone } from '../../../util'
 import { pageRefTags, bigPageCount } from 'config'
 import SnapshotModel from './SnapshotModel/SnapshotModel.vue'
 
@@ -452,6 +456,7 @@ export default class Snapshot extends Vue {
     this.refreshNewPartition = true
     this.incrementalBuildErrorList = []
     this.loadSnapshotValues = false
+    this.refreshType = 'full'
   }
 
   // 刷新 snapshot
@@ -678,11 +683,14 @@ export default class Snapshot extends Vue {
       ...it,
       partition_values: [],
       readyPartitions: [],
+      readyPartitionsFilter: [],
       notReadyPartitions: [],
+      notReadyPartitionsFilter: [],
       pageReadyPartitionsSize: 1,
       pageNotReadyPartitions: 1,
       pageSize: 100,
-      values: []
+      values: [],
+      loadPatitionValues: false
     }))
   }
   async refreshSnapshot () {
@@ -707,6 +715,8 @@ export default class Snapshot extends Vue {
             item.partition_values = []
             item['readyPartitions'] = partitionValues[`${item.database}.${item.table}`].ready_partitions.map(it => ({label: it, value: it}))
             item['notReadyPartitions'] = partitionValues[`${item.database}.${item.table}`].not_ready_partitions.map(it => ({label: it, value: it}))
+            item['readyPartitionsFilter'] = objectClone(item.readyPartitions)
+            item['notReadyPartitionsFilter'] = objectClone(item.notReadyPartitions)
           }
         })
       }
@@ -794,6 +804,24 @@ export default class Snapshot extends Vue {
     }
   }
 
+  filterPartitionValues (item, query) {
+    if (query !== '') {
+      item.loadPatitionValues = true
+      this.$nextTick(() => {
+        item.readyPartitionsFilter = item.readyPartitions.filter(p => {
+          return p.value.indexOf(query) !== -1
+        })
+        item.notReadyPartitionsFilter = item.notReadyPartitions.filter(p => {
+          return p.value.indexOf(query) !== -1
+        })
+        item.loadPatitionValues = false
+      })
+    } else {
+      item.readyPartitionsFilter = objectClone(item.readyPartitions)
+      item.notReadyPartitionsFilter = objectClone(item.notReadyPartitions)
+    }
+  }
+
   // 更改刷新的分区列
   changePartitionValues (scope) {
     const index = this.incrementalBuildErrorList.findIndex(it => it === `${scope.row.database}.${scope.row.table}`)


[kylin] 06/17: KYLIN-5505 remove cc column when delete fact tabel

Posted by xx...@apache.org.
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 bc9ae6188e6632ba57899cf9e57e1ac9a5ce66d3
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 15:53:16 2023 +0800

    KYLIN-5505 remove cc column when delete fact tabel
---
 .../src/components/studio/StudioModel/ModelEdit/locales.js     |  2 +-
 kystudio/src/components/studio/StudioModel/ModelEdit/model.js  | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/locales.js b/kystudio/src/components/studio/StudioModel/ModelEdit/locales.js
index 4e169e47b1..de9a6443c8 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/locales.js
@@ -21,7 +21,7 @@ export default {
     'systemMaintainedTip3': 'System can delete this model',
     'avoidSysChange': 'Avoid system change semantics',
     'allowSysChange': 'Allow system change semantics',
-    'delTableTip': 'All dimensions, measures and joins using this table would be deleted. Are you sure you want to delete this table?',
+    'delTableTip': 'All dimensions, measures,joins and computed columns using this table would be deleted. Are you sure you want to delete this table?',
     'noFactTable': 'Please select a fact table.',
     switchLookup: 'Set as Dimension Table',
     switchFact: 'Set as Fact Table',
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
index 8357231de8..ebef7523cc 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
@@ -835,11 +835,19 @@ class NModel extends Schama {
       // 删除对应的 tableindex
       this._delTableIndexByAlias(alias)
       // 删除对应的 cc
-      // this._delCCByAlias(alias)
+      this._delCCByAlias(alias)
       // 删除对应的partition
       this._delTableRelatedPartitionInfo(ntable)
     }
   }
+  _delCCByAlias (tableAlias) {
+    const ccList = this._mount.computed_columns.filter(it => it.tableAlias !== tableAlias)
+    this._mount.computed_columns = ccList
+    ccList.forEach(cc => {
+      let ccColumnName = typeof cc === 'object' ? cc.columnName : cc
+      this._delCCRelated(tableAlias, ccColumnName)
+    })
+  }
   getTable (key, val) {
     for (var i in this.tables) {
       if (this.tables[i][key] === val) {


[kylin] 01/17: KYLIN-5500 refine dimension trim issue

Posted by xx...@apache.org.
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 17f21a47ca764438fc93a729bbe93ac6add42f33
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 11:25:50 2023 +0800

    KYLIN-5500 refine dimension trim issue
---
 kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
index 5ed456fb2d..64e98f5e18 100644
--- a/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/DimensionsModal/index.vue
@@ -562,7 +562,7 @@ export default class DimensionsModal extends Vue {
     const tableValue = Object.values(this.tables)
     const names = []
     tableValue.forEach(item => {
-      names.push(...item.columns.map(it => it.alias || it.name))
+      names.push(...item.columns.map(it => it.alias || it.name.trim()))
     })
     tableValue.forEach((table, idx) => {
       if (table.kind === 'FACT') {
@@ -577,6 +577,7 @@ export default class DimensionsModal extends Vue {
       let others = this.otherColumns.length ? this.otherColumns : this.modelDesc.all_named_columns.filter(item => !selectedColumns.includes(item.column))
       // 将已经选上的dimension回显到界面上
       table.columns && table.columns.forEach((col, index) => {
+        col.name = col.name.trim()
         this.$set(col, 'tableName', table.alias)
         this.$set(col, 'alias', this.getUniqueAlias(this.uniqueAliasObj, col.name.replace(unIncludedNameRegex, ''))) // 去除不符合维度命名的字符)
         this.$set(col, 'isSelected', false)


[kylin] 10/17: KYLIN-5509 add the select all option when export models

Posted by xx...@apache.org.
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 beec59208ded73c4d346013be09a306a0ee3cfb0
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 17:33:03 2023 +0800

    KYLIN-5509 add the select all option when export models
---
 .../common/ModelsExportModal/ModelsExportModal.vue | 43 +++++++++++-----------
 .../components/common/ModelsExportModal/locales.js |  3 +-
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue b/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
index 197fb87320..9c2b38d3c6 100644
--- a/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
+++ b/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
@@ -23,24 +23,9 @@
         </div>
       </div>
       <p class="export-tips">{{$t('exportOneModelTip')}}</p>
-      <!-- <p v-if="choosedModelsArr.length > 0" class="choosed-block">{{choosedModelsArr.join(', ')}}</p> -->
-      <!-- <el-tree
-        highlight-current
-        v-if="type === 'all'"
-        check-strictly
-        class="model-tree"
-        ref="tree"
-        node-key="id"
-        v-show="!isTreeEmpty"
-        :data="models"
-        :props="{ label: 'name', isLeaf: true }"
-        :show-checkbox="getIsNodeShowCheckbox"
-        :render-content="renderContent"
-        :filter-node-method="handleFilterNode"
-        @check="handleSelectModels"
-      /> -->
       <div class="export-model-list" v-if="type === 'all'">
         <el-checkbox-group v-model="selectedModals" @change="handleSelectModels">
+          <el-checkbox label="all" :disabled="allModelItems.status === 'BROKEN'" v-if="type === 'all'"><span>{{$t(allModelItems.name)}}</span></el-checkbox>
           <el-checkbox v-for="item in exportModal.list" :disabled="item.status === 'BROKEN'" :label="item.id" :key="item.id">
             <el-tooltip :content="$t('exportBrokenModelCheckboxTip')" effect="dark" placement="top" :disabled="item.status !== 'BROKEN'">
               <span>{{item.name}}</span>
@@ -82,6 +67,7 @@ import vuex, { actionTypes } from '../../../store'
 import locales from './locales'
 import store from './store'
 import OverflowTextTooltip from '../OverflowTextTooltip/OverflowTextTooltip.vue'
+import { objectClone } from '../../../util'
 
 vuex.registerModule(['modals', 'ModelsExportModal'], store)
 
@@ -148,15 +134,26 @@ export default class ModelsExportModal extends Vue {
     newVal && !oldVal && (this.exportModalList = this.models)
   }
 
+  get allModelItems () {
+    return {
+      has_multiple_partition_values: this.models.filter(it => it.has_multiple_partition_values).length > 0,
+      has_override_props: this.models.filter(it => it.has_override_props).length > 0,
+      has_recommendations: this.models.filter(it => it.has_recommendations).length > 0,
+      name: 'selectAll',
+      id: 'all',
+      status: this.models.filter(it => it.status === 'BROKEN').length === this.models.length ? 'BROKEN' : 'ONLINE'
+    }
+  }
+
   getIsNodeShowCheckbox (data) {
     return data.nodeType === 'model'
   }
 
   changeCheckboxType (type) {
     if (type === 'ops') {
-      return this.models.filter(it => this.selectedModals.includes(it.id) && !it.has_override_props).length
+      return (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => this.selectedModals.includes(it.id) && !it.has_override_props).length
     } else if (type === 'mult-partition') {
-      return this.models.filter(it => this.selectedModals.includes(it.id) && !it.has_multiple_partition_values).length
+      return (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => this.selectedModals.includes(it.id) && !it.has_multiple_partition_values).length
     }
   }
 
@@ -206,8 +203,8 @@ export default class ModelsExportModal extends Vue {
   }
 
   handleSelectModels (data) {
-    const hasOverrideProps = this.models.filter(it => data.includes(it.id) && it.has_override_props)
-    const hasMultPartitions = this.models.filter(it => data.includes(it.id) && it.has_multiple_partition_values)
+    const hasOverrideProps = (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => data.includes(it.id) && it.has_override_props)
+    const hasMultPartitions = (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => data.includes(it.id) && it.has_multiple_partition_values)
     this.setModalForm({
       ids: data,
       exportOverProps: !hasOverrideProps.length && this.form.exportOverProps ? false : this.form.exportOverProps,
@@ -251,9 +248,13 @@ export default class ModelsExportModal extends Vue {
   async handleSubmit () {
     const { project, form } = this
     this.isSubmiting = true
+    const formData = objectClone(form)
+    if (formData.ids.includes('all')) {
+      formData.ids = this.models.map(it => it.uuid)
+    }
     try {
       // if (this.type !== 'all') {
-      await this.downloadModelsMetadata({ project, form })
+      await this.downloadModelsMetadata({ project, form: formData })
       // } else {}
       this.handleClose(true)
       this.$message.success(this.$t('exportSuccess'))
diff --git a/kystudio/src/components/common/ModelsExportModal/locales.js b/kystudio/src/components/common/ModelsExportModal/locales.js
index fac6fc0ea2..483b3fa9c3 100644
--- a/kystudio/src/components/common/ModelsExportModal/locales.js
+++ b/kystudio/src/components/common/ModelsExportModal/locales.js
@@ -18,6 +18,7 @@ export default {
     disabledOverrideTip: 'No overrides for the selected model(s)',
     exportBrokenModelCheckboxTip: 'Can\'t export model file at the moment as the model is BROKEN',
     subPartitionValues: 'Sub partition values',
-    disabledMultPartitionTip: 'No subpartitions included in the selected model(s)'
+    disabledMultPartitionTip: 'No subpartitions included in the selected model(s)',
+    selectAll: 'Select All'
   }
 }


[kylin] 04/17: KYLIN-5503 no project issue

Posted by xx...@apache.org.
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 <la...@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',


[kylin] 12/17: KYLIN-5511 resolve the problem of RegExp in IE

Posted by xx...@apache.org.
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 48e571344df663e0059b07625cdfb8c29f89f880
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 18:37:33 2023 +0800

    KYLIN-5511 resolve the problem of RegExp in IE
---
 kystudio/package.json                                 | 2 +-
 kystudio/src/components/common/editor.vue             | 9 +++++----
 kystudio/src/components/query/query_history_table.vue | 6 +++---
 kystudio/src/main.js                                  | 6 ++++++
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/kystudio/package.json b/kystudio/package.json
index e48263d1f1..98802c940d 100644
--- a/kystudio/package.json
+++ b/kystudio/package.json
@@ -109,7 +109,7 @@
     "webpack": "^2.2.1",
     "webpack-bundle-analyzer": "^3.3.2",
     "webpack-dev-middleware": "^1.10.0",
-    "webpack-hot-middleware": "^2.16.1",
+    "webpack-hot-middleware": "2.16.1",
     "webpack-merge": "^2.6.1"
   },
   "engines": {
diff --git a/kystudio/src/components/common/editor.vue b/kystudio/src/components/common/editor.vue
index 83aecc434d..2675054d0f 100644
--- a/kystudio/src/components/common/editor.vue
+++ b/kystudio/src/components/common/editor.vue
@@ -26,8 +26,9 @@
   </div>
 </template>
 <script>
-import { format } from 'sql-formatter'
+// import { format } from 'sql-formatter'
 import { sqlRowsLimit, sqlStrLenLimit, formatSQLConfig } from '../../config/index'
+import { isIE } from '../../util'
 import { mapState } from 'vuex'
 import Vue from 'vue'
 import { Component } from 'vue-property-decorator'
@@ -141,12 +142,12 @@ import { Component } from 'vue-property-decorator'
     abridgeData () {
       const splitData = this.editorData.split('\n')
       // 需要截断的默认都是已经格式化后的,如果传入需要格式化,就再手动格式化,且格式化方式是通过字符串长度判断
-      if (this.needFormater && (splitData.length === 1 || (splitData.length === 2 && /^LIMIT (\d+)/.test(splitData[1])))) {
+      if (!isIE() && this.needFormater && (splitData.length === 1 || (splitData.length === 2 && /^LIMIT (\d+)/.test(splitData[1])))) {
         const data = this.editorData.length > sqlStrLenLimit ? `${this.editorData.slice(0, sqlStrLenLimit)}...` : this.editorData
         // 是否显示 tips 取决于填入的 sql 字符数是否超过全局配置的
         this.showLimitTip = this.editorData.length > sqlStrLenLimit
-        this.formatData = format(data, formatSQLConfig)
-        this.fullFormatData = format(this.editorData, formatSQLConfig)
+        this.formatData = this._formatSql(data, formatSQLConfig)
+        this.fullFormatData = this._formatSql(this.editorData, formatSQLConfig)
       } else {
         const data = this.editorData.split('\n')
         // 是否显示 tips 取决于填入的 sql 行数是否超过全局配置的
diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index b20bd9f7bd..232cfdcad9 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -297,13 +297,13 @@
 
 <script>
 import { transToGmtTime, getStringLength, handleError } from '../../util/business'
-import { handleSuccessAsync } from '../../util'
+import { handleSuccessAsync, isIE } from '../../util'
 import Vue from 'vue'
 import { mapActions, mapGetters } from 'vuex'
 import { Component, Watch } from 'vue-property-decorator'
 // import $ from 'jquery'
 import { sqlRowsLimit, sqlStrLenLimit, formatSQLConfig } from '../../config/index'
-import { format } from 'sql-formatter'
+// import { format } from 'sql-formatter'
 import IndexDetails from '../studio/StudioModel/ModelList/ModelAggregate/indexDetails'
 import Diagnostic from 'components/admin/Diagnostic/index'
 @Component({
@@ -434,7 +434,7 @@ export default class QueryHistoryTable extends Vue {
       const sql = element.sql_text
       const sql_limit = this.sqlOverLimit(sql) ? `${sql.slice(0, this.sqlLimitRows)}...` : sql
       const sqlTextArr = sql.split('\n') // 换行符超过一个,说明用户查询行自定义过format格式,则保留
-      element['sql_limit'] = sqlTextArr.length > 1 ? sql_limit : format(sql_limit, formatSQLConfig)
+      element['sql_limit'] = (sqlTextArr.length > 1 || isIE()) ? sql_limit : this._formatSql(sql_limit, formatSQLConfig)
       element['server'] = [element['server']]
       element['flexHeight'] = 0
       element['editorH'] = 0
diff --git a/kystudio/src/main.js b/kystudio/src/main.js
index fdc85f184c..faac4b1d44 100644
--- a/kystudio/src/main.js
+++ b/kystudio/src/main.js
@@ -43,8 +43,14 @@ Vue.component('kylin-editor', kylinEditor)
 Vue.component('kylin-tab', tab)
 Vue.component('kylin-loading', kylinLoading)
 Vue.component('kylin-empty-data', emptyData)
+import { isIE } from './util'
 import { pageRefTags } from 'config'
 
+if (!isIE()) {
+  const { format } = require('sql-formatter')
+  Vue.prototype._formatSql = format
+}
+
 Vue.use(ElementUI, {
   closeOtherMessages: true,
   errorMessageDuration: 10000,


[kylin] 16/17: KYLIN-5517 export all models

Posted by xx...@apache.org.
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 63cc18fb5359e4577fea15c5c819e5e67bb8a962
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Apr 14 16:31:50 2023 +0800

    KYLIN-5517 export all models
---
 .../common/ModelsExportModal/ModelsExportModal.vue | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue b/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
index 9c2b38d3c6..3b3b701b39 100644
--- a/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
+++ b/kystudio/src/components/common/ModelsExportModal/ModelsExportModal.vue
@@ -23,9 +23,9 @@
         </div>
       </div>
       <p class="export-tips">{{$t('exportOneModelTip')}}</p>
+      <el-checkbox v-if="type === 'all'" class="ksd-mb-8 ksd-ml-10" :indeterminate="isIndeterminate" v-model="checkAll" :disabled="allModelItems.status === 'BROKEN'" @change="handleSelectAllModels"><span>{{$t('selectAll')}}</span></el-checkbox>
       <div class="export-model-list" v-if="type === 'all'">
         <el-checkbox-group v-model="selectedModals" @change="handleSelectModels">
-          <el-checkbox label="all" :disabled="allModelItems.status === 'BROKEN'" v-if="type === 'all'"><span>{{$t(allModelItems.name)}}</span></el-checkbox>
           <el-checkbox v-for="item in exportModal.list" :disabled="item.status === 'BROKEN'" :label="item.id" :key="item.id">
             <el-tooltip :content="$t('exportBrokenModelCheckboxTip')" effect="dark" placement="top" :disabled="item.status !== 'BROKEN'">
               <span>{{item.name}}</span>
@@ -121,6 +121,8 @@ export default class ModelsExportModal extends Vue {
   isLoadingModals = false
   showLoadingMore = false
   filterName = ''
+  isIndeterminate = false
+  checkAll = false
 
   selectedModals = []
   exportModal = {
@@ -151,9 +153,9 @@ export default class ModelsExportModal extends Vue {
 
   changeCheckboxType (type) {
     if (type === 'ops') {
-      return (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => this.selectedModals.includes(it.id) && !it.has_override_props).length
+      return this.models.filter(it => this.selectedModals.includes(it.id) && !it.has_override_props).length
     } else if (type === 'mult-partition') {
-      return (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => this.selectedModals.includes(it.id) && !it.has_multiple_partition_values).length
+      return this.models.filter(it => this.selectedModals.includes(it.id) && !it.has_multiple_partition_values).length
     }
   }
 
@@ -178,6 +180,11 @@ export default class ModelsExportModal extends Vue {
     }
   }
 
+  handleSelectAllModels (v) {
+    this.selectedModals = v ? this.models.filter(it => it.status !== 'BROKEN').map(item => item.id) : []
+    this.handleSelectModels(this.selectedModals)
+  }
+
   handleClose (isSubmit = false) {
     this.hideModal()
     this.resetState()
@@ -185,6 +192,8 @@ export default class ModelsExportModal extends Vue {
     this.exportModal.pageOffset = 1
     this.showLoadingMore = false
     this.selectedModals = []
+    this.isIndeterminate = false
+    this.checkAll = false
     this.filterName = ''
     this.callback && this.callback(isSubmit)
   }
@@ -203,13 +212,15 @@ export default class ModelsExportModal extends Vue {
   }
 
   handleSelectModels (data) {
-    const hasOverrideProps = (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => data.includes(it.id) && it.has_override_props)
-    const hasMultPartitions = (this.type === 'all' ? [...this.models, this.allModelItems] : this.models).filter(it => data.includes(it.id) && it.has_multiple_partition_values)
+    const hasOverrideProps = this.models.filter(it => data.includes(it.id) && it.has_override_props)
+    const hasMultPartitions = this.models.filter(it => data.includes(it.id) && it.has_multiple_partition_values)
     this.setModalForm({
       ids: data,
       exportOverProps: !hasOverrideProps.length && this.form.exportOverProps ? false : this.form.exportOverProps,
       exportMultiplePartitionValues: !hasMultPartitions.length && this.form.exportMultiplePartitionValues ? false : this.form.exportMultiplePartitionValues
     })
+    this.isIndeterminate = data.length > 0 && data.length < this.models.filter(it => it.status !== 'BROKEN').length
+    this.checkAll = data.length > 0 && data.length === this.models.filter(it => it.status !== 'BROKEN').length
   }
 
   handleCancel () {
@@ -249,9 +260,9 @@ export default class ModelsExportModal extends Vue {
     const { project, form } = this
     this.isSubmiting = true
     const formData = objectClone(form)
-    if (formData.ids.includes('all')) {
-      formData.ids = this.models.map(it => it.uuid)
-    }
+    // if (formData.ids.includes('all')) {
+    //   formData.ids = this.models.map(it => it.uuid)
+    // }
     try {
       // if (this.type !== 'all') {
       await this.downloadModelsMetadata({ project, form: formData })


[kylin] 14/17: KYLIN-5515 add search fields is_fuzzy

Posted by xx...@apache.org.
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 69fc2624f963b23fb94dc6892a2507a6d88fc7e1
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Apr 14 15:50:48 2023 +0800

    KYLIN-5515 add search fields is_fuzzy
---
 kystudio/src/components/common/DataSourceBar/index.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kystudio/src/components/common/DataSourceBar/index.vue b/kystudio/src/components/common/DataSourceBar/index.vue
index e78f4c68ec..5c5b7c482e 100644
--- a/kystudio/src/components/common/DataSourceBar/index.vue
+++ b/kystudio/src/components/common/DataSourceBar/index.vue
@@ -417,14 +417,14 @@ export default class DataSourceBar extends Vue {
     })
   }
   async loadTables (params) {
-    const { tableName = null, databaseId = null, isReset = false } = params || {}
+    const { tableName = null, databaseId = null, isReset = false, isFuzzy = false } = params || {}
     const currentDatabases = this.databaseArray.filter(database => {
       return database.id === databaseId || !databaseId
     })
     const responses = await Promise.all(currentDatabases.map((database) => {
       const { projectName, label: databaseName, pagination, datasource } = database
       isReset ? this.clearPagination(database) : null
-      return this.fetchTables({ projectName, databaseName, tableName, isExt: true, ...pagination, sourceType: datasource })
+      return this.fetchTables({ projectName, databaseName, tableName, isExt: true, isFuzzy: isFuzzy, ...pagination, sourceType: datasource })
     }))
     const results = await handleSuccessAsync(responses)
     currentDatabases.forEach((database, index) => {
@@ -510,7 +510,7 @@ export default class DataSourceBar extends Vue {
       let idx = this.filterText.indexOf('.')
       tableName = idx === -1 ? this.filterText : this.filterText.substring(idx + 1, this.filterText.length)
     }
-    await this.loadTables({ databaseId, tableName })
+    await this.loadTables({ databaseId, tableName, isFuzzy: true })
     this.freshAutoCompleteWords()
   }
   handleClick (data, node) {


[kylin] 11/17: KYLIN-5510 support modify the model description

Posted by xx...@apache.org.
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 dedbb2403143a81947a9af484c12964c6deca7ad
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 18:19:19 2023 +0800

    KYLIN-5510 support modify the model description
---
 .../studio/StudioModel/ModelList/ModelRenameModal/locales.js   |  3 ++-
 .../studio/StudioModel/ModelList/ModelRenameModal/rename.vue   | 10 ++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/locales.js
index 8f0372bd3f..e9c83d4a7b 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/locales.js
@@ -2,6 +2,7 @@ export default {
   'en': {
     modelRename: 'Model Rename',
     modelName: 'New Name',
-    updateSuccessful: 'Successfully updated the model name'
+    updateSuccessful: 'Successfully updated',
+    modelDescription: 'Description'
   }
 }
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/rename.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/rename.vue
index 0ddfcd9bf4..c837b82dc0 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/rename.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelRenameModal/rename.vue
@@ -5,6 +5,9 @@
         <el-form-item :label="$t('modelName')" prop="newName">
           <el-input v-focus="isShow" v-model="modelEdit.newName" auto-complete="off" size="medium"></el-input>
         </el-form-item>
+        <el-form-item :label="$t('modelDescription')" prop="description">
+          <el-input type="textarea" v-model.trim="modelEdit.description"></el-input>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer ky-no-br-space">
         <el-button @click="closeModal" size="medium">{{$t('kylinLang.common.cancel')}}</el-button>
@@ -51,7 +54,8 @@
   export default class ModelRenameModal extends Vue {
     btnLoading = false
     modelEdit = {
-      newName: ''
+      newName: '',
+      description: ''
     }
     rules = {
       newName: [
@@ -61,6 +65,7 @@
     @Watch('modelDesc')
     initModelName () {
       this.modelEdit.newName = this.modelDesc.alias
+      this.modelEdit.description = this.modelDesc.description
     }
     checkName (rule, value, callback) {
       if (!NamedRegex.test(value)) {
@@ -77,6 +82,7 @@
       setTimeout(() => {
         this.callback && this.callback({isSubmit, newName: name})
         this.modelEdit.newName = ''
+        this.modelEdit.description = ''
         this.resetModalForm()
       }, 200)
     }
@@ -84,7 +90,7 @@
       this.$refs.renameForm.validate((valid) => {
         if (!valid) { return }
         this.btnLoading = true
-        this.renameModel({model: this.modelDesc.uuid, new_model_name: this.modelEdit.newName, project: this.currentSelectedProject}).then(() => {
+        this.renameModel({model: this.modelDesc.uuid, new_model_name: this.modelEdit.newName, description: this.modelEdit.description, project: this.currentSelectedProject}).then(() => {
           this.btnLoading = false
           kylinMessage(this.$t('updateSuccessful'))
           this.closeModal(true, this.modelEdit.newName)


[kylin] 09/17: KYLIN-5508 show the query time of failed sql

Posted by xx...@apache.org.
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 eb07871c712211131fed85427e18709f4b59ad75
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 17:08:00 2023 +0800

    KYLIN-5508 show the query time of failed sql
---
 kystudio/src/components/query/query_history_table.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index b121aa337a..b20bd9f7bd 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -178,8 +178,8 @@
       </el-table-column>
       <el-table-column :renderHeader="renderColumn2" prop="duration" align="right" width="100">
         <template slot-scope="props">
-          <span v-if="props.row.duration < 1000 && props.row.query_status === 'SUCCEEDED'">&lt; 1s</span>
-          <span v-if="props.row.duration >= 1000 && props.row.query_status === 'SUCCEEDED'">{{props.row.duration / 1000 | fixed(2)}}s</span>
+          <span v-if="props.row.duration < 1000">&lt; 1s</span>
+          <span v-if="props.row.duration >= 1000">{{props.row.duration / 1000 | fixed(2)}}s</span>
           <!-- <span v-if="props.row.query_status === 'FAILED'">Failed</span> -->
         </template>
       </el-table-column>


[kylin] 07/17: KYLIN-5506 assign user group pagesize issue

Posted by xx...@apache.org.
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 e230e0a7827c68f3203d85ddcac00b2f9cbc6d89
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 16:11:20 2023 +0800

    KYLIN-5506 assign user group pagesize issue
---
 .../src/components/common/GroupEditModal/index.vue |   1 +
 .../src/components/common/UserEditModal/index.vue  | 116 +++++++++++++++++++--
 .../src/components/common/UserEditModal/store.js   |   4 +-
 kystudio/src/service/user.js                       |   2 +-
 4 files changed, 109 insertions(+), 14 deletions(-)

diff --git a/kystudio/src/components/common/GroupEditModal/index.vue b/kystudio/src/components/common/GroupEditModal/index.vue
index 564fa3d96a..040f26bc04 100644
--- a/kystudio/src/components/common/GroupEditModal/index.vue
+++ b/kystudio/src/components/common/GroupEditModal/index.vue
@@ -304,6 +304,7 @@ export default class GroupEditModal extends Vue {
     text-align: left;
     cursor: pointer;
     margin-left: 15px;
+    line-height: 30px;
     &:hover {
       color: @base-color;
     }
diff --git a/kystudio/src/components/common/UserEditModal/index.vue b/kystudio/src/components/common/UserEditModal/index.vue
index 631dc39b34..0b8ed07e54 100644
--- a/kystudio/src/components/common/UserEditModal/index.vue
+++ b/kystudio/src/components/common/UserEditModal/index.vue
@@ -127,12 +127,15 @@
       <el-form-item v-if="isFieldShow('group')">
         <el-transfer
           filterable
-          :data="totalGroups"
+          :data="totalGroupsData"
           :value="form.authorities"
+          :before-query="queryHandler"
           :filter-placeholder="$t('userGroupFilter')"
           :titles="[$t('willCheckGroup'), $t('checkedGroup')]"
+          :total-elements="totalSizes"
           :show-overflow-tip="true"
-          @change="value => inputHandler('authorities', value)">
+          @change="value => transferInputHandler('authorities', value)">
+            <div class="load-more-uers" slot="left-remote-load-more" v-if="isShowLoadMore" @click="loadMoreUserGroups(searchValueLeft)">{{$t('kylinLang.common.loadMore')}}</div>
           </el-transfer>
       </el-form-item>
     </el-form>
@@ -210,6 +213,19 @@ export default class UserEditModal extends Vue {
     char: '',
     letter: ''
   }
+  // 获取userGroup分页页码
+  page_offset = 0
+  // 每页请求数量
+  pageSize = 100
+  // 用户组总数
+  totalUserGroupsSize = 0
+  // 返回的数据总数
+  totalSizes = [0, 10]
+  searchValueLeft = ''
+  searchValueRight = ''
+  autoLoadLimit = 100
+  clickLoadMore = false
+  timer = null
 
   // Computed: Modal宽度
   get modalWidth () {
@@ -223,6 +239,13 @@ export default class UserEditModal extends Vue {
     return titleMaps[this.editType]
   }
 
+  get isShowLoadMore () {
+    return this.page_offset < Math.ceil(this.totalUserGroupsSize / this.pageSize) - 1
+  }
+  get totalGroupsData () {
+    return this.totalGroups.length ? this.totalGroups : []
+  }
+
   get rules () {
     return {
       // Data: el-form表单验证规则
@@ -254,7 +277,7 @@ export default class UserEditModal extends Vue {
   onModalShow (newVal, oldVal) {
     if (newVal) {
       this.isFormShow = true
-      this.editType === 'group' && this.fetchUserGroups()
+      this.editType === 'group' && this.fetchGroups('')
       document.addEventListener('keyup', this.handlerKeyEvent)
     } else {
       // 密码规则出错信息重置
@@ -332,6 +355,74 @@ export default class UserEditModal extends Vue {
       }
     }
   }
+  queryHandler (title, query) {
+    const that = this
+    return new Promise(async (resolve, reject) => {
+      if (title === that.$t('willCheckGroup')) {
+        this.page_offset = 0
+        clearTimeout(this.timer)
+        this.timer = setTimeout(async function () {
+          await that.setModal({totalGroups: []})
+          await that.fetchGroups(query)
+          resolve()
+        }, 500)
+      } else if (title === that.$t('checkedGroup')) {
+        try {
+          that.searchValueRight = query
+          that.$set(that.totalSizes, 1, that.searchResults(query).length)
+          resolve()
+        } catch (e) {
+          console.error(e)
+          reject(e)
+        }
+      }
+    })
+  }
+  // 匹配搜索结果的用户
+  searchResults (content) {
+    return this.form.authorities.filter(group => group.toLowerCase().indexOf(content.toString().toLowerCase()) >= 0)
+  }
+  transferInputHandler (key, value) {
+    this.setModalForm({[key]: value})
+    this.totalSizes[0] = this.totalUserGroupsSize - (!this.searchValueLeft.length ? value.length : this.searchResults(this.searchValueLeft).length)
+    const surplusUserGroups = this.totalGroups.filter(group => !value.includes(group.key))
+    surplusUserGroups.length < this.autoLoadLimit && (!this.searchValueLeft.length ? this.loadMoreUserGroups() : this.loadMoreUserGroups(this.searchValueLeft))
+  }
+  // Helper: 从后台获取用户
+  async fetchGroups (value) {
+    this.searchValueLeft = typeof value === 'undefined' ? '' : value
+    const { data: { data } } = await this.getGroupList({
+      page_size: this.pageSize,
+      page_offset: this.page_offset,
+      // project: this.currentSelectedProject, // 处理资源组时,发现这个接口不用传 project 参数
+      name: value
+    })
+    const remoteUserGroups = data.value
+      .map(group => ({ key: group, label: group }))
+    const selectedUserGroupsNotInRemote = this.form.authorities
+      .map(sItem => ({key: sItem, label: sItem}))
+      .filter(sItem => ![...(this.page_offset === 0 ? [] : this.totalGroups), ...remoteUserGroups].some(user => user.key === sItem.key))
+    const searchUserGroupIsSelected = (typeof value !== 'undefined' && value) ? this.form.authorities.filter(group => group.toLowerCase().indexOf(value.toString().toLowerCase()) >= 0) : [...this.totalGroups, ...remoteUserGroups].filter(group => this.form.authorities.includes(group.key))
+    this.totalUserGroupsSize = data.total_size
+    typeof value !== 'undefined' && value ? (this.totalSizes = [this.totalUserGroupsSize - searchUserGroupIsSelected.length]) : (this.totalSizes = [this.totalUserGroupsSize - this.form.authorities.length])
+    const userGroups = [...new Set([ ...(this.page_offset === 0 ? [] : this.totalGroups), ...remoteUserGroups, ...selectedUserGroupsNotInRemote ].map(it => it.key))].map(item => ({key: item, label: item}))
+    this.autoLoadMoreData(userGroups, value)
+    this.setModal({totalGroups: userGroups})
+  }
+  // 判断是否自动加载更多的数据
+  autoLoadMoreData (userGroups, value) {
+    this.clickLoadMore = false
+    const len = userGroups.filter(group => this.form.authorities.includes(group.key)).length
+    if (userGroups.length - len < this.autoLoadLimit && this.isShowLoadMore) {
+      typeof value !== 'undefined' && !value.length ? this.loadMoreUserGroups() : this.loadMoreUserGroups(value)
+      return
+    }
+  }
+  loadMoreUserGroups (value) {
+    if (this.clickLoadMore) return
+    this.clickLoadMore = true
+    this.isShowLoadMore && (this.page_offset += 1, this.fetchGroups(value))
+  }
 
   // Action: Form递交函数
   async submit () {
@@ -384,14 +475,6 @@ export default class UserEditModal extends Vue {
       return validate[type].bind(this)
     }
   }
-
-  // Helper: 从后台获取用户组
-  async fetchUserGroups () {
-    // const project = this.currentSelectedProject // 处理资源组时,发现这个接口不用传 project 参数
-    const { data: { data: totalGroups } } = await this.getGroupList()
-
-    this.setModal({ totalGroups: totalGroups.value })
-  }
 }
 </script>
 
@@ -415,6 +498,17 @@ export default class UserEditModal extends Vue {
       min-width: initial;
     }
   }
+  .load-more-uers {
+    color: @text-title-color;
+    font-size: @text-assist-size;
+    text-align: left;
+    cursor: pointer;
+    margin-left: 15px;
+    line-height: 30px;
+    &:hover {
+      color: @base-color;
+    }
+  }
   .change-system-password-tip {
     margin-bottom: 15px;
     font-size: 14px;
diff --git a/kystudio/src/components/common/UserEditModal/store.js b/kystudio/src/components/common/UserEditModal/store.js
index dd28c73423..10fe5b73ee 100644
--- a/kystudio/src/components/common/UserEditModal/store.js
+++ b/kystudio/src/components/common/UserEditModal/store.js
@@ -102,8 +102,8 @@ function setTotalGroups (payload, state) {
     .filter(groupName => groupName !== defaultGroup.key)
     .map(value => {
       return {
-        key: value,
-        label: value,
+        key: value.key,
+        label: value.label,
         disabled: false
       }
     })
diff --git a/kystudio/src/service/user.js b/kystudio/src/service/user.js
index 6bddbbbd26..6d59ae2bd1 100644
--- a/kystudio/src/service/user.js
+++ b/kystudio/src/service/user.js
@@ -47,7 +47,7 @@ export default {
     return Vue.resource(apiUrl + 'user_group/users_with_group').get(para)
   },
   getGroupList: (para) => {
-    return Vue.resource(apiUrl + 'user_group/groups').get()
+    return Vue.resource(apiUrl + 'user_group/groups').get(para)
   },
   addGroup: (para) => {
     return Vue.resource(apiUrl + 'user_group').save(para)