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/07/17 10:56:25 UTC
[kylin] branch kylin5 updated (997b27fc9e -> 6afbcaad56)
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 997b27fc9e KYLIN-5617 sumlc measure datatype issue
new e4449cae13 KYLIN-5618 Unify the copywriting of the ShardBy column on the Web GUI
new 654b255391 KYLIN-5619 Unify the English copywriting of the "Save and Build" button
new 4d2f5d9bb8 KYLIN-5620 Unified the English copywriting on the model setting page
new ca0e37a43d KYLIN-5621 fix segment list order issue
new 63fcd76885 KYLIN-5622 logic view issue
new 1bad3e06ea KYLIN-5623 refine reloadTables issue
new 334b8b2ca4 KYLIN-5624 agg index / table index text recognize
new 06884f6c93 KYLIN-5625 fix table index shard by issue
new d55edb81ed KYLIN-5626 refine query history format issue
new 75aacd9cc8 KYLIN-5627 refine logical view and ddl import table issue
new 9237cf2768 KYLIN-5628 logical params issue
new cb82430a18 KYLIN-5629 fix fullload multi_partition_desc issue
new acc84f2116 KYLIN-5630 refine history format css issue
new 6afbcaad56 KYLIN-5631 refine logical view locales issue
The 14 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:
.../src/components/common/DataSourceBar/handler.js | 30 ++++--
.../src/components/common/DataSourceBar/index.vue | 83 +++++++++++-----
.../src/components/common/DataSourceBar/locales.js | 14 ++-
.../common/ProjectEditModal/ProjectEditModal.vue | 6 +-
.../RecognizeAggregateModal.vue | 29 ++++--
.../common/RecognizeAggregateModal/handler.js | 13 ++-
kystudio/src/components/common/editor.vue | 51 +++++++---
.../components/layout/layout_left_right_top.vue | 2 +
.../src/components/query/query_history_table.vue | 4 +-
kystudio/src/components/query/query_tab.vue | 11 ++-
.../src/components/setting/SettingModel/locales.js | 18 ++--
kystudio/src/components/studio/DDL/ddl.vue | 8 +-
.../EditLogicalDialog/EditLogicalDialog.vue | 110 +++++++++++++++++++++
.../LogicalView/EditLogicalDialog/locales.js | 9 ++
.../LogicalView/EditLogicalDialog}/store.js | 9 +-
.../{DDL/ddl.vue => LogicalView/LogicalView.vue} | 87 +++++++++++++---
.../studio/StudioModel/ModelEdit/index.vue | 1 +
.../StudioModel/ModelList/AggregateModal/index.vue | 54 ++++++++--
.../ModelList/AggregateModal/locales.js | 2 +-
.../ModelList/ConfirmSegment/ConfirmSegment.vue | 2 +-
.../ModelList/ModelAggregate/indexDetails.vue | 4 +-
.../ModelAggregateView/AggAdvancedModal/index.vue | 2 +-
.../ModelList/ModelBuildModal/locales.js | 2 +-
.../ModelList/ModelSaveConfig/index.vue | 2 +-
.../ModelList/ModelSaveConfig/locales.js | 2 +-
.../studio/StudioModel/TableIndex/locales.js | 2 +-
.../studio/StudioModel/TableIndexEdit/locales.js | 1 +
.../StudioModel/TableIndexEdit/tableindex_edit.vue | 25 +++++
.../src/components/studio/StudioSource/index.vue | 6 +-
kystudio/src/config/index.js | 9 +-
kystudio/src/config/spec.js | 7 +-
kystudio/src/locale/en.js | 8 +-
kystudio/src/router/index.js | 4 +
kystudio/src/service/datasource.js | 3 +
kystudio/src/store/datasource.js | 3 +
kystudio/src/store/system.js | 12 ++-
kystudio/src/store/types.js | 1 +
37 files changed, 507 insertions(+), 129 deletions(-)
create mode 100644 kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
create mode 100644 kystudio/src/components/studio/LogicalView/EditLogicalDialog/locales.js
copy kystudio/src/components/{common/ModelERDiagramModal => studio/LogicalView/EditLogicalDialog}/store.js (79%)
copy kystudio/src/components/studio/{DDL/ddl.vue => LogicalView/LogicalView.vue} (73%)
[kylin] 11/14: KYLIN-5628 logical params 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 9237cf2768cd6c3903a95b76d3663d9223df6399
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:18:27 2023 +0800
KYLIN-5628 logical params issue
---
kystudio/src/store/system.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kystudio/src/store/system.js b/kystudio/src/store/system.js
index 2d713afbca..a890fd9afa 100644
--- a/kystudio/src/store/system.js
+++ b/kystudio/src/store/system.js
@@ -188,7 +188,7 @@ export default {
commit(types.GET_CONF_BY_NAME, {name: 'kylin.second-storage.query-metric-collect', key: 'storageQuery', defaultValue: 'true'})
commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.hive.enabled', key: 'ddlEnabled', defaultValue: 'false'})
commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view.enabled', key: 'logicalViewEnabled', defaultValue: 'false'})
- commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view-database', key: 'logicalViewDatabase', defaultValue: 'KYLIN_LOGICAL_VIEW'})
+ commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view.database', key: 'logicalViewDatabase', defaultValue: 'KYLIN_LOGICAL_VIEW'})
resolve(response)
}, () => {
reject()
[kylin] 02/14: KYLIN-5619 Unify the English copywriting of the "Save and Build" button
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 654b255391e15d6dfb38e3e841801a01d36f03e7
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 12 15:47:26 2023 +0800
KYLIN-5619 Unify the English copywriting of the "Save and Build" button
---
.../components/studio/StudioModel/ModelList/AggregateModal/locales.js | 2 +-
.../components/studio/StudioModel/ModelList/ModelBuildModal/locales.js | 2 +-
.../components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/locales.js
index af73fae4c2..21d1a8e38e 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/locales.js
@@ -64,7 +64,7 @@ export default {
mandatoryDesc: 'If a dimension is set to a mandatory dimension, only the index with this dimension will be calculated.',
hierarchyDesc: 'If there is a hierarchical relationship between the dimensions, you can set it as a hierarchy dimension.',
jointDesc: 'For dimensions which are often used together and the possible combination in between doesn\'t really matter, you may add them as joint dimension. If sampling for the source table has been done, the product of cardinalities of joint dimensions would be calculated as a reference.',
- saveAndBuild: 'Save and Build Index',
+ saveAndBuild: 'Save and Build',
colon: ': ',
edit: 'Edit',
column: 'Column',
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/locales.js
index fb51daa5a9..1796eb5f3c 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/locales.js
@@ -45,7 +45,7 @@ export default {
segmentTips: 'Segment is used to define model\'s data range (served for queries). The data range of segments in total equals the model\'s data range. Queries within the range could be answered by indexes or pushdown engine. Queries out of the range would have no results.',
addRangeTitle: 'Please select a segment\'s data range',
willAddSegmentTips: 'A segment for full build would be added and served for queries.',
- saveAndBuild: 'Save and Build Index',
+ saveAndBuild: 'Save and Build',
saveAndAddIndex: 'Save and Add Index',
onlySaveTip1: 'An empty segment (with no index) would be created after saving. Please note that queries would be answered by the pushdown engine when they hit empty segments. ',
onlySaveTip2: 'Do you want to continue?',
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
index d149c64e0b..2f99512b21 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
@@ -41,7 +41,7 @@ export default {
purgeSegmentDataTips: 'Model definition has changed. Once saving the model, all data in the segments will be deleted. As a result, this model CAN\'T be used to serve queries. We strongly recommend to reload all data (in total {storageSize}).\r\n Do you want to continue?',
onlyAddLeftJoinTip: 'The model definition relationship has changed and the current change only affects incremental data. To overwrite the stock data, go to the Segment page to clear the old data and rebuild.',
changeSegmentTips: 'With partition setting changed, all segments and data would be deleted. The model couldn\'t serve queries. Meanwhile, the related ongoing jobs for building index would be discarded.<br/>Do you want to continue?',
- saveAndLoad: 'Save and Build Index',
+ saveAndLoad: 'Save and Build',
partitionDateTable: 'Partition Table',
multilevelPartition: 'Subpartition Column',
multilevelPartitionDesc: 'A column from the selected table could be chosen. The models under this project could be partitioned by this column in addition to time partitioning. ',
[kylin] 14/14: KYLIN-5631 refine logical view locales 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 6afbcaad56cf8415a91032c81ade3423fa143fee
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:43:32 2023 +0800
KYLIN-5631 refine logical view locales issue
---
.../src/components/common/DataSourceBar/handler.js | 3 ++-
.../src/components/common/DataSourceBar/locales.js | 3 ++-
kystudio/src/components/studio/DDL/ddl.vue | 2 +-
.../components/studio/LogicalView/LogicalView.vue | 23 ++++------------------
4 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/kystudio/src/components/common/DataSourceBar/handler.js b/kystudio/src/components/common/DataSourceBar/handler.js
index a6a70aa5aa..347f72a493 100644
--- a/kystudio/src/components/common/DataSourceBar/handler.js
+++ b/kystudio/src/components/common/DataSourceBar/handler.js
@@ -27,6 +27,7 @@ export const render = {
table: {
render (h, { node, data, store }) {
const { label, tags, dateRange, isTopSet, datasource, isCurrentProLogicalTable } = data // datasource 为L 是逻辑视图表
+ const labelTitle = datasource === 'L' ? label + ' ' + this.$t('project') + data.__data.created_project : label
const dataRangeTitle = this.$t('dataRange')
const nodeClass = {
class: [
@@ -40,7 +41,7 @@ export const render = {
return (
<div>
<div {...nodeClass}>
- <span title={label} class={datasource === 'L' && !isCurrentProLogicalTable ? 'is-disabled' : ''}>{label}</span>
+ <span title={labelTitle} class={datasource === 'L' && !isCurrentProLogicalTable ? 'is-disabled' : ''}>{label}</span>
<div class="right">
{ datasource === 'L' ? (
<span class="tree-icon" slot="reference">
diff --git a/kystudio/src/components/common/DataSourceBar/locales.js b/kystudio/src/components/common/DataSourceBar/locales.js
index 331b042175..1c45ac3dcf 100644
--- a/kystudio/src/components/common/DataSourceBar/locales.js
+++ b/kystudio/src/components/common/DataSourceBar/locales.js
@@ -3,6 +3,7 @@ export default {
searchTable: 'Search Database/Table',
to: 'to',
dataRange: 'Data Range:',
+ project: 'Belongs to project: ',
source: 'Source: ',
addDatasource: 'Add data source',
emptyText: 'Click to load source tables.',
@@ -15,7 +16,7 @@ export default {
sourceManagement: 'Source Management',
loadTables: 'Load Table Metadata',
loadTablesSuccess: 'Synced successfully',
- loadTablesFail: 'Can\'t load {db_counts} database(s) or {table_counts} source table(s) metadata. Please contact your admin to check whether they exist in the datasource.',
+ loadTablesFail: 'Can\'t load {db_counts} database(s) or {table_counts} source table(s) metadata. Please contact your admin to check whether they exist in the datasource. If loading Logical View fails, please check if you loaded Logical Views out of the current project. ',
databases: 'Database',
tables: 'Table',
cloudHive: 'Object Storage',
diff --git a/kystudio/src/components/studio/DDL/ddl.vue b/kystudio/src/components/studio/DDL/ddl.vue
index 29f95b8575..a22f979522 100644
--- a/kystudio/src/components/studio/DDL/ddl.vue
+++ b/kystudio/src/components/studio/DDL/ddl.vue
@@ -94,7 +94,7 @@
newDDLTable: 'New DDL Table',
datasourceTable: 'Data Source Table',
syntaxRules: 'Syntax Rules',
- createDDLSuggestionTitle: 'To create a DDL Table in KE, you need to follow the syntax rules of KE.',
+ createDDLSuggestionTitle: 'To create a DDL Table in Kylin, you need to follow the syntax rules of Kylin.',
importDataSource: 'Import',
runBtnTip: 'Execute ',
acceleratorKey: '⌃/⌘ enter',
diff --git a/kystudio/src/components/studio/LogicalView/LogicalView.vue b/kystudio/src/components/studio/LogicalView/LogicalView.vue
index 80d1902492..649e1b90e6 100644
--- a/kystudio/src/components/studio/LogicalView/LogicalView.vue
+++ b/kystudio/src/components/studio/LogicalView/LogicalView.vue
@@ -86,7 +86,7 @@
<div class="label">{{$t('createDDLSuggestionTitle')}}</div>
<el-alert v-if="errorMsg" class="ksd-mb-16" :title="errorMsg" type="error" show-icon :closable="false"></el-alert>
<div v-if="stacktrace" class="trance-msg">{{stacktrace}}</div>
- <div class="item" v-for="(item, index) in ($lang === 'en' ? rules[0] : rules[1])" :key="index">{{index + 1}}. {{item}}</div>
+ <div class="item" v-for="(item, index) in ($lang === 'en' ? rules[0] : rules[1])" :key="index">{{index + 1}}. <span v-html="item.replace(/\n/g, '<br/>')"></span></div>
</div>
</div>
</template>
@@ -131,29 +131,14 @@
logicalViewTable: 'Logical View Table',
datasourceTable: 'Data Source Table',
syntaxRules: 'Syntax Rules',
- createDDLSuggestionTitle: 'To create a Logical View in KE, you need to follow the syntax rules of KE.',
+ createDDLSuggestionTitle: 'Logical View is a special view which only exists in Kylin,you can create or drop Logical View on this page. Create Logical View in Kylin needs to follow the following rules.',
importDataSource: 'Import',
runBtnTip: 'Execute ',
acceleratorKey: '⌃/⌘ enter',
runSuccess: 'Execute succeed.',
- runFailed: 'Execute Failed,Please check and try again.',
- createViewSuccessAlert: 'The Logical View is created in virtual database {databaseName} after executing "Create Logical View". Please import it from the data source to use it.',
+ runFailed: 'Execute Failed, Please check and try again.',
+ createViewSuccessAlert: 'After creating logical view, the view is created in virtual database {databaseName}, you need click the "refresh now" link in datasource and then can see the new Logical View. Then you should load it into data source.',
goToImport: 'Go to Import'
- },
- 'zh-cn': {
- newLogicalView: '新的逻辑视图',
- logicalView: '逻辑视图',
- logicalViewTable: '逻辑视图表',
- datasourceTable: '数据源表',
- syntaxRules: '语法规则',
- createDDLSuggestionTitle: '在 KE 中创建 Logical View 需要遵循 KE 的语法规则。',
- importDataSource: '导入',
- runBtnTip: '执行 ',
- acceleratorKey: '⌃/⌘ 回车',
- runSuccess: '执行成功',
- runFailed: '执行失败,请检查后重试',
- createViewSuccessAlert: '“Create Logical View” 执行后逻辑视图创建至虚拟库 {databaseName},需要从数据源导入后可用。',
- goToImport: '立即导入'
}
}
})
[kylin] 12/14: KYLIN-5629 fix fullload multi_partition_desc 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 cb82430a18ce04a095a0505afa95a0af2de022de
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:29:03 2023 +0800
KYLIN-5629 fix fullload multi_partition_desc issue
---
kystudio/src/components/studio/StudioModel/ModelEdit/index.vue | 1 +
.../components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
index a29a62e71e..7de4565f96 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
@@ -2287,6 +2287,7 @@ export default class ModelEdit extends Vue {
// 如果未选择partition 把partition desc 设置为null
if (!(data && data.partition_desc && data.partition_desc.partition_date_column)) {
para.partition_desc = null
+ para.multi_partition_desc = null
this.isFullLoad = true
}
this[this.saveModelType](para).then((res) => {
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index 80f2ae78ea..b2758359b8 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -754,7 +754,7 @@ export default class ModelPartitionModal extends Vue {
} else {
this.modelDesc.partition_desc.partition_date_column = ''
}
- if (this.partitionMeta.multiPartition) {
+ if (this.partitionMeta.multiPartition && this.buildType === 'incremental') {
this.modelDesc.multi_partition_desc = {
...this.modelInstance.multi_partition_desc || {},
columns: [this.partitionMeta.table + '.' + this.partitionMeta.multiPartition]
[kylin] 08/14: KYLIN-5625 fix table index shard by 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 06884f6c931b4e76fa417f656f1b43b7622d934a
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 15:52:20 2023 +0800
KYLIN-5625 fix table index shard by issue
---
.../studio/StudioModel/TableIndexEdit/tableindex_edit.vue | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
index 946ac5ee48..e035e29a77 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
+++ b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
@@ -432,11 +432,17 @@
this.allColumns.forEach(item => {
if (v && this.getDisabledTableType(item)) return
item.isUsed = v
+ if (!v) {
+ item.isShared = v
+ }
})
}
selectTableIndex (status, col) {
const selectedColumns = this.getSelectedColumns
const unSelected = this.allColumns.filter(it => !it.isUsed)
+ if (!status) { // 如果取消选择,isSorted重置成false
+ col.isShared = status
+ }
this.allColumns = [...selectedColumns, ...unSelected]
selectedColumns.length === this.allColumns.length && (this.isSelectAllTableIndex = true)
unSelected.length === this.allColumns.length && (this.isSelectAllTableIndex = false)
[kylin] 06/14: KYLIN-5623 refine reloadTables 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 1bad3e06ea4b57a10638b8ea2f802f1c6ecec6e9
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 11:16:06 2023 +0800
KYLIN-5623 refine reloadTables issue
---
kystudio/src/components/studio/StudioSource/index.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kystudio/src/components/studio/StudioSource/index.vue b/kystudio/src/components/studio/StudioSource/index.vue
index 7aa6d0fbf5..6e9751b687 100644
--- a/kystudio/src/components/studio/StudioSource/index.vue
+++ b/kystudio/src/components/studio/StudioSource/index.vue
@@ -365,12 +365,12 @@ export default class StudioSource extends Vue {
let isHaveFirstTable = true
// 3016 临时修复方案,sprint1 修复后,以修复后的代码为准
if (isSetToDefault) {
- await this.$refs['datasource-bar'].reloadTables(true) // true 表示不改变树开合情况
+ this.$refs['datasource-bar'] && await this.$refs['datasource-bar'].reloadTables(true) // true 表示不改变树开合情况
} else {
- await this.$refs['datasource-bar'].refreshTables()
+ this.$refs['datasource-bar'] && await this.$refs['datasource-bar'].refreshTables()
}
isSetToDefault
- ? isHaveFirstTable = this.$refs['datasource-bar'].selectFirstTable()
+ ? isHaveFirstTable = this.$refs['datasource-bar'] && this.$refs['datasource-bar'].selectFirstTable()
: await this.fetchTableDetail({ tableName, databaseName, sourceType: datasource })
if (!isHaveFirstTable) {
this.selectedTableData = null
[kylin] 04/14: KYLIN-5621 fix segment list order 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 ca0e37a43d68eb1bf988cef266b15c8392819292
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 12 16:17:33 2023 +0800
KYLIN-5621 fix segment list order issue
---
.../studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
index 8dd943ca4f..7578ae92f5 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
@@ -220,7 +220,7 @@ export default class ConfirmSegmentModal extends Vue {
}
}
handleSortChange ({ column, prop, order }) {
- if (order === 'ascending') {
+ if (order !== 'ascending') {
this.filter.reverse = false
} else {
this.filter.reverse = true
[kylin] 09/14: KYLIN-5626 refine query history format 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 d55edb81ed63172791b7255646bf14a921a6da48
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:08:46 2023 +0800
KYLIN-5626 refine query history format issue
---
.../src/components/common/DataSourceBar/index.vue | 2 +-
.../common/ProjectEditModal/ProjectEditModal.vue | 6 +--
kystudio/src/components/common/editor.vue | 43 ++++++++++++++++------
.../src/components/query/query_history_table.vue | 4 +-
kystudio/src/components/query/query_tab.vue | 11 +++++-
kystudio/src/locale/en.js | 5 ++-
6 files changed, 52 insertions(+), 19 deletions(-)
diff --git a/kystudio/src/components/common/DataSourceBar/index.vue b/kystudio/src/components/common/DataSourceBar/index.vue
index afafea0360..c7e7dc284c 100644
--- a/kystudio/src/components/common/DataSourceBar/index.vue
+++ b/kystudio/src/components/common/DataSourceBar/index.vue
@@ -31,7 +31,7 @@
</section>
<section class="body">
<div v-if="isShowLoadTable" class="btn-group">
- <el-button plain size="medium" v-if="!isLoadingTreeData && showAddDatasourceBtn && !isLogicalView" type="primary" v-guide.addDatasource icon="el-ksd-icon-add_data_source_old" @click="importDataSource('selectSource', currentProjectData)">
+ <el-button plain size="medium" v-if="!isLoadingTreeData && showAddDatasourceBtn && !isLogicalView" type="primary" icon="el-ksd-icon-add_data_source_old" @click="importDataSource('selectSource', currentProjectData)">
{{$t('addDatasource')}}
</el-button>
</div>
diff --git a/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue b/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
index b5ed0dbebf..cae11f1d99 100644
--- a/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
+++ b/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
@@ -35,7 +35,7 @@
<!-- 去除了智能模式的,直接显示下面这个div 即可 end -->
<!-- 表单:项目名 -->
<el-form-item :label="$t('projectName')" prop="name" v-if="isFieldShow('name')" class="js_projectname">
- <el-input v-guide.addProjectInput
+ <el-input
:disabled="editType !== 'new'"
auto-complete="off"
:value="form.name"
@@ -45,7 +45,7 @@
</el-form-item>
<!-- 表单:项目描述 -->
<el-form-item :label="$t('description')" prop="description" v-if="isFieldShow('description')" class="js_project_desc">
- <el-input v-guide.addProjectDesc
+ <el-input
type="textarea"
auto-complete="off"
:value="form.description"
@@ -110,7 +110,7 @@
<div slot="footer" class="dialog-footer ky-no-br-space" v-if="isFormShow">
<el-button size="medium" @click="closeHandler(false)">{{$t('cancel')}}</el-button>
- <el-button type="primary" size="medium" :loading="saveLoading" @click="submit" v-guide.saveProjectBtn class="js_addproject_submit">{{$t('kylinLang.common.ok')}}</el-button>
+ <el-button type="primary" size="medium" :loading="saveLoading" @click="submit" class="js_addproject_submit">{{$t('kylinLang.common.ok')}}</el-button>
</div>
</el-dialog>
</template>
diff --git a/kystudio/src/components/common/editor.vue b/kystudio/src/components/common/editor.vue
index 024d4bbbea..75df637180 100644
--- a/kystudio/src/components/common/editor.vue
+++ b/kystudio/src/components/common/editor.vue
@@ -15,14 +15,20 @@
v-model="showCopyStatus">
<i class="el-icon-circle-check"></i> <span>{{$t('kylinLang.common.copySuccess')}}</span>
</el-popover>
- <i class="el-ksd-icon-dup_16 edit-copy-btn ksd-fs-16"
- @click.stop
- v-if="readOnly"
- :class="{'is-show': editorData, 'alwaysShow': alwaysShowCopyBtn}"
- v-clipboard:copy="fullFormatData || editorData"
- v-clipboard:success="onCopy"
- v-clipboard:error="onError">
- </i>
+ <el-tooltip placement="top" :disabled="isFormat==='origin'" :content="$t('kylinLang.common.formatTips')">
+ <i class="el-ksd-icon-dup_16 edit-copy-btn ksd-fs-16"
+ @click.stop
+ v-if="readOnly"
+ :class="{'is-show': editorData, 'alwaysShow': alwaysShowCopyBtn}"
+ v-clipboard:copy="fullFormatData || editorData"
+ v-clipboard:success="onCopy"
+ v-clipboard:error="onError">
+ </i>
+ </el-tooltip>
+ <el-tabs v-model="isFormat" v-if="isFormatSwitch" class="format-switch" type="button" :class="{'en-model': $lang==='en'}" @tab-click="changeFormatType">
+ <el-tab-pane :label="$t('kylinLang.common.origin')" name="origin"></el-tab-pane>
+ <el-tab-pane :label="$t('kylinLang.common.format')" name="format"></el-tab-pane>
+ </el-tabs>
</div>
</template>
<script>
@@ -55,6 +61,9 @@ import { Component } from 'vue-property-decorator'
isFormatter: {
default: false
},
+ isFormatSwitch: {
+ default: false
+ },
readOnly: {
default: false
},
@@ -139,10 +148,10 @@ import { Component } from 'vue-property-decorator'
this.$message(this.$t('kylinLang.common.copyfail'))
},
// 截取前100行sql
- abridgeData () {
+ abridgeData (format) {
const splitData = this.editorData.split('\n')
// 需要截断的默认都是已经格式化后的,如果传入需要格式化,就再手动格式化,且格式化方式是通过字符串长度判断
- if (!isIE() && this.needFormater && (splitData.length === 1 || (splitData.length === 2 && /^LIMIT (\d+)/.test(splitData[1])))) {
+ if (!isIE() && (this.needFormater || format) && (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
@@ -156,6 +165,9 @@ import { Component } from 'vue-property-decorator'
this.fullFormatData = this.editorData
}
},
+ changeFormatType (type) {
+ this.isAbridge && this.abridgeData(type.name === 'format')
+ },
handleFormatSql (sql) {
try {
const fsql = this._formatSql(sql, formatSQLConfig)
@@ -221,7 +233,8 @@ export default class KapEditor extends Vue {
height: +this.height || 0,
width: this.width
},
- showLimitTip: false
+ showLimitTip: false,
+ isFormat: 'origin'
}
}
mounted () {
@@ -288,6 +301,14 @@ export default class KapEditor extends Vue {
box-sizing: border-box;
// background-color: @aceditor-bg-color;
border-radius: 6px;
+ .format-switch {
+ position: absolute;
+ bottom: 0px;
+ right: 10px;
+ .el-tabs__header {
+ margin: 0;
+ }
+ }
.ace_print-margin {
visibility: hidden !important;
}
diff --git a/kystudio/src/components/query/query_history_table.vue b/kystudio/src/components/query/query_history_table.vue
index 7e5408bf46..a7bcb4205b 100644
--- a/kystudio/src/components/query/query_history_table.vue
+++ b/kystudio/src/components/query/query_history_table.vue
@@ -59,7 +59,7 @@
:ref="'historySqlEditor' + props.row.query_id"
:key="props.row.query_id"
:readOnly="true"
- :needFormater="true"
+ :isFormatSwitch="true"
:dragable="false"
:isAbridge="true"
:value="props.row.sql_text">
@@ -176,7 +176,7 @@
{{transToGmtTime(props.row.query_time)}}
</template>
</el-table-column>
- <el-table-column :renderHeader="renderColumn2" prop="duration" align="right" width="100">
+ <el-table-column :renderHeader="renderColumn2" prop="duration" align="right" width="120">
<template slot-scope="props">
<span v-if="props.row.duration < 1000">< 1s</span>
<span v-if="props.row.duration >= 1000">{{props.row.duration / 1000 | fixed(2)}}s</span>
diff --git a/kystudio/src/components/query/query_tab.vue b/kystudio/src/components/query/query_tab.vue
index 09e9168d31..51130e548c 100644
--- a/kystudio/src/components/query/query_tab.vue
+++ b/kystudio/src/components/query/query_tab.vue
@@ -9,7 +9,10 @@
<div class="clearfix operatorBox">
<p class="tips_box">
<el-button type="primary" text size="small" @click.native="openSaveQueryDialog" :disabled="!sourceSchema">{{$t('kylinLang.common.save')}}</el-button><el-button
- size="small" type="primary" text @click.native="resetQuery" :disabled="!sourceSchema" v-if="isWorkspace" style="display:inline-block">{{$t('clear')}}</el-button>
+ size="small" type="primary" text @click.native="resetQuery" :disabled="!sourceSchema" v-if="isWorkspace" style="display:inline-block">{{$t('clear')}}</el-button><el-tooltip
+ placement="top" :disabled="!sourceSchema" :content="$t('formatTips')">
+ <el-button size="small" type="primary" text @click.native="format" :disabled="!sourceSchema" v-if="isWorkspace" style="display:inline-block">{{$t('format')}}</el-button>
+ </el-tooltip>
</p>
<p class="operator" v-if="isWorkspace">
<el-form :model="queryForm" :inline="true" ref="queryForm" @submit.native.prevent class="demo-form-inline">
@@ -93,6 +96,8 @@ import { kylinConfirm, handleSuccess, handleError } from '../../util/business'
resetTips: 'Are you sure you want to clear the SQL Editor?',
queryTips: 'You can enter a SQL query in the SQL editor, and the results will be displayed here after the query runs',
clear: 'Clear',
+ format: 'Reformat',
+ formatTips: 'Reformatting for easy reading',
runQuery: 'Run Query',
stopQuery: 'Stop Query',
overIntegerLength: 'Please enter a value no larger than 2,147,483,647.',
@@ -203,6 +208,10 @@ export default class QueryTab extends Vue {
editor.$emit('setValue', '')
})
}
+ format () {
+ const editor = this.$refs.insightBox
+ this.sourceSchema = editor.handleFormatSql(this.sourceSchema)
+ }
async submitQuery (querySql) {
try {
const valid = await this.$refs.queryForm.validate()
diff --git a/kystudio/src/locale/en.js b/kystudio/src/locale/en.js
index 687c4f382b..6dfce7ea6c 100644
--- a/kystudio/src/locale/en.js
+++ b/kystudio/src/locale/en.js
@@ -226,7 +226,10 @@ exports.default = {
jobNode: 'Job node',
BATCH: 'Batch',
STREAMING: 'Streaming',
- HYBRID: 'Fusion'
+ HYBRID: 'Fusion',
+ format: 'Reformat',
+ origin: 'Default Format',
+ formatTips: 'It is recommended to copying the SQL using the default format. The current format may cause query errors.'
},
model: {
draft: 'Draft',
[kylin] 03/14: KYLIN-5620 Unified the English copywriting on the model setting page
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 4d2f5d9bb8d3b2b5b98fd0176703cf6949aa1b3d
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 12 15:53:31 2023 +0800
KYLIN-5620 Unified the English copywriting on the model setting page
---
.../src/components/setting/SettingModel/locales.js | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/kystudio/src/components/setting/SettingModel/locales.js b/kystudio/src/components/setting/SettingModel/locales.js
index 59f49b4008..a0c7c22c1e 100644
--- a/kystudio/src/components/setting/SettingModel/locales.js
+++ b/kystudio/src/components/setting/SettingModel/locales.js
@@ -1,15 +1,15 @@
export default {
'en': {
modifyTime: 'Last Updated Time',
- modelSetting: 'Model Settings',
+ modelSetting: 'Parameter Configuration',
modifiedUser: 'Last Updated By',
segmentMerge: 'Segment Merge:',
volatileRange: 'Volatile Range:',
retention: 'Retention Threshold:',
- newSetting: 'Add Model Setting',
- editSetting: 'Edit Model Setting',
+ newSetting: 'Add Parameter Configuration',
+ editSetting: 'Edit Parameter Configuration',
modelName: 'Model Name',
- settingItem: 'Setting Item',
+ settingItem: 'Parameter Configuration',
autoMerge: 'Auto Merge',
volatileRangeItem: 'Volatile Range',
retentionThreshold: 'Retention Threshold',
@@ -25,10 +25,10 @@ export default {
month: 'Month',
quarter: 'Quarter',
year: 'Year',
- addSettingItem: 'Add Setting Item',
- isDel_auto_merge_time_ranges: 'Are you sure delete auto-merge setting item?',
- isDel_volatile_range: 'Are you sure delete volatile range setting item?',
- isDel_retention_range: 'Are you sure you want to delete the "Retention Threshold" setting?',
+ addSettingItem: 'Add Parameter Configuration',
+ isDel_auto_merge_time_ranges: 'Are you sure delete auto-merge Parameter Configuration?',
+ isDel_volatile_range: 'Are you sure delete volatile range Parameter Configuration?',
+ isDel_retention_range: 'Are you sure you want to delete the "Retention Threshold" configuration?',
'isDel_kylin.engine.spark-conf.spark.executor.cores': 'Are you sure delete spark.executor.cores item?',
'isDel_kylin.engine.spark-conf.spark.executor.instances': 'Are you sure delete spark.executor.instances item?',
'isDel_kylin.engine.spark-conf.spark.executor.memory': 'Are you sure delete spark.executor.memory item?',
@@ -37,7 +37,7 @@ export default {
autoMergeTip: 'The system could auto-merge segment fragments over different merging threshold. Auto-merge will optimize storage to enhance query performance.',
volatileTip: '"Auto-Merge" will not merge the latest segments defined in "Volatile Range". The default value is 0.',
retentionThresholdDesc: 'The segments within the retention threshold would be kept. The rest would be removed automatically.',
- pleaseSetAutoMerge: 'Please add \'Auto Merge\' setting first.',
+ pleaseSetAutoMerge: 'Please add \'Auto Merge\' configuration first.',
'Auto-merge': 'Auto Merge',
'Volatile Range': 'Volatile Range',
'Retention Threshold': 'Retention Threshold',
[kylin] 10/14: KYLIN-5627 refine logical view and ddl import table 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 75aacd9cc8b9c8370008534054322479d80d3fcc
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:15:00 2023 +0800
KYLIN-5627 refine logical view and ddl import table issue
---
kystudio/src/components/studio/DDL/ddl.vue | 3 ++-
kystudio/src/components/studio/LogicalView/LogicalView.vue | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kystudio/src/components/studio/DDL/ddl.vue b/kystudio/src/components/studio/DDL/ddl.vue
index c83751e25f..29f95b8575 100644
--- a/kystudio/src/components/studio/DDL/ddl.vue
+++ b/kystudio/src/components/studio/DDL/ddl.vue
@@ -153,7 +153,8 @@
})
const resultData = await handleSuccessAsync(res)
this.running = false
- this.showCreateSuccessAlert = this.content.toLocaleLowerCase().indexOf('create view') > -1
+ const ddlRule = /create\s+view/i
+ this.showCreateSuccessAlert = ddlRule.test(this.content)
resultData && this.insertEditorContent(`\n\n${resultData}`)
this.resetErrorMsg()
this.$message({ type: 'success', message: this.$t('runSuccess') })
diff --git a/kystudio/src/components/studio/LogicalView/LogicalView.vue b/kystudio/src/components/studio/LogicalView/LogicalView.vue
index ab3ce8404e..80d1902492 100644
--- a/kystudio/src/components/studio/LogicalView/LogicalView.vue
+++ b/kystudio/src/components/studio/LogicalView/LogicalView.vue
@@ -224,7 +224,8 @@
})
const resultData = await handleSuccessAsync(res)
this.running = false
- this.showCreateSuccessAlert = this.content.toLocaleLowerCase().indexOf('create logical view') > -1
+ const logicalRule = /create\s+logical\s+view/i
+ this.showCreateSuccessAlert = logicalRule.test(this.content)
resultData && this.insertEditorContent(`\n\n${resultData}`)
this.resetErrorMsg()
this.$message({ type: 'success', message: this.$t('runSuccess') })
[kylin] 05/14: KYLIN-5622 logic view 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 63fcd76885c4e333c433a911dbad1899d527ea9c
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 12 17:57:59 2023 +0800
KYLIN-5622 logic view issue
---
.../src/components/common/DataSourceBar/handler.js | 29 ++++--
.../src/components/common/DataSourceBar/index.vue | 83 +++++++++++-----
.../src/components/common/DataSourceBar/locales.js | 11 ++-
.../components/layout/layout_left_right_top.vue | 2 +
kystudio/src/components/studio/DDL/ddl.vue | 3 +-
.../EditLogicalDialog/EditLogicalDialog.vue | 110 +++++++++++++++++++++
.../LogicalView/EditLogicalDialog/locales.js | 9 ++
.../studio/LogicalView/EditLogicalDialog/store.js | 41 ++++++++
.../{DDL/ddl.vue => LogicalView/LogicalView.vue} | 101 ++++++++++++++++---
kystudio/src/config/index.js | 9 +-
kystudio/src/config/spec.js | 7 +-
kystudio/src/locale/en.js | 1 +
kystudio/src/router/index.js | 4 +
kystudio/src/service/datasource.js | 3 +
kystudio/src/store/datasource.js | 3 +
kystudio/src/store/system.js | 12 ++-
kystudio/src/store/types.js | 1 +
17 files changed, 369 insertions(+), 60 deletions(-)
diff --git a/kystudio/src/components/common/DataSourceBar/handler.js b/kystudio/src/components/common/DataSourceBar/handler.js
index 06aa9acef5..a6a70aa5aa 100644
--- a/kystudio/src/components/common/DataSourceBar/handler.js
+++ b/kystudio/src/components/common/DataSourceBar/handler.js
@@ -26,7 +26,7 @@ export const render = {
},
table: {
render (h, { node, data, store }) {
- const { label, tags, dateRange, isTopSet } = data
+ const { label, tags, dateRange, isTopSet, datasource, isCurrentProLogicalTable } = data // datasource 为L 是逻辑视图表
const dataRangeTitle = this.$t('dataRange')
const nodeClass = {
class: [
@@ -40,14 +40,22 @@ export const render = {
return (
<div>
<div {...nodeClass}>
- <span title={label}>{label}</span>
+ <span title={label} class={datasource === 'L' && !isCurrentProLogicalTable ? 'is-disabled' : ''}>{label}</span>
<div class="right">
- <span class="tree-icon" slot="reference">
- <el-tooltip effect="dark" enterable={false} content={isTopSet ? this.$t('cancelTopSet') : this.$t('topSet')} placement="top">
- <i class="table-date-tip top" onClick={event => this.handleToggleTop(data, node, event)}
- { ...{class: data.isTopSet ? ['el-icon-ksd-arrow_up_clean'] : ['el-icon-ksd-arrow_up']} }></i>
- </el-tooltip>
- </span>
+ { datasource === 'L' ? (
+ <span class="tree-icon" slot="reference">
+ <el-tooltip effect="dark" enterable={false} content={isCurrentProLogicalTable ? this.$t('editLogicalSql') : this.$t('disabledEditLogicalSql') } placement="top">
+ <i class="table-date-tip top" onClick={event => this.edit(data, node, event)}
+ { ...{class: isCurrentProLogicalTable ? ['el-ksd-n-icon-edit-outlined'] : ['el-ksd-n-icon-edit-outlined', 'is-disabled']} }></i>
+ </el-tooltip>
+ </span>
+ ) : (
+ <span class="tree-icon" slot="reference">
+ <el-tooltip effect="dark" enterable={false} content={isTopSet ? this.$t('cancelTopSet') : this.$t('topSet')} placement="top">
+ <i class="table-date-tip top" onClick={event => this.handleToggleTop(data, node, event)}
+ { ...{class: data.isTopSet ? ['el-icon-ksd-arrow_up_clean'] : ['el-icon-ksd-arrow_up']} }></i>
+ </el-tooltip>
+ </span>) }
{ dateRange ? (
<el-popover
placement="right"
@@ -123,7 +131,7 @@ export function getDatasourceObj (that, sourceType) {
const sourceName = sourceTypes[sourceType]
let sourceNameStr = 'kylin.source.jdbc.source.enable' in override_kylin_properties && override_kylin_properties['kylin.source.jdbc.source.enable'] === 'true' && override_kylin_properties['kylin.source.default'] === '8'
? override_kylin_properties['kylin.source.jdbc.source.name'] || sourceNameMapping[sourceName]
- : sourceNameMapping[sourceName]
+ : that.$t(sourceNameMapping[sourceName])
return {
id: sourceType,
label: customTreeTitle !== '' ? `${that.$t(customTreeTitle)}` : `${that.$t('source')}${sourceNameStr}`,
@@ -191,7 +199,7 @@ export function getTableObj (that, database, table, ignoreColumn) {
const dateRangeStr = _getDateRangeStr(that, dataRange)
const tableObj = {
id: table.uuid,
- label: table.name,
+ label: table.name || table.table_name,
children: [],
render: render.table.render.bind(that),
tags,
@@ -200,6 +208,7 @@ export function getTableObj (that, database, table, ignoreColumn) {
datasource,
isCentral: table.increment_loading,
isTopSet: table.top,
+ isCurrentProLogicalTable: table.created_project === that.currentProjectData.name, // 逻辑视图表是否是当前项目的
isHideFactIcon: that.hideFactIcon,
dateRange: dateRangeStr,
isSelected: false,
diff --git a/kystudio/src/components/common/DataSourceBar/index.vue b/kystudio/src/components/common/DataSourceBar/index.vue
index bd5b8c11d5..afafea0360 100644
--- a/kystudio/src/components/common/DataSourceBar/index.vue
+++ b/kystudio/src/components/common/DataSourceBar/index.vue
@@ -31,7 +31,7 @@
</section>
<section class="body">
<div v-if="isShowLoadTable" class="btn-group">
- <el-button plain size="medium" v-if="!isLoadingTreeData && showAddDatasourceBtn" type="primary" icon="el-ksd-icon-add_data_source_old" @click="importDataSource('selectSource', currentProjectData)">
+ <el-button plain size="medium" v-if="!isLoadingTreeData && showAddDatasourceBtn && !isLogicalView" type="primary" v-guide.addDatasource icon="el-ksd-icon-add_data_source_old" @click="importDataSource('selectSource', currentProjectData)">
{{$t('addDatasource')}}
</el-button>
</div>
@@ -188,6 +188,10 @@ import { handleSuccessAsync, handleError, objectClone } from '../../../util'
showDDL: {
type: Boolean,
default: false
+ },
+ isLogicalView: {
+ type: Boolean,
+ default: false
}
},
components: {
@@ -198,7 +202,8 @@ import { handleSuccessAsync, handleError, objectClone } from '../../../util'
'isAdminRole',
'isProjectAdmin',
'currentProjectData',
- 'datasourceActions'
+ 'datasourceActions',
+ 'logicalViewDatabaseName'
])
},
methods: {
@@ -212,7 +217,8 @@ import { handleSuccessAsync, handleError, objectClone } from '../../../util'
fetchDatabases: 'FETCH_DATABASES',
fetchTables: 'FETCH_TABLES',
updateTopTable: 'UPDATE_TOP_TABLE',
- fetchDBandTables: 'FETCH_DB_AND_TABLES'
+ fetchDBandTables: 'FETCH_DB_AND_TABLES',
+ fetchLogicalViewTables: 'FETCH_LOGICAL_VIEW_TABLES'
}),
...mapMutations({
cacheDatasource: 'CACHE_DATASOURCE'
@@ -359,27 +365,42 @@ export default class DataSourceBar extends Vue {
async initTree () {
try {
this.isSearchIng = false
- // await this.loadDatasources()
- // await this.loadDataBases()
- // await this.loadTables({ isReset: true })
- // 有加载数据源的情况,才去加载db 和 table,否则就处理loading字段
- // if (this.datasources.length > 0) {
- // await this.loadTreeData()
- // this.freshAutoCompleteWords()
- // } else {
- // this.isLoadingTreeData = false
- // }
- // freshTreeOrder(this)
- // this.selectFirstTable()
- // this.isLoadingTreeData = false
- await this.loadTreeData()
+ if (this.isLogicalView) {
+ await this.loadLogicalViewData()
+ } else {
+ await this.loadTreeData()
+ }
} catch (e) {
handleError(e)
}
}
- // async loadDatasources () {
- // this.datasources = this.currentSourceTypes.map(sourceType => getDatasourceObj(this, sourceType))
- // }
+ async loadLogicalViewData (filter) {
+ if (this.$store.state.system.logicalViewEnabled === 'true') {
+ try {
+ this.datasources = []
+ const res = await this.fetchLogicalViewTables({ project: this.currentProjectData.name, table: filter })
+ const logicalData = await handleSuccessAsync(res)
+ if (logicalData.length) {
+ const datasource = getDatasourceObj(this, 'L')
+ const resultDatabse = {
+ dbname: this.logicalViewDatabaseName,
+ size: logicalData.length,
+ tables: logicalData
+ }
+ datasource.children.push(getDatabaseTablesObj(this, datasource, resultDatabse))
+ datasource.children.forEach((database, index) => {
+ database.children = database.originTables.map(resultTable => getTableObj(this, database, resultTable, this.ignoreNodeTypes.indexOf('column') >= 0))
+ this.addPagination(database)
+ })
+ this.datasources.push(datasource)
+ this.defaultExpandedKeys.push(datasource.id)
+ }
+ } catch (e) {
+ handleError(e)
+ }
+ }
+ }
+
async loadTreeData (filterText) { // 根据数据源获取dbs 和tables
this.isLoadingTreeData = true
this.treeKey = 'pageTree_' + filterText + Number(new Date())
@@ -493,6 +514,10 @@ export default class DataSourceBar extends Vue {
}
async handleFilter (filterText, isNotResetDefaultExpandedKeys) {
this.isSearchIng = true
+ if (this.isLogicalView) {
+ await this.loadLogicalViewData(filterText)
+ return
+ }
const scrollDom = this.$el.querySelector('.scroll-content')
const scrollBarY = this.$el.querySelector('.scrollbar-thumb.scrollbar-thumb-y')
scrollDom && (scrollDom.style.transform = null)
@@ -568,6 +593,9 @@ export default class DataSourceBar extends Vue {
})
this.defaultExpandedKeys = defaultExpandedKeysClone
}
+ edit (data, node, event) {
+ this.$emit('edit', data, node, event)
+ }
async handleToggleTop (data, node, event) {
event && event.stopPropagation()
event && event.preventDefault()
@@ -852,6 +880,9 @@ export default class DataSourceBar extends Vue {
font-size: 12px;
}
}
+ .is-disabled {
+ color: @text-disabled-color;
+ }
.datatype {
color: @text-placeholder-color !important;
}
@@ -909,19 +940,23 @@ export default class DataSourceBar extends Vue {
}
// .el-tree-node {
// .el-tree-node__content:hover > .tree-item {
- // color: #087AC8;
+ // color: @base-color-11;
// }
// }
.table-date-tip {
color: #8E9FA8;
&:hover {
- color: #087AC8;
+ color: @base-color-11;
+ }
+ &.is-disabled:hover {
+ color: @text-disabled-color;
+ cursor: not-allowed;
}
}
.table-action {
color: #000000;
&:hover {
- color: #087AC8;
+ color: @base-color-11;
}
}
.table-tag {
@@ -935,7 +970,7 @@ export default class DataSourceBar extends Vue {
.column-tag {
display: inline-block;
font-size: 16px;
- color: #087AC8;
+ color: @base-color-11;
margin-right: 2px;
font-style: normal;
}
diff --git a/kystudio/src/components/common/DataSourceBar/locales.js b/kystudio/src/components/common/DataSourceBar/locales.js
index 6429a88f26..331b042175 100644
--- a/kystudio/src/components/common/DataSourceBar/locales.js
+++ b/kystudio/src/components/common/DataSourceBar/locales.js
@@ -22,6 +22,15 @@ export default {
factTable: 'Fact Table',
importFromDatasource: 'Import from Data Source',
createByDDL: 'DDL Create',
- createDDLTip: 'Data Definition Language Create Table'
+ createDDLTip: 'Data Definition Language Create Table',
+ Hive: 'Hive',
+ RDBMS: 'RDBMS',
+ Kafka: 'Kafka',
+ RDBMS2: 'RDBMS',
+ CSV: 'CSV',
+ GBASE: 'GBASE',
+ logicalView: 'Logical View',
+ editLogicalSql: 'Edit/View',
+ disabledEditLogicalSql: 'Not current project Logical View Table'
}
}
diff --git a/kystudio/src/components/layout/layout_left_right_top.vue b/kystudio/src/components/layout/layout_left_right_top.vue
index d07f7bfa81..77c49829cb 100644
--- a/kystudio/src/components/layout/layout_left_right_top.vue
+++ b/kystudio/src/components/layout/layout_left_right_top.vue
@@ -336,6 +336,8 @@ export default class LayoutLeftRightTop extends Vue {
return this.availableMenus.includes(menuName.toLowerCase()) && this.$store.state.system.streamingEnabled === 'true'
case 'ddl':
return this.availableMenus.includes(menuName.toLowerCase()) && this.$store.state.system.ddlEnabled === 'true'
+ case 'logicalView':
+ return this.availableMenus.includes(menuName.toLowerCase()) && this.$store.state.system.logicalViewEnabled === 'true'
default:
return this.availableMenus.includes(menuName.toLowerCase())
}
diff --git a/kystudio/src/components/studio/DDL/ddl.vue b/kystudio/src/components/studio/DDL/ddl.vue
index 13a11c2381..c83751e25f 100644
--- a/kystudio/src/components/studio/DDL/ddl.vue
+++ b/kystudio/src/components/studio/DDL/ddl.vue
@@ -148,7 +148,8 @@
this.running = true
const res = await this.runDDL({
sql: this.content,
- project: this.currentSelectedProject
+ ddl_project: this.currentSelectedProject,
+ restrict: 'hive'
})
const resultData = await handleSuccessAsync(res)
this.running = false
diff --git a/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
new file mode 100644
index 0000000000..9b109b64e0
--- /dev/null
+++ b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
@@ -0,0 +1,110 @@
+<template>
+ <el-dialog class="edit-logical-modal"
+ width="800px"
+ :title="$t('editLogical')"
+ :visible="isShow"
+ top="10vh"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ @close="handleClose">
+ <el-alert type="tip" :closable="false" class="ksd-mb-4" show-icon>
+ <span slot="title">{{$t('replaceTips')}} <a class="import-link" v-if="sql.toLocaleLowerCase().indexOf('create') > -1" href="javascript:void(0);" @click="goToReplace">{{'create -> replace'}}</a></span>
+ <span class="ksd-fs-12">{{$t('dropTips')}}</span>
+ </el-alert>
+ <kap-editor
+ width="100%"
+ :height="400"
+ lang="sql"
+ ref="logicalSql"
+ theme="chrome"
+ :dragable="false"
+ :isAbridge="true"
+ :value="sql"
+ @input="handleChangeSql">
+ </kap-editor>
+ <div slot="footer" class="dialog-footer ky-no-br-space">
+ <el-button size="medium" @click="handleCancel">{{$t('kylinLang.common.cancel')}}</el-button>
+ <el-button type="primary" size="medium" @click="handleSubmit" :loading="running">{{$t('kylinLang.common.save')}}</el-button>
+ </div>
+ </el-dialog>
+ </template>
+
+ <script>
+ import Vue from 'vue'
+ import { Component } from 'vue-property-decorator'
+ import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
+ import { handleError } from 'util'
+ import vuex, { actionTypes } from 'store'
+ import locales from './locales'
+ import store from './store'
+ vuex.registerModule(['modals', 'EditLogicalDialog'], store)
+ @Component({
+ computed: {
+ ...mapGetters([
+ 'currentSelectedProject'
+ ]),
+ ...mapState('EditLogicalDialog', {
+ sql: state => state.sql,
+ isShow: state => state.isShow,
+ callback: state => state.callback
+ })
+ },
+ methods: {
+ ...mapMutations('EditLogicalDialog', {
+ setModal: actionTypes.SET_MODAL,
+ hideModal: actionTypes.HIDE_MODAL,
+ initModal: actionTypes.INIT_MODAL
+ }),
+ ...mapActions({
+ runDDL: 'RUN_DDL'
+ })
+ },
+ locales
+ })
+ export default class EditLogicalDialog extends Vue {
+ running = false
+ handleClose (isSubmit = false) {
+ this.hideModal()
+ this.callback && this.callback(isSubmit)
+ }
+ handleCancel () {
+ this.handleClose(false)
+ }
+ goToReplace () {
+ const replaceSql = this.sql.replace(/create/i, 'replace')
+ this.setModal({ sql: replaceSql })
+ }
+ handleChangeSql () {
+ const val = this.$refs.logicalSql.getValue()
+ this.setModal({ sql: val })
+ }
+ goToDataSource () {
+ this.$router.push('/studio/source')
+ }
+ async handleSubmit () {
+ try {
+ this.running = true
+ await this.runDDL({
+ sql: this.sql,
+ ddl_project: this.currentSelectedProject,
+ restrict: 'replaceLogicalView'
+ })
+ this.running = false
+ this.$message({
+ type: 'success',
+ message: (
+ <div>
+ <span>{this.$t('editSuccess') }</span>
+ <a href="javascript:void(0)" onClick={() => this.goToDataSource()}>{this.$t('goToDataSource')}</a>
+ </div>
+ )
+ })
+ this.handleClose(true)
+ } catch (e) {
+ handleError(e)
+ this.running = false
+ }
+ }
+ }
+ </script>
+
\ No newline at end of file
diff --git a/kystudio/src/components/studio/LogicalView/EditLogicalDialog/locales.js b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/locales.js
new file mode 100644
index 0000000000..97634b5107
--- /dev/null
+++ b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/locales.js
@@ -0,0 +1,9 @@
+export default {
+ 'en': {
+ editLogical: 'Edit Logical Table SQL',
+ replaceTips: 'Only supports `replace logical view` syntax. ',
+ dropTips: 'If you want to delete logcial view,please enter Create View Page and type \'drop view\' command.',
+ editSuccess: 'If you create,edit or delete columns in logical view,you need to reload table to make it take effect.',
+ goToDataSource: 'Go to Data Source reload'
+ }
+}
diff --git a/kystudio/src/components/studio/LogicalView/EditLogicalDialog/store.js b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/store.js
new file mode 100644
index 0000000000..29816d449d
--- /dev/null
+++ b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/store.js
@@ -0,0 +1,41 @@
+import * as actionTypes from '../../../../store/types'
+
+export function getInitialState () {
+ return {
+ isShow: false,
+ callback: null,
+ sql: ''
+ }
+}
+
+export default {
+ state: getInitialState(),
+ mutations: {
+ [actionTypes.SHOW_MODAL] (state) {
+ state.isShow = true
+ },
+ [actionTypes.HIDE_MODAL] (state) {
+ state.isShow = false
+ },
+ [actionTypes.SET_MODAL] (state, payload) {
+ for (const [key, value] of Object.entries(payload)) {
+ state[key] = value
+ }
+ },
+ [actionTypes.INIT_MODAL] (state) {
+ for (const [key, value] of Object.entries(getInitialState())) {
+ state[key] = value
+ }
+ }
+ },
+ actions: {
+ [actionTypes.CALL_MODAL] ({ commit }, payload) {
+ return new Promise(resolve => {
+ commit(actionTypes.INIT_MODAL)
+ commit(actionTypes.SET_MODAL, { ...payload, callback: resolve })
+ commit(actionTypes.SHOW_MODAL)
+ })
+ }
+ },
+ namespaced: true
+}
diff --git a/kystudio/src/components/studio/DDL/ddl.vue b/kystudio/src/components/studio/LogicalView/LogicalView.vue
similarity index 72%
copy from kystudio/src/components/studio/DDL/ddl.vue
copy to kystudio/src/components/studio/LogicalView/LogicalView.vue
index 13a11c2381..ab3ce8404e 100644
--- a/kystudio/src/components/studio/DDL/ddl.vue
+++ b/kystudio/src/components/studio/LogicalView/LogicalView.vue
@@ -1,10 +1,10 @@
<template>
- <div class="ddl-container">
+ <div class="logical-view-container">
<div class="left-layout">
<div class="header">
- <span class="title">{{$t('newDDLTable')}}</span>
+ <span class="title">{{$t('newLogicalView')}}</span>
</div>
- <el-alert type="warning" show-icon v-if="showCreateSuccessAlert"><span slot="title">{{$t('createViewSuccessAlert')}} <a class="import-link" href="javascript:void(0);" @click="importDataSource">{{$t('goToImport')}}</a></span></el-alert>
+ <el-alert type="warning" show-icon v-if="showCreateSuccessAlert"><span slot="title">{{$t('createViewSuccessAlert', {databaseName: logicalViewDatabaseName})}} <a class="import-link" href="javascript:void(0);" @click="importDataSource">{{$t('goToImport')}}</a></span></el-alert>
<div class="editor-content">
<editor class="ddl-editor" v-model="content" ref="ddlEditor" lang="sql" theme="chrome" @keydown.meta.enter.native="runSql" @keydown.ctrl.enter.native="runSql"></editor>
<div class="run-btn">
@@ -17,6 +17,11 @@
</div>
<div :class="['right-layout', {'expand': !!activeType}]">
<div class="action-btns">
+ <el-tooltip :content="$t('logicalView')" effect="dark" placement="left">
+ <el-badge is-dot class="sign-item" :hidden="true">
+ <el-button :class="{'is-active': activeType === 'logicalView'}" text type="primary" icon-button-mini icon="el-ksd-n-icon-symbol-l-filled" @click="activeType = 'logicalView'"></el-button>
+ </el-badge>
+ </el-tooltip>
<el-tooltip :content="$t('datasourceTable')" effect="dark" placement="left">
<el-badge is-dot class="sign-item" :hidden="true">
<el-button :class="{'is-active': activeType === 'database'}" text type="primary" icon-button-mini icon="icon el-ksd-n-icon-node-database-filled" @click="activeType = 'database'"></el-button>
@@ -30,11 +35,34 @@
</div>
<div class="panel-content-layout">
<div class="panel-header" v-if="activeType">
- <span class="title">{{activeType === 'database' ? $t('datasourceTable') : $t('syntaxRules')}}</span>
+ <span class="title">{{expandBlockTitle}}</span>
<i class="el-ksd-n-icon-close-L-outlined close-btn" @click="activeType = ''"></i>
</div>
+ <div class="datasource-layout" v-if="activeType === 'logicalView'">
+ <data-source-bar
+ key="logicalView"
+ ref="logicalViewDataSource"
+ class="data-source-layout"
+ :project-name="currentSelectedProject"
+ :is-show-action-group="false"
+ :is-show-load-source="false"
+ :is-show-load-table="datasourceActions.includes('loadSource') && $store.state.config.platform !== 'iframe'"
+ :is-expand-on-click-node="false"
+ :is-show-drag-width-bar="true"
+ :default-width="240"
+ :expand-node-types="['datasource', 'database']"
+ :ignore-node-types="['column']"
+ :is-logical-view="true"
+ :hide-bar-title="$store.state.config.platform === 'iframe'"
+ :custom-tree-title="$store.state.config.platform !== 'iframe' ? '' : 'kylinLang.common.dataDirectory'"
+ @autoComplete="handleAutoComplete"
+ @click="clickTable"
+ @edit="editLogicalSql">
+ </data-source-bar>
+ </div>
<div class="datasource-layout" v-show="activeType === 'database'">
<data-source-bar
+ key="database"
ref="ddlDataSource"
class="data-source-layout"
:project-name="currentSelectedProject"
@@ -64,6 +92,7 @@
</template>
</div>
</div>
+ <EditLogicalDialog />
</div>
</template>
<script>
@@ -72,36 +101,59 @@
import DataSourceBar from '../../common/DataSourceBar'
import { insightKeyword } from '../../../config'
import { handleSuccessAsync, handleError } from '../../../util'
+ import EditLogicalDialog from './EditLogicalDialog/EditLogicalDialog'
@Component({
computed: {
...mapGetters([
'currentSelectedProject',
'datasourceActions',
- 'currentProjectData'
+ 'currentProjectData',
+ 'logicalViewDatabaseName'
])
},
methods: {
...mapActions({
getDDLDescription: 'DDL_DESCRIPTION',
runDDL: 'RUN_DDL'
+ }),
+ ...mapActions('EditLogicalDialog', {
+ callEditLogicalDialog: 'CALL_MODAL'
})
},
components: {
- DataSourceBar
+ DataSourceBar,
+ EditLogicalDialog
},
locales: {
en: {
- newDDLTable: 'New DDL Table',
+ newLogicalView: 'New Logical View',
+ logicalView: 'Logical View',
+ logicalViewTable: 'Logical View Table',
datasourceTable: 'Data Source Table',
syntaxRules: 'Syntax Rules',
- createDDLSuggestionTitle: 'To create a DDL Table in KE, you need to follow the syntax rules of KE.',
+ createDDLSuggestionTitle: 'To create a Logical View in KE, you need to follow the syntax rules of KE.',
importDataSource: 'Import',
runBtnTip: 'Execute ',
acceleratorKey: '⌃/⌘ enter',
runSuccess: 'Execute succeed.',
- runFailed: 'Execute Failed, Please check and try again.',
- createViewSuccessAlert: 'The DDL Table is created to hive after executing "Create View". Please importing the table to data source to be available.',
+ runFailed: 'Execute Failed,Please check and try again.',
+ createViewSuccessAlert: 'The Logical View is created in virtual database {databaseName} after executing "Create Logical View". Please import it from the data source to use it.',
goToImport: 'Go to Import'
+ },
+ 'zh-cn': {
+ newLogicalView: '新的逻辑视图',
+ logicalView: '逻辑视图',
+ logicalViewTable: '逻辑视图表',
+ datasourceTable: '数据源表',
+ syntaxRules: '语法规则',
+ createDDLSuggestionTitle: '在 KE 中创建 Logical View 需要遵循 KE 的语法规则。',
+ importDataSource: '导入',
+ runBtnTip: '执行 ',
+ acceleratorKey: '⌃/⌘ 回车',
+ runSuccess: '执行成功',
+ runFailed: '执行失败,请检查后重试',
+ createViewSuccessAlert: '“Create Logical View” 执行后逻辑视图创建至虚拟库 {databaseName},需要从数据源导入后可用。',
+ goToImport: '立即导入'
}
}
})
@@ -114,8 +166,19 @@
stacktrace = ''
running = false
showCreateSuccessAlert = false
+ get expandBlockTitle () {
+ switch (this.activeType) {
+ case 'logicalView':
+ return this.$t('logicalViewTable')
+ case 'database':
+ return this.$t('datasourceTable')
+ default:
+ return this.$t('syntaxRules')
+ }
+ }
setOption (option) {
let editor = this.$refs.ddlEditor.editor
+ if (!editor) return
editor.setOptions(Object.assign({
wrap: 'free',
enableBasicAutocompletion: true,
@@ -133,6 +196,14 @@
}
})
}
+ async editLogicalSql (data, node, event) {
+ event.stopPropagation()
+ if (!data.isCurrentProLogicalTable) return
+ const isSubmit = await this.callEditLogicalDialog({ sql: data.__data.created_sql })
+ if (isSubmit) {
+ this.$refs.logicalViewDataSource.initTree()
+ }
+ }
importDataSource () {
this.$refs.ddlDataSource && this.$refs.ddlDataSource.importDataSource('selectSource', this.currentProjectData)
}
@@ -148,11 +219,12 @@
this.running = true
const res = await this.runDDL({
sql: this.content,
- project: this.currentSelectedProject
+ ddl_project: this.currentSelectedProject,
+ restrict: 'logic'
})
const resultData = await handleSuccessAsync(res)
this.running = false
- this.showCreateSuccessAlert = this.content.toLocaleLowerCase().indexOf('create view') > -1
+ this.showCreateSuccessAlert = this.content.toLocaleLowerCase().indexOf('create logical view') > -1
resultData && this.insertEditorContent(`\n\n${resultData}`)
this.resetErrorMsg()
this.$message({ type: 'success', message: this.$t('runSuccess') })
@@ -174,7 +246,7 @@
}
async getDDLRules () {
try {
- const result = await this.getDDLDescription({project: this.currentSelectedProject, page_type: 'hive'})
+ const result = await this.getDDLDescription({project: this.currentSelectedProject, page_type: 'logic'})
const rules = await handleSuccessAsync(result)
this.rules = rules
} catch (e) {
@@ -192,7 +264,7 @@
<style lang="less" scoped>
@import '../../../assets/styles/variables.less';
- .ddl-container {
+ .logical-view-container {
width: 100%;
height: 100%;
display: flex;
@@ -367,3 +439,4 @@
color: @text-disabled-color;
}
</style>
+
\ No newline at end of file
diff --git a/kystudio/src/config/index.js b/kystudio/src/config/index.js
index 160a285fa0..bd269fe1d2 100644
--- a/kystudio/src/config/index.js
+++ b/kystudio/src/config/index.js
@@ -58,7 +58,8 @@ export const menusData = [
{ name: 'source', path: '/studio/source' },
{ name: 'modelList', path: '/studio/model' },
{ name: 'snapshot', path: '/studio/snapshot' },
- { name: 'ddl', path: '/studio/ddl' }
+ { name: 'ddl', path: '/studio/ddl' },
+ { name: 'logicalView', path: '/studio/logicalview' }
]
},
{
@@ -709,7 +710,8 @@ export const sourceTypes = getFullMapping({
RDBMS: 16,
KAFKA: 1,
CSV: 13,
- GBASE: 8
+ GBASE: 8,
+ LOGIC: 'L'
})
export const sourceNameMapping = {
@@ -718,7 +720,8 @@ export const sourceNameMapping = {
KAFKA: 'Kafka',
RDBMS2: 'RDBMS',
CSV: 'CSV',
- GBASE: 'GBASE'
+ GBASE: 'GBASE',
+ LOGIC: 'logicalView'
}
export const pageSizeMapping = {
diff --git a/kystudio/src/config/spec.js b/kystudio/src/config/spec.js
index 236d4d168e..0bf9717b25 100644
--- a/kystudio/src/config/spec.js
+++ b/kystudio/src/config/spec.js
@@ -19,6 +19,7 @@ export default {
{ "id": "modelSubPartitionValues", "value": "modelsubpartitionvalues", "title": "Model SubPartition Values" },
{ "id": "snapshot", "value": "snapshot", "title": "Snapshot" },
{ "id": "ddl", "value": "ddl", "title": "DDL" },
+ { "id": "logicalView", "value": "logicalview", "title": "Logical View" },
{ "id": "monitor", "value": "monitor", "title": "Monitor" },
{ "id": "job", "value": "job", "title": "Job" },
{ "id": "streamingJob", "value": "streamingjob", "title": "streamingJob" },
@@ -152,10 +153,10 @@ export default {
"keyPattern": "groupRole-projectRole-menu",
"entries": [
{ "key": "systemAdmin-*-[project,user,group,groupDetail,projectAuthority,diagnostic]", "value": "admin,project,user,group,groupDetail,diagnostic,projectAuthority" },
- { "key": "systemAdmin-*-[dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,monitor,job,streamingJob]", "value": "dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,monitor,job,streamingJob,admin" },
+ { "key": "systemAdmin-*-[dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,logicalView,monitor,job,streamingJob]", "value": "dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,logicalView,monitor,job,streamingJob,admin" },
{ "key": "systemUser-admin-[project,user,group,groupDetail,projectAuthority]", "value": "project,admin,projectAuthority" },
- { "key": "systemUser-admin-[dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,monitor,job,streamingJob]", "value": "dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,monitor,job,streamingJob,admin" },
- { "key": "systemUser-management-*", "value": "dashboard,query,insight,queryHistory,studio,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,monitor,job,streamingJob" },
+ { "key": "systemUser-admin-[dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,logicalView,monitor,job,streamingJob]", "value": "dashboard,query,insight,queryHistory,studio,setting,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,logicalView,monitor,job,streamingJob,admin" },
+ { "key": "systemUser-management-*", "value": "dashboard,query,insight,queryHistory,studio,source,model,index,modelEdit,modelDetails,modelSubPartitionValues,snapshot,ddl,logicalView,monitor,job,streamingJob" },
{ "key": "systemUser-operation-*", "value": "dashboard,query,insight,queryHistory,studio,model,modelDetails,snapshot,ddl,index,monitor,job,streamingJob,modelSubPartitionValues" },
{ "key": "systemUser-read-*", "value": "dashboard,query,insight,queryHistory,studio,model,modelDetails,snapshot,ddl,index" },
{ "key": "systemUser-default-*", "value": "dashboard" }
diff --git a/kystudio/src/locale/en.js b/kystudio/src/locale/en.js
index 855036173d..687c4f382b 100644
--- a/kystudio/src/locale/en.js
+++ b/kystudio/src/locale/en.js
@@ -493,6 +493,7 @@ exports.default = {
modeledit: 'Model Edit',
snapshot: 'Snapshot',
ddl: 'DDL',
+ logicalView: 'Logical View',
refresh: 'Refresh',
systemcapacity: 'Capacity'
},
diff --git a/kystudio/src/router/index.js b/kystudio/src/router/index.js
index 29e93ab054..148c3756f8 100644
--- a/kystudio/src/router/index.js
+++ b/kystudio/src/router/index.js
@@ -89,6 +89,10 @@ let routerOptions = {
name: 'DDL',
path: 'studio/ddl',
component: () => import('../components/studio/DDL/ddl.vue')
+ }, {
+ name: 'LogicalView',
+ path: 'studio/logicalview',
+ component: () => import('../components/studio/LogicalView/LogicalView.vue')
}, {
name: 'Project',
path: 'admin/project',
diff --git a/kystudio/src/service/datasource.js b/kystudio/src/service/datasource.js
index 7e00128f44..b1112c18d9 100644
--- a/kystudio/src/service/datasource.js
+++ b/kystudio/src/service/datasource.js
@@ -321,5 +321,8 @@ export default {
},
runDDL (data) {
return Vue.resource(apiUrl + 'spark_source/ddl').save(data)
+ },
+ fetchLogicalViewTables (data) {
+ return Vue.resource(apiUrl + 'spark_source/ddl/view_list').get(data)
}
}
diff --git a/kystudio/src/store/datasource.js b/kystudio/src/store/datasource.js
index ac31bd3994..40b4014f56 100644
--- a/kystudio/src/store/datasource.js
+++ b/kystudio/src/store/datasource.js
@@ -402,6 +402,9 @@ export default {
// 执行 ddl 语句
[types.RUN_DDL]: function (_, data) {
return api.datasource.runDDL(data)
+ },
+ [types.FETCH_LOGICAL_VIEW_TABLES]: function ({ commit }, data) {
+ return api.datasource.fetchLogicalViewTables(data)
}
}
}
diff --git a/kystudio/src/store/system.js b/kystudio/src/store/system.js
index 7607926d28..2d713afbca 100644
--- a/kystudio/src/store/system.js
+++ b/kystudio/src/store/system.js
@@ -60,7 +60,9 @@ export default {
isNonAdminGenQueryDiagPackage: 'true',
streamingEnabled: 'false',
storageQuery: 'true',
- ddlEnabled: 'false'
+ ddlEnabled: 'false',
+ logicalViewEnabled: 'false',
+ logicalViewDatabase: 'KYLIN_LOGICAL_VIEW'
},
mutations: {
[types.COLLECT_MESSAGE_DIRECTIVES]: (state, directive) => {
@@ -184,7 +186,9 @@ export default {
commit(types.GET_CONF_BY_NAME, {name: 'kylin.model.measure-name-check-enabled', key: 'enableCheckName', defaultValue: 'true'})
commit(types.GET_CONF_BY_NAME, {name: 'kylin.streaming.enabled', key: 'streamingEnabled', defaultValue: 'false'})
commit(types.GET_CONF_BY_NAME, {name: 'kylin.second-storage.query-metric-collect', key: 'storageQuery', defaultValue: 'true'})
- commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.enabled', key: 'ddlEnabled', defaultValue: 'false'})
+ commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.hive.enabled', key: 'ddlEnabled', defaultValue: 'false'})
+ commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view.enabled', key: 'logicalViewEnabled', defaultValue: 'false'})
+ commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view-database', key: 'logicalViewDatabase', defaultValue: 'KYLIN_LOGICAL_VIEW'})
resolve(response)
}, () => {
reject()
@@ -239,8 +243,8 @@ export default {
isNonAdminGenQueryDiagPackage: (state) => {
return state.isNonAdminGenQueryDiagPackage === 'true'
},
- isStreamingEnabled: (state) => {
- return state.streamingEnabled === 'true'
+ logicalViewDatabaseName: (state) => {
+ return state.logicalViewDatabase
}
}
}
diff --git a/kystudio/src/store/types.js b/kystudio/src/store/types.js
index 7ec5311e22..f88d6607c7 100644
--- a/kystudio/src/store/types.js
+++ b/kystudio/src/store/types.js
@@ -182,6 +182,7 @@ export const EXPORT_CSV = 'EXPORT_CSV'
export const LOAD_DATASOURCE_OF_MODEL = 'LOAD_DATASOURCE_OF_MODEL'
+export const FETCH_LOGICAL_VIEW_TABLES = 'FETCH_LOGICAL_VIEW_TABLES'
export const DDL_DESCRIPTION = 'DDL_DESCRIPTION'
export const RUN_DDL = 'RUN_DDL'
// acl table
[kylin] 07/14: KYLIN-5624 agg index / table index text recognize
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 334b8b2ca4b588bbc820b1a3cefb19cd286a4bf5
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 15:15:13 2023 +0800
KYLIN-5624 agg index / table index text recognize
---
.../RecognizeAggregateModal.vue | 29 ++++++++----
.../common/RecognizeAggregateModal/handler.js | 13 +++++-
.../StudioModel/ModelList/AggregateModal/index.vue | 54 +++++++++++++++++++---
.../studio/StudioModel/TableIndexEdit/locales.js | 1 +
.../StudioModel/TableIndexEdit/tableindex_edit.vue | 19 ++++++++
5 files changed, 97 insertions(+), 19 deletions(-)
diff --git a/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue b/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
index 554e73a2cf..43b6dddd6b 100644
--- a/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
+++ b/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
@@ -90,6 +90,9 @@
import { collectErrorsInEditor, refreshEditor, scrollToLineAndHighlight, updatePlaceHolder, ERROR_TYPE } from './handler'
import { AGGREGATE_TYPE } from '../../../config'
vuex.registerModule(['modals', 'RecognizeAggregateModal'], store)
+
+ const TABLE_INDEX = 'TABLE_INDEX'
+
@Component({
components: {
AceEditor,
@@ -115,7 +118,8 @@
'hierarchies',
'hierarchyItems',
'joints',
- 'jointItems'
+ 'jointItems',
+ 'tableIndexCols'
])
},
methods: {
@@ -149,7 +153,11 @@
}
get errorCount () {
const { errorInEditor } = this
- return errorInEditor.filter(line => [ERROR_TYPE.COLUMN_NOT_IN_MODEL, ERROR_TYPE.COLUMN_NOT_IN_INCLUDES].includes(line.type)).length
+ return errorInEditor.filter(line => [
+ ERROR_TYPE.COLUMN_NOT_IN_MODEL,
+ ERROR_TYPE.COLUMN_NOT_IN_INCLUDES,
+ ERROR_TYPE.COLUMN_USED_IN_OTHER
+ ].includes(line.type)).length
}
get repeatCount () {
const { errorInEditor } = this
@@ -176,12 +184,13 @@
return selectedDimensionCount && !isSelectAll
}
isColumnUsedInCurrent (column) {
- const { type, includes, mandatories, hierarchyItems, jointItems } = this
+ const { type, includes, mandatories, hierarchyItems, jointItems, tableIndexCols } = this
switch (type) {
case AGGREGATE_TYPE.INCLUDE: return includes.includes(column)
case AGGREGATE_TYPE.MANDATORY: return mandatories.includes(column)
case AGGREGATE_TYPE.HIERARCHY: return hierarchyItems.includes(column)
case AGGREGATE_TYPE.JOINT: return jointItems.includes(column)
+ case TABLE_INDEX: return tableIndexCols.includes(column)
default: return false
}
}
@@ -223,6 +232,8 @@
return this.$t('columnNotInIncludes', { column })
case ERROR_TYPE.COLUMN_DUPLICATE:
return this.$t('columnDuplicate', { column })
+ case ERROR_TYPE.COLUMN_USED_IN_OTHER:
+ return this.$t('columnUsedInOther', { column })
default: return 'Unknow Error'
}
}
@@ -262,14 +273,12 @@
{this.$t('inputPlaceholder1')}
<el-tooltip
popperClass="recognize-aggregate-placeholder-tooltip"
- content={(
- <ul>
- <li>{this.$t('inputPlaceholderTooltip1')}</li>
- <li>{this.$t('inputPlaceholderTooltip2')}</li>
- </ul>
- )}
placement="top"
>
+ <ul slot="content">
+ <li>{this.$t('inputPlaceholderTooltip1')}</li>
+ <li>{this.$t('inputPlaceholderTooltip2')}</li>
+ </ul>
<span class="how-to-use">{this.$t('inputPlaceholderTooltipTrigger')}</span>
</el-tooltip>
</div>
@@ -323,7 +332,7 @@
if (columnText) {
const dimension = modelDimensions.find(d => d.column === columnText)
if (dimension) {
- if (type !== AGGREGATE_TYPE.INCLUDE && !this.isColumnInIncludes(dimension.column)) {
+ if (![AGGREGATE_TYPE.INCLUDE, TABLE_INDEX].includes(type) && !this.isColumnInIncludes(dimension.column)) {
this.setNotInIncludesError(dimension.column)
} else if (!this.isColumnUsedInOther(dimension.column)) {
const duplicate = dimensions.some(d => d.value === dimension.column)
diff --git a/kystudio/src/components/common/RecognizeAggregateModal/handler.js b/kystudio/src/components/common/RecognizeAggregateModal/handler.js
index f8cdc0d6e8..db4eb83cf2 100644
--- a/kystudio/src/components/common/RecognizeAggregateModal/handler.js
+++ b/kystudio/src/components/common/RecognizeAggregateModal/handler.js
@@ -8,7 +8,8 @@ const dom = acequire('ace/lib/dom')
export const ERROR_TYPE = {
COLUMN_NOT_IN_MODEL: 'columnNotInModel',
COLUMN_NOT_IN_INCLUDES: 'columnNotInIncludes',
- COLUMN_DUPLICATE: 'columnDuplicate'
+ COLUMN_DUPLICATE: 'columnDuplicate',
+ COLUMN_USED_IN_OTHER: 'columnUsedInOther'
}
export function $updatePlaceholder (editor, renderPlaceholder) {
@@ -83,7 +84,7 @@ export function searchColumnInEditor (editor, column) {
}
export function collectErrorsInEditor (errors, editor) {
- const { notInModel, duplicate, notInIncludes } = errors
+ const { notInModel, duplicate, notInIncludes, usedInOthers } = errors
let errorInEditor = []
let errorLines = []
@@ -112,6 +113,14 @@ export function collectErrorsInEditor (errors, editor) {
})]
}
+ for (const column of usedInOthers) {
+ const usedInOtherRanges = searchColumnInEditor(editor, column)
+ errorInEditor = [...errorInEditor, ...usedInOtherRanges.map(r => {
+ errorLines.push(r.start.row)
+ return { row: r.start.row, column, type: ERROR_TYPE.COLUMN_USED_IN_OTHER }
+ })]
+ }
+
errorLines = errorLines.sort()
return { errorInEditor, errorLines }
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/index.vue
index 7ad21f77b9..a53beaa4f0 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/AggregateModal/index.vue
@@ -191,6 +191,14 @@
<common-tip placement="right" :content="$t('hierarchyDesc')">
<i class="el-ksd-icon-more_info_16"></i>
</common-tip>
+ <span class="row ksd-fright ky-no-br-space">
+ <el-button
+ plain class="ksd-ml-10" size="mini"
+ @click="handleHierarchyRecognize(AGGREGATE_TYPE.HIERARCHY, aggregateIdx)"
+ >
+ {{$t('textRecognition')}}
+ </el-button>
+ </span>
</h2>
<div class="list"
v-for="(hierarchy, hierarchyRowIdx) in aggregate.hierarchyArray"
@@ -229,6 +237,14 @@
<common-tip placement="right" :content="$t('jointDesc')">
<i class="el-ksd-icon-more_info_16"></i>
</common-tip>
+ <span class="row ksd-fright ky-no-br-space">
+ <el-button
+ plain class="ksd-ml-10" size="mini"
+ @click="handleJointRecognize(AGGREGATE_TYPE.JOINT, aggregateIdx)"
+ >
+ {{$t('textRecognition')}}
+ </el-button>
+ </span>
</h2>
<div class="list"
v-for="(joint, jointRowIdx) in aggregate.jointArray"
@@ -1033,11 +1049,11 @@ export default class AggregateModal extends Vue {
this.aggregateStyle = []
})
}
- handleAddDimensionRow (path, id) {
+ handleAddDimensionRow (path, id, items = []) {
const rootKey = path.split('.')[0]
const dimensionRows = get(this.form, path)
const newId = dimensionRows.length
- const newDimensionRow = { id: newId, items: [] }
+ const newDimensionRow = { id: newId, items }
this.setModalForm({[rootKey]: push(this.form, path, newDimensionRow)[rootKey]})
this.isWaitingCheckCuboids[id] = true
this.isWaitingCheckAllCuboids = true
@@ -1126,22 +1142,46 @@ export default class AggregateModal extends Vue {
}
})
}
- async handleIncludesRecognize (type, aggregateIdx, groupIdx = 0) {
+ async handleIncludesRecognize (type, aggregateIdx) {
const { model, form } = this
const { aggregateArray = [] } = form
const aggregate = aggregateArray[aggregateIdx]
- const selectedColumns = await this.callRecognizeAggregateModal({ type, model, aggregate, groupIdx })
+ const selectedColumns = await this.callRecognizeAggregateModal({ type, model, aggregate })
const value = [...aggregate.includes, ...selectedColumns]
this.handleInput(`aggregateArray.${aggregateIdx}.includes`, value, aggregate.id)
}
- async handleMandatoryRecognize (type, aggregateIdx, groupIdx = 0) {
+ async handleMandatoryRecognize (type, aggregateIdx) {
const { model, form } = this
const { aggregateArray = [] } = form
const aggregate = aggregateArray[aggregateIdx]
- const selectedColumns = await this.callRecognizeAggregateModal({ type, model, aggregate, groupIdx })
+ const selectedColumns = await this.callRecognizeAggregateModal({ type, model, aggregate })
const value = [...aggregate.mandatory, ...selectedColumns]
this.handleInput(`aggregateArray.${aggregateIdx}.mandatory`, value, aggregate.id)
}
+ async handleHierarchyRecognize (type, aggregateIdx) {
+ const { model, form } = this
+ const { aggregateArray = [] } = form
+ const aggregate = aggregateArray[aggregateIdx]
+ const value = await this.callRecognizeAggregateModal({ type, model, aggregate })
+ const emptyArrayIdx = aggregate.hierarchyArray.findIndex(array => array.items.length === 0)
+ if (emptyArrayIdx !== -1) {
+ this.handleInput(`aggregateArray.${aggregateIdx}.hierarchyArray.${emptyArrayIdx}.items`, value, aggregate.id)
+ } else {
+ this.handleAddDimensionRow(`aggregateArray.${aggregateIdx}.hierarchyArray`, aggregate.id, value)
+ }
+ }
+ async handleJointRecognize (type, aggregateIdx) {
+ const { model, form } = this
+ const { aggregateArray = [] } = form
+ const aggregate = aggregateArray[aggregateIdx]
+ const value = await this.callRecognizeAggregateModal({ type, model, aggregate })
+ const emptyArrayIdx = aggregate.jointArray.findIndex(array => array.items.length === 0)
+ if (emptyArrayIdx !== -1) {
+ this.handleInput(`aggregateArray.${aggregateIdx}.jointArray.${emptyArrayIdx}.items`, value, aggregate.id)
+ } else {
+ this.handleAddDimensionRow(`aggregateArray.${aggregateIdx}.jointArray`, aggregate.id, value)
+ }
+ }
handleRemoveAllIncludes (aggregateIdx, titleId, id) {
kylinConfirm(this.$t('clearAllAggregateTip', {aggId: titleId}), {type: 'warning'}, this.$t('clearAggregateTitle')).then(() => {
const { aggregateArray = [] } = this.form
@@ -2210,7 +2250,7 @@ export default class AggregateModal extends Vue {
position: absolute;
right: 6px;
top: 0;
- transform: translateY(2px);
+ transform: translateY(12px);
.is-text {
font-size: 24px;
border: 0;
diff --git a/kystudio/src/components/studio/StudioModel/TableIndexEdit/locales.js b/kystudio/src/components/studio/StudioModel/TableIndexEdit/locales.js
index 031267a13a..45109240d4 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndexEdit/locales.js
+++ b/kystudio/src/components/studio/StudioModel/TableIndexEdit/locales.js
@@ -29,6 +29,7 @@ export default {
indexTimeRange: 'Index’s Time Range',
indexTimeRangeTips: 'The data range that the indexes will be built in. With "Batch and Streaming" selected, there will be generated batch indexes and streaming indexes with same content respectively. ',
noIndexRangeByHybrid: 'Select index’s data range to display available columns.',
+ textRecognition: 'Text Recognition',
refuseAddIndexTip: 'Can\'t add streaming indexes. Please stop the streaming job and then delete all the streaming segments.'
}
}
diff --git a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
index c34a90dcc0..946ac5ee48 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
+++ b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
@@ -29,6 +29,9 @@
</el-alert>
<template v-if="modelInstance.model_type !== 'HYBRID' || modelInstance.model_type === 'HYBRID' && tableIndexMeta.index_range">
<p class="anit-table-tips" v-if="hasManyToManyAndAntiTable">{{$t('manyToManyAntiTableTip')}}</p>
+ <el-button plain class="ksd-ml-10" size="mini" @click="handleTableIndexRecognize">
+ {{$t('textRecognition')}}
+ </el-button>
<el-input v-model="searchColumn" size="medium" prefix-icon="el-ksd-icon-search_22" style="width:200px" :placeholder="$t('filterByColumns')"></el-input>
</template>
</div>
@@ -118,6 +121,9 @@
hideModal: types.HIDE_MODAL,
setModalForm: types.SET_MODAL_FORM,
resetModalForm: types.RESET_MODAL_FORM
+ }),
+ ...mapActions('RecognizeAggregateModal', {
+ callRecognizeAggregateModal: types.CALL_MODAL
})
},
locales
@@ -349,6 +355,19 @@
this.$message({message: tipMsg, type: 'success'})
}
}
+ async handleTableIndexRecognize () {
+ const selectedColumns = await this.callRecognizeAggregateModal({
+ type: 'TABLE_INDEX',
+ allColumns: this.allColumns,
+ model: this.modelInstance
+ })
+ this.allColumns.forEach((col) => {
+ if (selectedColumns.includes(col.fullName)) {
+ col.isUsed = true
+ }
+ })
+ this.selectTableIndex()
+ }
confirmSubmit (isLoadData) {
this.isLoadDataLoading = isLoadData
this.btnLoading = true
[kylin] 01/14: KYLIN-5618 Unify the copywriting of the ShardBy column on the Web GUI
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 e4449cae13c9a971ce7c414136611b650c394db3
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 12 15:45:40 2023 +0800
KYLIN-5618 Unify the copywriting of the ShardBy column on the Web GUI
---
.../studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue | 4 ++--
.../ModelList/ModelAggregateView/AggAdvancedModal/index.vue | 2 +-
kystudio/src/components/studio/StudioModel/TableIndex/locales.js | 2 +-
kystudio/src/locale/en.js | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
index cd7d4294b3..5fdc9c0015 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/indexDetails.vue
@@ -36,7 +36,7 @@
</template>
</el-table-column>
<el-table-column
- label="Shard by"
+ label="ShardBy"
align="center"
width="80">
<template slot-scope="scope">
@@ -72,7 +72,7 @@
</template>
</el-table-column>
<el-table-column
- label="Shard by"
+ label="ShardBy"
align="center"
width="80">
<template slot-scope="scope">
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregateView/AggAdvancedModal/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregateView/AggAdvancedModal/index.vue
index c1a999606b..5d40d15533 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregateView/AggAdvancedModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregateView/AggAdvancedModal/index.vue
@@ -28,7 +28,7 @@
<el-row class="table-header table-row ksd-mt-10">
<el-col :span="18">{{$t('dimension')}}</el-col>
<el-col :span="3" class="ksd-left">{{$t('cardinality')}}</el-col>
- <el-col :span="3">Shard by</el-col>
+ <el-col :span="3">ShardBy</el-col>
</el-row>
<div class="table-content" v-scroll.observe.reactive @scroll-bottom="scrollLoad">
<transition-group name="flip-list" tag="div">
diff --git a/kystudio/src/components/studio/StudioModel/TableIndex/locales.js b/kystudio/src/components/studio/StudioModel/TableIndex/locales.js
index e31286c54a..99bee505ba 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndex/locales.js
+++ b/kystudio/src/components/studio/StudioModel/TableIndex/locales.js
@@ -12,7 +12,7 @@ export default {
sort: 'Order',
ConfigRawTable: 'Config Table Index',
sortBy: 'Sort By',
- shardBy: 'Shard By',
+ shardBy: 'ShardBy',
checkRowkeyInt: 'Integer encoding column length should between 1 and 8.',
fixedLengthTip:
'The length parameter of Fixed Length encoding is required.',
diff --git a/kystudio/src/locale/en.js b/kystudio/src/locale/en.js
index 25a367e66d..855036173d 100644
--- a/kystudio/src/locale/en.js
+++ b/kystudio/src/locale/en.js
@@ -349,7 +349,7 @@ exports.default = {
cubeHasJob: 'This cube has a running job of cube build, thus the action is disabled.',
selectModelName: 'Please select a model',
optimizerInputTip: 'What is optimier? Based on model check result and SQL patterns,<br/> optimizer can help suggest dimensions, measures and dimension optimization.',
- rowkeyTip: '<h4>What is Rowkeys?</h4><p>Rowkeys specifies how dimensions are organized. </p><h4>What is Shard By column? </h4><p>If specified as "true", cube data will be sharded according to its value. </p><h4>RowKey Encoding</h4><ol><li>"dict" Use dictionary to encode dimension values. dict encoding is very compact but vulnerable for ultra high cardinality dimensions. </li><li>"boolean" Use 1 byte to encode boolean values, valid value include: true, false, TRUE, FALSE, True, False, [...]
+ rowkeyTip: '<h4>What is Rowkeys?</h4><p>Rowkeys specifies how dimensions are organized. </p><h4>What is ShardBy column? </h4><p>If specified as "true", cube data will be sharded according to its value. </p><h4>RowKey Encoding</h4><ol><li>"dict" Use dictionary to encode dimension values. dict encoding is very compact but vulnerable for ultra high cardinality dimensions. </li><li>"boolean" Use 1 byte to encode boolean values, valid value include: true, false, TRUE, FALSE, True, False, [...]
dataOriented: 'Data Oriented',
businessOriented: 'Business Oriented',
defaultOriented: 'Default',
[kylin] 13/14: KYLIN-5630 refine history format css 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 acc84f2116583bab2fe25bffa695b8170f660fef
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 13 16:34:12 2023 +0800
KYLIN-5630 refine history format css issue
---
kystudio/src/components/common/editor.vue | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kystudio/src/components/common/editor.vue b/kystudio/src/components/common/editor.vue
index 75df637180..046cc6325d 100644
--- a/kystudio/src/components/common/editor.vue
+++ b/kystudio/src/components/common/editor.vue
@@ -15,7 +15,11 @@
v-model="showCopyStatus">
<i class="el-icon-circle-check"></i> <span>{{$t('kylinLang.common.copySuccess')}}</span>
</el-popover>
- <el-tooltip placement="top" :disabled="isFormat==='origin'" :content="$t('kylinLang.common.formatTips')">
+ <el-tooltip placement="top" :disabled="isFormat==='origin'">
+ <div slot="content">{{$t('kylinLang.common.notice')}}<br/>
+ <span class="tooltips-cont"><i class="el-ksd-n-icon-warning-filled ksd-mb-2"></i>
+ <span>{{$t('kylinLang.common.formatTips')}}</span></span>
+ </div>
<i class="el-ksd-icon-dup_16 edit-copy-btn ksd-fs-16"
@click.stop
v-if="readOnly"
@@ -303,8 +307,9 @@ export default class KapEditor extends Vue {
border-radius: 6px;
.format-switch {
position: absolute;
- bottom: 0px;
+ bottom: -5px;
right: 10px;
+ z-index: 1;
.el-tabs__header {
margin: 0;
}
@@ -392,4 +397,7 @@ export default class KapEditor extends Vue {
}
}
}
+ .tooltips-cont {
+ color: @text-disabled-color;
+ }
</style>