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/24 10:42:25 UTC
[kylin] branch kylin5 updated (00a739080f -> 871fafaedc)
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 00a739080f KYLIN-5649 rm unused import
new e860a47638 KYLIN-5654 Diagnostic host issue
new cc42717d93 KYLIN-5655 refine page list layout and new %X issue
new 2fb0f5a181 KYLIN-5656 lookup cc
new 3422d22167 KYLIN-5657 fix model detail page size issue
new e54a8244eb KYLIN-5658 refine logic view editor issue
new 956f5d0f7f KYLIN-5659 refine SecurityProfile locals
new e717b82b67 KYLIN-5660 base indexes issue
new 0ab480c82e KYLIN-5661 fix del cc from fact table issue
new 9c8496563b KYLIN-5662 model list lite issue
new f9a3f53267 KYLIN-5663 refine css issue
new 0d942d5156 KYLIN-5664 no dim and meas index base type issue
new 510c0c4ccb KYLIN-5665 fix give up model edit route
new 871fafaedc KYLIN-5666 add tip when add base index
The 13 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/src/assets/styles/variables.less | 1 +
kystudio/src/components/admin/Diagnostic/index.vue | 10 +-
kystudio/src/components/admin/Group/index.vue | 10 +-
kystudio/src/components/admin/Group/locales.js | 6 +-
kystudio/src/components/admin/User/index.vue | 4 +-
kystudio/src/components/admin/User/locales.js | 4 +-
.../src/components/common/GroupEditModal/index.vue | 2 +-
.../components/common/GroupEditModal/locales.js | 4 +-
.../common/ModelERDiagram/ModelERDiagram.vue | 18 +-
.../common/ProjectEditModal/ProjectEditModal.vue | 2 +-
.../components/common/ProjectEditModal/locales.js | 4 +-
.../src/components/common/UserEditModal/index.vue | 2 +-
.../src/components/common/UserEditModal/locales.js | 2 +-
.../components/layout/layout_left_right_top.vue | 2 -
kystudio/src/components/monitor/batchJobs/jobs.vue | 5 +-
.../src/components/monitor/batchJobs/locales.js | 2 +-
.../components/monitor/streamingJobs/locales.js | 71 --
.../monitor/streamingJobs/streamingJobs.vue | 1108 --------------------
kystudio/src/components/project/project_list.vue | 10 +-
kystudio/src/components/query/query_result.vue | 6 -
kystudio/src/components/studio/DDL/ddl.vue | 1 +
.../EditLogicalDialog/EditLogicalDialog.vue | 1 -
.../components/studio/LogicalView/LogicalView.vue | 14 +-
.../StudioModel/ComputedColumnForm/ccform.vue | 2 +-
.../studio/StudioModel/ModelEdit/index.vue | 88 +-
.../studio/StudioModel/ModelEdit/model.js | 89 +-
.../studio/StudioModel/ModelEdit/table.js | 26 +-
.../ModelList/ConfirmSegment/ConfirmSegment.vue | 11 +-
.../StudioModel/ModelList/ConfirmSegment/store.js | 6 +-
.../ModelList/ModelActions/modelActions.vue | 17 +-
.../ModelList/ModelAddModal/addmodel.vue | 2 +-
.../StudioModel/ModelList/ModelAggregate/index.vue | 123 +--
.../ModelList/ModelAggregate/locales.js | 8 +-
.../ModelList/ModelBuildModal/build.vue | 35 +-
.../ModelList/ModelLayout/modelLayout.vue | 42 +-
.../StudioModel/ModelList/ModelPartition/index.vue | 22 +-
.../ModelList/ModelSaveConfig/index.vue | 279 ++---
.../ModelList/ModelSaveConfig/locales.js | 15 +-
.../ModelStreamingJob/ModelStreamingJob.vue | 362 -------
.../ModelList/ModelStreamingJob/locales.js | 34 -
.../studio/StudioModel/ModelList/index.vue | 195 ++--
.../studio/StudioModel/ModelList/locales.js | 6 +-
.../studio/StudioModel/TableIndexEdit/store.js | 1 -
.../StudioModel/TableIndexEdit/tableindex_edit.vue | 3 +-
.../studio/StudioModel/TableJoinModal/index.vue | 11 +-
kystudio/src/components/studio/snapshot/locales.js | 2 +-
.../src/components/studio/snapshot/snapshot.vue | 6 +-
kystudio/src/config/index.js | 4 +-
kystudio/src/locale/en.js | 13 +-
kystudio/src/router/index.js | 6 -
kystudio/src/service/model.js | 2 +-
kystudio/src/service/monitor.js | 9 -
kystudio/src/store/model.js | 9 -
kystudio/src/store/monitor.js | 9 -
54 files changed, 617 insertions(+), 2109 deletions(-)
delete mode 100644 kystudio/src/components/monitor/streamingJobs/locales.js
delete mode 100644 kystudio/src/components/monitor/streamingJobs/streamingJobs.vue
delete mode 100644 kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/ModelStreamingJob.vue
delete mode 100644 kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/locales.js
[kylin] 05/13: KYLIN-5658 refine logic view editor 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 e54a8244ebda090789946944de6aea4f83d457cb
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 14:52:10 2023 +0800
KYLIN-5658 refine logic view editor issue
---
kystudio/src/components/studio/DDL/ddl.vue | 1 +
.../LogicalView/EditLogicalDialog/EditLogicalDialog.vue | 1 -
kystudio/src/components/studio/LogicalView/LogicalView.vue | 14 ++++++++++++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/kystudio/src/components/studio/DDL/ddl.vue b/kystudio/src/components/studio/DDL/ddl.vue
index a22f979522..ac0da6b127 100644
--- a/kystudio/src/components/studio/DDL/ddl.vue
+++ b/kystudio/src/components/studio/DDL/ddl.vue
@@ -206,6 +206,7 @@
flex: 1;
position: relative;
.run-btn {
+ z-index: 1;
width: 40px;
height: 38px;
position: absolute;
diff --git a/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
index 9b109b64e0..881d3219c7 100644
--- a/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
+++ b/kystudio/src/components/studio/LogicalView/EditLogicalDialog/EditLogicalDialog.vue
@@ -18,7 +18,6 @@
ref="logicalSql"
theme="chrome"
:dragable="false"
- :isAbridge="true"
:value="sql"
@input="handleChangeSql">
</kap-editor>
diff --git a/kystudio/src/components/studio/LogicalView/LogicalView.vue b/kystudio/src/components/studio/LogicalView/LogicalView.vue
index 649e1b90e6..b263ce10c4 100644
--- a/kystudio/src/components/studio/LogicalView/LogicalView.vue
+++ b/kystudio/src/components/studio/LogicalView/LogicalView.vue
@@ -6,7 +6,7 @@
</div>
<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>
+ <editor class="ddl-editor" v-model="content" :height="editorHeight" ref="ddlEditor" lang="sql" theme="chrome" @keydown.meta.enter.native="runSql" @keydown.ctrl.enter.native="runSql"></editor>
<div class="run-btn">
<el-tooltip effect="dark" placement="left">
<div slot="content">{{$t('runBtnTip')}}<span class="accelerator-key">{{$t('acceleratorKey')}}</span></div>
@@ -161,6 +161,13 @@
return this.$t('syntaxRules')
}
}
+ get editorHeight () {
+ if (this.showCreateSuccessAlert) {
+ return 'calc(100% + 37px)'
+ }
+ return '100%'
+ }
+
setOption (option) {
let editor = this.$refs.ddlEditor.editor
if (!editor) return
@@ -258,10 +265,13 @@
flex: 1;
display: flex;
flex-direction: column;
+ position: relative;
.editor-content {
flex: 1;
- position: relative;
+ height: calc(~'100% - 60px');
+ overflow: auto;
.run-btn {
+ z-index: 1;
width: 40px;
height: 38px;
position: absolute;
[kylin] 04/13: KYLIN-5657 fix model detail page size 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 3422d2216721c517c400a0d5456ba52894836fb6
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 14:34:52 2023 +0800
KYLIN-5657 fix model detail page size issue
---
.../studio/StudioModel/ModelList/ModelLayout/modelLayout.vue | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index f80774ee07..4bb9f838ed 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -133,6 +133,7 @@ import { Component } from 'vue-property-decorator'
import { mapState, mapGetters, mapActions } from 'vuex'
import { handleError, jumpToJobs } from 'util/business'
import { transToServerGmtTime, handleSuccessAsync } from 'util'
+import { pageRefTags, pageCount } from 'config'
import locales from './locales'
import ModelOverview from '../ModelOverview/ModelOverview.vue'
import ModelSegment from '../ModelSegment/index.vue'
@@ -225,6 +226,7 @@ import ModelTitleDescription from '../Components/ModelTitleDescription'
locales
})
export default class ModelLayout extends Vue {
+ pageRefTags = pageRefTags
randomKey = Date.now().toString(32)
initData = false
currentModelRow = null
@@ -303,7 +305,7 @@ export default class ModelLayout extends Vue {
this.showSearchResult = true
this.loadModels({
page_offset: modelPageOffest || 0,
- page_size: 10,
+ page_size: +localStorage.getItem(this.pageRefTags.modelListPager) || pageCount,
exact: false,
model_name: modelName || '',
sort_by: 'last_modify',
[kylin] 03/13: KYLIN-5656 lookup cc
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 2fb0f5a18132eece1d4bae4d8c46b597cfe0adbf
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 14:26:26 2023 +0800
KYLIN-5656 lookup cc
---
.../StudioModel/ComputedColumnForm/ccform.vue | 2 +-
.../studio/StudioModel/ModelEdit/index.vue | 84 ++++++++++++++++++----
.../studio/StudioModel/ModelEdit/model.js | 73 ++++++++++++++-----
.../studio/StudioModel/ModelEdit/table.js | 26 +++----
.../ModelList/ModelBuildModal/build.vue | 33 ++++++---
.../StudioModel/ModelList/ModelPartition/index.vue | 20 +++---
.../ModelList/ModelSaveConfig/index.vue | 29 +++++---
.../studio/StudioModel/TableJoinModal/index.vue | 11 +--
kystudio/src/service/model.js | 2 +-
9 files changed, 202 insertions(+), 78 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ComputedColumnForm/ccform.vue b/kystudio/src/components/studio/StudioModel/ComputedColumnForm/ccform.vue
index 0abd0f0de0..44df01dba3 100644
--- a/kystudio/src/components/studio/StudioModel/ComputedColumnForm/ccform.vue
+++ b/kystudio/src/components/studio/StudioModel/ComputedColumnForm/ccform.vue
@@ -144,7 +144,7 @@ export default class CCForm extends Vue {
}
errorMsg = ''
checkRemoteCC (cb) {
- this.modelInstance.generateMetadata().then((data) => {
+ this.modelInstance.generateMetadata(true).then((data) => {
// 组装带cc的模型功校验cc接口使用
let resData = objectClone(data)
if (!this.isEdited) {
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
index 7de4565f96..8382f1ebad 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
@@ -134,7 +134,7 @@
</span>
</li>
<!-- 渲染可计算列 -->
- <template v-if="t.kind=== 'FACT'">
+ <!-- <template v-if="t.kind=== 'FACT'">
<li :class="['column-li', 'column-li-cc', {'is-link': col.isPK || col.isFK}]"
@drop='(e) => {dropColumn(e, {name: col.columnName }, t)}'
@dragover="(e) => {dragColumnEnter(e, t, col)}"
@@ -153,7 +153,7 @@
<span :class="['col-name']" v-custom-tooltip="{text: col.columnName, w: 30, effect: 'dark', 'popper-class': 'popper--small', 'visible-arrow': false, position: 'bottom-start', observerId: t.guid}">{{col.columnName}}</span>
</span>
</li>
- </template>
+ </template> -->
<li class="li-load-more" v-if="t.hasMoreColumns && t.hasScrollEnd && !showOnlyConnectedColumn"><i class="el-ksd-icon-loading_16"></i></li>
</ul>
</div>
@@ -1165,23 +1165,34 @@ export default class ModelEdit extends Vue {
if (tableBoxes.length > 0) {
Array.prototype.slice.call(tableBoxes).forEach(item => {
item.classList.remove('is-focus')
- item.classList.remove('is-broken')
+ // item.classList.remove('is-broken')
})
}
if (linkLabels.length > 0) {
Array.prototype.slice.call(linkLabels).forEach(item => {
item.classList.remove('is-focus')
- item.classList.remove('is-broken')
+ // item.classList.remove('is-broken')
})
}
if (svgLine.length > 0) {
Array.prototype.slice.call(svgLine).forEach(item => {
- item.setAttribute('class', `${item.className.baseVal.replace(/is-focus|is-broken/g, '')}`)
+ item.setAttribute('class', `${item.className.baseVal.replace(/is-focus/g, '')}`)
})
}
this.blurTableActionDropdown()
document.activeElement && document.activeElement.blur()
}
+
+ removeBrokenStatus (conn, isBrokenLine) {
+ const { _jsPlumb, canvas, source, target } = conn
+ if (isBrokenLine) return
+ source.classList.remove('is-broken')
+ target.classList.remove('is-broken')
+ canvas.querySelector('g').setAttribute('id', 'use-group')
+ canvas.nextSibling.classList.remove('is-broken')
+ _jsPlumb.paintStyle.stroke = '#A5B2C5'
+ }
+
// 隐藏下拉框
blurTableActionDropdown () {
if (this.$refs.tableActionsDropdown) {
@@ -1414,7 +1425,38 @@ export default class ModelEdit extends Vue {
}
// 单个删除CC
delCC (name) {
- this.modelInstance.delCC(name)
+ this.modelInstance.delCC(name).then((delCCValue) => {
+ const joinTables = this.modelInstance.tables
+ const [ cc ] = delCCValue
+ const includeCurrentCCJoins = []
+ Object.values(joinTables).forEach(jt => {
+ const joinInfo = Object.values(jt.joinInfo)
+ if (!joinInfo.length) return
+ joinInfo.forEach(jc => {
+ if (jc.join.primary_key.includes(`${cc.tableAlias}.${cc.columnName}`) || jc.join.foreign_key.includes(`${cc.tableAlias}.${cc.columnName}`)) {
+ includeCurrentCCJoins.push({pid: jt.guid, fid: jc.foreignTable.guid})
+ }
+ })
+ })
+ includeCurrentCCJoins.forEach(it => {
+ // this.modelInstance.renderLink(it.pid, it.fid)
+ const conn = this.modelInstance.allConnInfo[`${it.pid}$${it.fid}`]
+ if (conn) {
+ const { _jsPlumb } = conn
+ conn.isBroken = true
+ conn.canvas.querySelector('g').setAttribute('id', 'broken-use-group')
+ _jsPlumb.paintStyle.stroke = '#E03B3B'
+ _jsPlumb.hoverPaintStyle.stroke = '#CA1616'
+ this.modelInstance.setOverLayLabel(conn, true)
+ // this.modelInstance.plumbTool.refreshPlumbInstance()
+ this.$nextTick(() => {
+ conn.source.className += ' is-broken'
+ conn.target.className += ' is-broken'
+ })
+ }
+ })
+ // this.modelInstance.createAndUpdateSvgGroup(null, {type: 'update'})
+ })
}
editCC (cc) {
this.showAddCCDialog({
@@ -1441,6 +1483,9 @@ export default class ModelEdit extends Vue {
if (this.modelRender.computed_columns.length === 0) {
this.toggleCCCheckbox()
}
+ this.$nextTick(() => {
+ this.modelInstance.plumbTool.refreshPlumbInstance()
+ })
}
editMeasure (m) {
this.$nextTick(() => {
@@ -1741,13 +1786,14 @@ export default class ModelEdit extends Vue {
this.$nextTick(() => {
// const cloneTables = objectClone(this.modelRender.tables)
Object.values(this.modelRender.tables).forEach(t => {
- const pfkLinkColumns = t.columns.filter(it => it.isPK && it.isFK).sort((a, b) => a - b)
- const pkLinkColumns = t.columns.filter(it => it.isPK && !it.isFK).sort((a, b) => a - b)
- const fkLinkColumns = t.columns.filter(it => it.isFK && !it.isPK).sort((a, b) => a - b)
- const unlinkColumns = t.columns.filter(it => !it.isPK && !it.isFK)
- t.columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
- t._cache_search_columns = t.columns
+ const pfkLinkColumns = t.all_columns.filter(it => it.isPK && it.isFK).sort((a, b) => a - b)
+ const pkLinkColumns = t.all_columns.filter(it => it.isPK && !it.isFK).sort((a, b) => a - b)
+ const fkLinkColumns = t.all_columns.filter(it => it.isFK && !it.isPK).sort((a, b) => a - b)
+ const unlinkColumns = t.all_columns.filter(it => !it.isPK && !it.isFK)
+ t.columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns].filter(it => !it.is_computed_column)
+ t._cache_search_columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
t.showColumns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns].slice(0, t.columnPerSize)
+ t.all_columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
})
this.$set(this.modelInstance, 'tables', this.modelRender.tables)
console.log(this.modelInstance.allConnInfo)
@@ -2447,6 +2493,11 @@ export default class ModelEdit extends Vue {
color: @ke-color-danger-hover;
}
}
+ &.is-focus {
+ .join-type {
+ color: @ke-color-danger-hover !important;
+ }
+ }
}
&.link-label.is-focus {
.join-type {
@@ -3169,6 +3220,12 @@ export default class ModelEdit extends Vue {
stroke-width: 2;
}
}
+ #broken-use-group {
+ > path:not(#use) {
+ stroke: @ke-color-danger;
+ stroke-width: 2;
+ }
+ }
}
}
.edit-table-layout {
@@ -3204,6 +3261,9 @@ export default class ModelEdit extends Vue {
&.link-hover:not(.is-focus) {
border: 2px solid @base-color-6;
}
+ &.link-hover.is-broken:not(.is-focus) {
+ border: 2px solid @ke-color-danger;
+ }
&:hover:not(.is-focus) {
// box-shadow: @fact-hover-shadow;
border: 2px solid @base-color-6;
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
index d3d828d31d..42837e30a4 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
@@ -208,6 +208,7 @@ class NModel extends Schama {
if (!primaryKeys || primaryKeys && primaryKeys.length === 1 && primaryKeys[0] === '') {
this.removeRenderLink(hasConn)
} else {
+ this.vm.removeBrokenStatus(hasConn, isBrokenLine)
!isBrokenLine && this.plumbTool.setLineStyle('default')
this.setOverLayLabel(hasConn, isBrokenLine)
this.plumbTool.refreshPlumbInstance()
@@ -246,17 +247,29 @@ class NModel extends Schama {
checkIsBrokenModelLink (pid, fid, primaryKeys, foreignKeys) {
let ptable = this.getTableByGuid(pid)
let primaryKeysLen = primaryKeys.length
+
+ let ftable = this.getTableByGuid(fid)
+ let foreignKeysLen = foreignKeys.length
+
+ const primaryTableComputeColumns = []
+ const foreignTableComputeColumns = []
+ this.computed_columns.forEach(col => {
+ if (col.tableAlias === ptable.alias) {
+ primaryTableComputeColumns.push({...col, name: col.columnName})
+ } else if (col.tableAlias === ftable.alias) {
+ foreignTableComputeColumns.push({...col, name: col.columnName})
+ }
+ })
for (let i = 0; i < primaryKeysLen; i++) {
let column = primaryKeys[i] && primaryKeys[i].replace(/^.*?\./, '')
- if (indexOfObjWithSomeKey(ptable.columns, 'name', column) < 0) {
+ if (indexOfObjWithSomeKey([...ptable.columns, ...primaryTableComputeColumns], 'name', column) < 0) {
return true
}
}
- let ftable = this.getTableByGuid(fid)
- let foreignKeysLen = foreignKeys.length
+
for (let i = 0; i < foreignKeysLen; i++) {
let column = foreignKeys[i] && foreignKeys[i].replace(/^.*?\./, '')
- if (indexOfObjWithSomeKey(ftable.columns, 'name', column) < 0) {
+ if (indexOfObjWithSomeKey([...ftable.columns, ...foreignTableComputeColumns], 'name', column) < 0) {
return true
}
}
@@ -269,7 +282,8 @@ class NModel extends Schama {
if (table) {
for (let i = 0; i < keysLen; i++) {
let column = keys[i] && keys[i].replace(/^.*?\./, '')
- if (indexOfObjWithSomeKey(table.columns, 'name', column) < 0) {
+ const ccColumns = this.computed_columns ? this.computed_columns.map(it => ({...it, name: it.columnName})) : []
+ if (indexOfObjWithSomeKey([...table.columns, ...ccColumns], 'name', column) < 0) {
result.push(keys[i])
}
}
@@ -379,13 +393,14 @@ class NModel extends Schama {
}
setTimeout(() => {
Object.values(this.tables).forEach(t => {
- const pfkLinkColumns = t.columns.filter(it => it.isPK && it.isFK).sort((a, b) => a - b)
- const pkLinkColumns = t.columns.filter(it => it.isPK && !it.isFK).sort((a, b) => a - b)
- const fkLinkColumns = t.columns.filter(it => it.isFK && !it.isPK).sort((a, b) => a - b)
- const unlinkColumns = t.columns.filter(it => !it.isPK && !it.isFK)
- t.columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
+ const pfkLinkColumns = t.all_columns.filter(it => it.isPK && it.isFK).sort((a, b) => a - b)
+ const pkLinkColumns = t.all_columns.filter(it => it.isPK && !it.isFK).sort((a, b) => a - b)
+ const fkLinkColumns = t.all_columns.filter(it => it.isFK && !it.isPK).sort((a, b) => a - b)
+ const unlinkColumns = t.all_columns.filter(it => !it.isPK && !it.isFK)
+ t.columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns].filter(it => !it.is_computed_column)
t.showColumns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns].slice(0, t.columnPerSize)
- t._cache_search_columns = t.columns
+ t._cache_search_columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
+ t.all_columns = [...pfkLinkColumns, ...pkLinkColumns, ...fkLinkColumns, ...unlinkColumns]
this.$set(this._mount, 'tables', this.tables)
})
}, 0)
@@ -835,17 +850,18 @@ class NModel extends Schama {
// 删除对应的 tableindex
this._delTableIndexByAlias(alias)
// 删除对应的 cc
- this._delCCByAlias(alias)
+ this._delCCByAlias(ntable)
// 删除对应的partition
this._delTableRelatedPartitionInfo(ntable)
}
}
- _delCCByAlias (tableAlias) {
- const ccList = this._mount.computed_columns.filter(it => it.tableAlias !== tableAlias)
- this._mount.computed_columns = ccList
+ _delCCByAlias (ntable) {
+ const ccList = this._mount.computed_columns.filter(it => it.tableAlias === ntable.alias)
ccList.forEach(cc => {
+ const index = indexOfObjWithSomeKey(this._mount.computed_columns, 'guid', cc.guid)
+ this._mount.computed_columns.splice(index, 1)
let ccColumnName = typeof cc === 'object' ? cc.columnName : cc
- this._delCCRelated(tableAlias, ccColumnName)
+ this._delCCRelated(ntable, ccColumnName)
})
}
getTable (key, val) {
@@ -942,6 +958,13 @@ class NModel extends Schama {
this.partition_desc.partition_time_column = null
}
}
+ _delCCInTableAllColumns (t, column) {
+ const index = t.all_columns.findIndex(it => it.column === column)
+ t.all_columns.splice(index, 1)
+ t.columnCurrentPage = 1
+ t.filterColumns()
+ // this.$set(this._mount.tables, t.guid, t)
+ }
changeTableType (t) {
t.kind = t.kind === modelRenderConfig.tableKind.fact ? modelRenderConfig.tableKind.lookup : modelRenderConfig.tableKind.fact
this.setUniqueAlias(t)
@@ -1098,6 +1121,7 @@ class NModel extends Schama {
getAllConnectsByGuid: this.getAllConnectsByGuid.bind(this),
createAndUpdateSvgGroup: this.createAndUpdateSvgGroup.bind(this)
}
+ options.computed_columns = this.computed_columns
if (tableInfo.source_type === 1 && !options.isSecStorageEnabled) {
if (!this.getFactTable()) {
options.kind = modelRenderConfig.tableKind.fact
@@ -1367,6 +1391,10 @@ class NModel extends Schama {
if (this.checkSameCCName(ccObj.columnName)) {
let ccMeta = this.generateCCMeta(ccObj)
this._mount.computed_columns.push(ccMeta)
+ // 更新事实表的columns
+ const factTable = this.getFactTable()
+ factTable.all_columns.push({...ccMeta, name: ccMeta.columnName, column: ccMeta.columnName, is_computed_column: true})
+ factTable.filterColumns()
resolve(ccMeta)
} else {
reject()
@@ -1384,6 +1412,15 @@ class NModel extends Schama {
resolve(c)
}
})
+ // 更新事实表的columns
+ const factTable = this.getFactTable()
+ factTable.all_columns.forEach((c) => {
+ if (c.guid === ccObj.guid) {
+ Object.assign(c, ccObj)
+ hasEdit = true
+ resolve(c)
+ }
+ })
if (!hasEdit) {
reject()
}
@@ -1399,6 +1436,8 @@ class NModel extends Schama {
this._delTableIndexByAlias(alias, column)
// 删除partition里的cc
this._delTableRelatedPartitionInfo(t, column)
+ // 删除 all_columns 里相关 cc
+ this._delCCInTableAllColumns(t, column)
}
// 删除可计算列
delCC (cc) {
@@ -1586,7 +1625,7 @@ class NModel extends Schama {
const firstPathLine = paths[0].getAttribute('d')
paths[1].setAttribute('d', firstPathLine)
} else {
- this.createAndUpdateSvgGroup(line, this.allConnInfo[item].isBroken, 'create')
+ this.createAndUpdateSvgGroup(line, {...this.allConnInfo[item], type: 'create'})
}
})
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/table.js b/kystudio/src/components/studio/StudioModel/ModelEdit/table.js
index 2c0406f32a..40f92cecf8 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/table.js
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/table.js
@@ -24,6 +24,7 @@ class NTable {
this.source_type = options.source_type
this.batch_table_identity = options.batch_table_identity // kafka关联的hive表名
this._cache_search_columns = this.columns // 搜索结果缓存
+ this.all_columns = [...this.columns, ...options.computed_columns.filter(col => col.tableAlias === this.alias).map(item => ({...item, name: item.columnName, column: item.columnName, is_computed_column: true}))] // 所有挂在该表上的列(包括 cc 列)
// this._parent = options._parent
this.ST = null
this.spreadOut = true
@@ -85,7 +86,7 @@ class NTable {
}
filterColumns () {
let reg = new RegExp(this.filterColumnChar, 'i')
- this.showColumns = this.columns.filter((col) => {
+ this.showColumns = this.all_columns.filter((col) => {
return this.filterColumnChar ? reg.test(col.name) : true
})
this._cache_search_columns = this.showColumns
@@ -252,8 +253,8 @@ class NTable {
return this.joinInfo[this.guid] || {}
}
getColumnObj (columnName) {
- for (let i = 0; i < this.columns.length; i++) {
- const col = this.columns[i]
+ for (let i = 0; i < this.all_columns.length; i++) {
+ const col = this.all_columns[i]
if (col.name === columnName) {
return col
}
@@ -268,16 +269,17 @@ class NTable {
col[key] = val
}
}
+ this.columns = this.all_columns.filter(it => !it.is_computed_column)
}
- changeColumnsProperty (key, val, _) {
- this.columns.forEach((col) => {
- if (_) {
- _.$set(col, key, val)
- } else {
- col[key] = val
- }
- })
- }
+ // changeColumnsProperty (key, val, _) {
+ // this.columns.forEach((col) => {
+ // if (_) {
+ // _.$set(col, key, val)
+ // } else {
+ // col[key] = val
+ // }
+ // })
+ // }
// 可计算列处理
// 维度处理
// dimension处理
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
index 9882c587a0..010c41ed35 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
@@ -278,7 +278,7 @@
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
import vuex from 'store'
import { handleError, transToUTCMs, getGmtDateFromUtcLike, kylinMessage } from 'util/business'
- import { handleSuccessAsync, transToServerGmtTime, isDatePartitionType, isStreamingPartitionType, isSubPartitionType, kylinConfirm, split_array } from 'util/index'
+ import { handleSuccessAsync, transToServerGmtTime, isDatePartitionType, isStreamingPartitionType, isSubPartitionType, kylinConfirm, split_array, objectClone, indexOfObjWithSomeKey } from 'util/index'
import locales from './locales'
import store, { types } from './store'
import NModel from '../../ModelEdit/model.js'
@@ -530,7 +530,13 @@
async handleLoadFormat () {
try {
this.isLoadingFormat = true
- const response = await this.fetchPartitionFormat({ project: this.currentSelectedProject, table: this.selectedTable.name, partition_column: this.partitionMeta.column })
+ const ccColumns = this.modelInstance.getComputedColumns()
+ const index = indexOfObjWithSomeKey(ccColumns, 'columnName', this.partitionMeta.column)
+ const data = { project: this.currentSelectedProject, table: this.selectedTable.name, partition_column: this.partitionMeta.column }
+ if (index !== -1) { // 分区列是CC列
+ data.expression = ccColumns[index].innerExpression
+ }
+ const response = await this.fetchPartitionFormat(data)
this.partitionMeta.format = await handleSuccessAsync(response)
this.partitionColumnFormatChange(this.partitionMeta.format)
this.isLoadingFormat = false
@@ -555,15 +561,15 @@
}
})
}
- // let ccColumns = this.modelInstance.getComputedColumns()
- // let cloneCCList = objectClone(ccColumns)
- // cloneCCList.forEach((x) => {
- // let cc = {
- // name: x.columnName,
- // datatype: x.datatype
- // }
- // result.push(cc)
- // })
+ let ccColumns = this.modelInstance.getComputedColumns()
+ let cloneCCList = objectClone(ccColumns)
+ cloneCCList.forEach((x) => {
+ let cc = {
+ name: x.columnName,
+ datatype: x.datatype
+ }
+ result.push(cc)
+ })
return result
}
@@ -775,12 +781,17 @@
partition_date_column: this.partitionMeta.table + '.' + this.partitionMeta.column,
partition_date_format: this.partitionMeta.format
}
+ const ccColumns = this.modelInstance.getComputedColumns()
+ const index = indexOfObjWithSomeKey(ccColumns, 'columnName', this.partitionMeta.column)
try {
const submitData = {
project: this.currentSelectedProject,
model: this.modelId,
partition_desc: partition_desc
}
+ if (index !== -1) { // 分区列是CC列
+ submitData.expression = ccColumns[index].innerExpression
+ }
const response = await this.fetchNewestModelRange(submitData)
if (submitData.model !== this.modelId) { // 避免ajax耗时太长导致会覆盖新的model的load range数据
return
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
index ca48d1a37d..fa0841949f 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
@@ -145,7 +145,7 @@ import locales from './locales'
import store, { types } from './store'
import { timeDataType, dateFormats, timestampFormats, dateTimestampFormats } from 'config'
import NModel from '../../ModelEdit/model.js'
-import { isDatePartitionType, isStreamingPartitionType, isSubPartitionType, kylinConfirm } from 'util'
+import { isDatePartitionType, isStreamingPartitionType, isSubPartitionType, kylinConfirm, objectClone } from 'util'
import { handleSuccessAsync, handleError } from 'util/index'
vuex.registerModule(['modals', 'ModelPartition'], store)
@@ -262,15 +262,15 @@ export default class ModelPartition extends Vue {
}
})
}
- // let ccColumns = this.modelInstance.getComputedColumns()
- // let cloneCCList = objectClone(ccColumns)
- // cloneCCList.forEach((x) => {
- // let cc = {
- // name: x.columnName,
- // datatype: x.datatype
- // }
- // result.push(cc)
- // })
+ let ccColumns = this.modelInstance.getComputedColumns()
+ let cloneCCList = objectClone(ccColumns)
+ cloneCCList.forEach((x) => {
+ let cc = {
+ name: x.columnName,
+ datatype: x.datatype
+ }
+ result.push(cc)
+ })
return result
}
get subPartitionColumnOtions () {
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index b2758359b8..efc76eb115 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -310,6 +310,9 @@ vuex.registerModule(['modals', 'ModelSaveConfig'], store)
setModalForm: types.SET_MODAL_FORM,
resetModalForm: types.RESET_MODAL_FORM
}),
+ ...mapMutations({
+ resetOtherColumns: 'RESET_OTHER_COLUMNS'
+ }),
...mapActions('DetailDialogModal', {
callGlobalDetailDialog: 'CALL_MODAL'
}),
@@ -469,7 +472,13 @@ export default class ModelPartitionModal extends Vue {
async handleLoadFormat () {
try {
this.isLoadingFormat = true
- const response = await this.fetchPartitionFormat({ project: this.currentSelectedProject, table: this.selectedTable.name, partition_column: this.partitionMeta.column })
+ const ccColumns = this.modelInstance.getComputedColumns()
+ const index = indexOfObjWithSomeKey(ccColumns, 'columnName', this.partitionMeta.column)
+ const data = { project: this.currentSelectedProject, table: this.selectedTable.name, partition_column: this.partitionMeta.column }
+ if (index !== -1) { // 分区列是CC列
+ data.expression = ccColumns[index].innerExpression
+ }
+ const response = await this.fetchPartitionFormat(data)
this.partitionMeta.format = await handleSuccessAsync(response)
this.changeColumn('format', this.partitionMeta.format)
this.isLoadingFormat = false
@@ -566,15 +575,15 @@ export default class ModelPartitionModal extends Vue {
})
}
// 暂不支持CC列做分区列
- // let ccColumns = this.modelInstance.getComputedColumns()
- // let cloneCCList = objectClone(ccColumns)
- // cloneCCList.forEach((x) => {
- // let cc = {
- // name: x.columnName,
- // datatype: x.datatype
- // }
- // result.push(cc)
- // })
+ let ccColumns = this.modelInstance.getComputedColumns()
+ let cloneCCList = objectClone(ccColumns)
+ cloneCCList.forEach((x) => {
+ let cc = {
+ name: x.columnName,
+ datatype: x.datatype
+ }
+ result.push(cc)
+ })
return result
}
getColumnInfo (column) {
diff --git a/kystudio/src/components/studio/StudioModel/TableJoinModal/index.vue b/kystudio/src/components/studio/StudioModel/TableJoinModal/index.vue
index db0a9f8452..6f9b978861 100644
--- a/kystudio/src/components/studio/StudioModel/TableJoinModal/index.vue
+++ b/kystudio/src/components/studio/StudioModel/TableJoinModal/index.vue
@@ -327,15 +327,15 @@ export default class TableJoinModal extends Vue {
}
get fColumns () {
let ntable = this.fTable
- if (ntable) {
- return ntable.columns
+ if (ntable && !Array.isArray(ntable)) {
+ return ntable.kind === 'FACT' ? [...ntable.columns, ...this.ccColumns] : ntable.columns
}
return []
}
get pColumns () {
let ntable = this.pTable
- if (ntable) {
- return ntable.columns
+ if (ntable && !Array.isArray(ntable)) {
+ return ntable.kind === 'FACT' ? [...ntable.columns, ...this.ccColumns] : ntable.columns
}
return []
}
@@ -345,6 +345,9 @@ export default class TableJoinModal extends Vue {
get pTable () {
return this.form.tables && this.form.tables[this.selectP] || []
}
+ get ccColumns () {
+ return this.form.modelInstance && this.form.modelInstance.computed_columns && this.form.modelInstance.computed_columns.length > 0 ? this.form.modelInstance.computed_columns.map(it => ({...it, column: it.columnName, name: it.columnName, table_alias: it.tableAlias})) : []
+ }
checkIsBrokenPrimaryKey (rule, value, callback) {
if (value) {
if (this.checkIsBroken(this.brokenPrimaryKeys, value)) {
diff --git a/kystudio/src/service/model.js b/kystudio/src/service/model.js
index 51004d16d5..7e31580d3b 100644
--- a/kystudio/src/service/model.js
+++ b/kystudio/src/service/model.js
@@ -188,7 +188,7 @@ export default {
return window.kylinVm.$http.post(apiUrl + 'models/job_error_status', body, { headers })
},
getModelDataNewestRange: (para) => {
- return Vue.resource(apiUrl + `models/${para.model}/data_range/latest_data`).save({project: para.project, partition_desc: para.partition_desc})
+ return Vue.resource(apiUrl + `models/${para.model}/data_range/latest_data`).save(para)
},
loadModelConfigList: (para) => {
return Vue.resource(apiUrl + 'models/config').get(para)
[kylin] 12/13: KYLIN-5665 fix give up model edit route
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 510c0c4ccbb9d3fac4c37364a08a1c6023e23cc7
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Jul 21 11:02:41 2023 +0800
KYLIN-5665 fix give up model edit route
---
.../studio/StudioModel/ModelList/ModelLayout/modelLayout.vue | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index 438e62f9d1..a5c09d6822 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -315,8 +315,11 @@ export default class ModelLayout extends Vue {
const { value } = await handleSuccessAsync(response)
if (value.length) {
this.currentModelRow = {...this.currentModelRow, ...value[0]}
+ if (!this.modelList.filter(it => it.alias === this.modelName).length) {
+ // 没有匹配到相应的 model
+ this.jumpBack()
+ }
} else {
- // 没有匹配到相应的 model
this.$router.replace({ name: 'ModelList', params: {searchModelName: this.searchModelName} })
}
}
[kylin] 06/13: KYLIN-5659 refine SecurityProfile locals
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 956f5d0f7fb0bc1983d7840af1f1456475539853
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 15:04:02 2023 +0800
KYLIN-5659 refine SecurityProfile locals
---
kystudio/src/components/admin/Group/index.vue | 10 +++++-----
kystudio/src/components/admin/Group/locales.js | 2 +-
kystudio/src/components/admin/User/index.vue | 2 +-
kystudio/src/components/admin/User/locales.js | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/kystudio/src/components/admin/Group/index.vue b/kystudio/src/components/admin/Group/index.vue
index f122878928..36cc253bf3 100644
--- a/kystudio/src/components/admin/Group/index.vue
+++ b/kystudio/src/components/admin/Group/index.vue
@@ -2,7 +2,7 @@
<div class="security-group" v-loading="isLoadingUserGroups">
<div class="ksd-title-label ksd-mt-20 ksd-mrl-20">{{$t('userGroupsList')}}</div>
<el-row class="ksd-mb-10 ksd-mt-10 ksd-mrl-20">
- <el-button type="primary" size="medium" v-if="groupActions.includes('addGroup')" :disabled="!isTestingSecurityProfile" icon="el-ksd-icon-add_22" @click="editGroup('new')">{{$t('kylinLang.common.new')}}</el-button>
+ <el-button type="primary" size="medium" v-if="groupActions.includes('addGroup')&&isTestingSecurityProfile" icon="el-ksd-icon-add_22" @click="editGroup('new')">{{$t('kylinLang.common.new')}}</el-button>
<div style="width:240px;" class="ksd-fright">
<el-input class="show-search-btn"
size="medium"
@@ -14,7 +14,7 @@
</el-input>
</div>
</el-row>
- <el-alert class="ksd-mb-16 ksd-ml-20" type="info"
+ <el-alert class="ksd-mb-16 ksd-ml-20" type="tip" show-icon
v-if="!isTestingSecurityProfile"
:title="$t('securityProfileTip')"
:closable="false">
@@ -42,14 +42,14 @@
{{scope.row.users && scope.row.users.length || 0}}
</template>
</el-table-column>
- <el-table-column v-if="groupActions.includes('editGroup') && groupActions.includes('deleteGroup')"
+ <el-table-column v-if="(groupActions.includes('editGroup') || groupActions.includes('deleteGroup')) && isTestingSecurityProfile"
:label="$t('kylinLang.common.action')" :width="83">
<template slot-scope="scope">
<el-tooltip :content="$t('assignUsers')" effect="dark" placement="top" v-show="scope.row.group_name!=='ALL_USERS' && groupActions.includes('editGroup')">
- <i class="el-icon-ksd-table_assign ksd-fs-14 ksd-mr-10" :class="{'is-disabled': !isTestingSecurityProfile}" @click="editGroup('assign', scope.row)"></i>
+ <i class="el-icon-ksd-table_assign ksd-fs-14 ksd-mr-10" @click="editGroup('assign', scope.row)"></i>
</el-tooltip><span>
</span><el-tooltip :content="$t('kylinLang.common.drop')" effect="dark" placement="top" v-show="(scope.row.group_name!=='ROLE_ADMIN' && scope.row.group_name!=='ALL_USERS') && groupActions.includes('deleteGroup')">
- <i class="el-icon-ksd-table_delete ksd-fs-14" :class="{'is-disabled': !isTestingSecurityProfile}" @click="dropGroup(scope.row)"></i>
+ <i class="el-icon-ksd-table_delete ksd-fs-14" @click="dropGroup(scope.row)"></i>
</el-tooltip>
</template>
</el-table-column>
diff --git a/kystudio/src/components/admin/Group/locales.js b/kystudio/src/components/admin/Group/locales.js
index de90c7ab04..a89d660496 100644
--- a/kystudio/src/components/admin/Group/locales.js
+++ b/kystudio/src/components/admin/Group/locales.js
@@ -10,6 +10,6 @@ export default {
userGroupsList: 'User Group',
groupFilter: 'Search by user group name',
userGroup: 'User Group',
- securityProfileTip: 'The current mode doesn\'t allow managing users/user groups, including operations such as creating, editing, deleting, assigning, and changing passwords.'
+ securityProfileTip: 'The current user/user group is managed using an external system as this page is read-only. Please go to the relevant management system if you need to edit it.'
}
}
diff --git a/kystudio/src/components/admin/User/index.vue b/kystudio/src/components/admin/User/index.vue
index 2e9923d28e..b8f7a27d2b 100644
--- a/kystudio/src/components/admin/User/index.vue
+++ b/kystudio/src/components/admin/User/index.vue
@@ -32,7 +32,7 @@
</el-col>
</el-row>
- <el-alert class="ksd-mb-16" type="info"
+ <el-alert class="ksd-mb-16" type="tip" show-icon
v-if="!isTestingSecurityProfile"
:title="$t('securityProfileTip')"
:closable="false">
diff --git a/kystudio/src/components/admin/User/locales.js b/kystudio/src/components/admin/User/locales.js
index 7d4eff330a..3363cd3587 100644
--- a/kystudio/src/components/admin/User/locales.js
+++ b/kystudio/src/components/admin/User/locales.js
@@ -3,7 +3,7 @@ export default {
back: 'Back',
user: 'User',
userName: 'Search by username',
- securityProfileTip: 'The current mode doesn\'t allow managing users/user groups, including operations such as adding, editing, deleting, assigning, and changing passwords.',
+ securityProfileTip: 'The current user/user group is managed using an external system as this page is read-only. Please go to the relevant management system if you need to edit it.',
admin: 'System Admin',
status: 'Status',
action: 'Actions',
[kylin] 13/13: KYLIN-5666 add tip when add base index
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 871fafaedc14346b6ba4e2516943b658464c4fc1
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Jul 21 11:09:16 2023 +0800
KYLIN-5666 add tip when add base index
---
.../studio/StudioModel/ModelList/ModelAggregate/index.vue | 10 +++++++++-
.../studio/StudioModel/ModelList/ModelAggregate/locales.js | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
index c8389b2a8b..6f4e55eaf1 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
@@ -43,7 +43,7 @@
<span :title="Object.keys(indexStat).length && !indexStat.need_create_base_agg_index ? $t('unCreateBaseAggIndexTip') : ''" @click="createBaseIndex('BASE_AGG_INDEX')">{{$t('BASE_AGG_INDEX')}}</span>
</el-dropdown-item>
<el-dropdown-item :class="{'action-disabled': Object.keys(indexStat).length && !indexStat.need_create_base_table_index}" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'">
- <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_table_index ? $t('unCreateBaseTableIndexTip') : ''" @click="createBaseIndex('BASE_TABLE_INDEX')">{{$t('BASE_TABLE_INDEX')}}</span>
+ <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_table_index ? showBaseAggIndexTip : ''" @click="createBaseIndex('BASE_TABLE_INDEX')">{{$t('BASE_TABLE_INDEX')}}</span>
</el-dropdown-item>
<el-dropdown-item class="dropdown-group-title" divided v-if="isShowEditAgg || (isShowTableIndexActions&&!isHideEdit)">
<span>{{$t('custom')}}</span>
@@ -422,6 +422,14 @@ export default class ModelAggregate extends Vue {
this.checkedList = val
}
+ get showBaseAggIndexTip () {
+ if (this.model?.simplified_dimensions?.length > 0) {
+ return this.$t('unCreateBaseTableIndexTip')
+ } else {
+ return this.$t('unCreateBaseAggIndexNoDimensionTip')
+ }
+ }
+
get isDisableDelBaseIndex () {
let isHaveBaseTableIndex = false
for (let i = 0; i < this.checkedList.length; i++) {
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
index 545f76e14b..e6c15b6352 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
@@ -85,6 +85,6 @@ export default {
disabledDelBaseIndexTips: 'To delete the base table index, please turn off tiered storage for the model.',
refuseAddIndexTip: 'Can\'t add streaming indexes. Please stop the streaming job and then delete all the streaming segments.',
refuseRemoveIndexTip: 'Can\'t delete streaming indexes. Please stop the streaming job and then delete all the streaming segments.',
- disabledBuildIndexTips: 'disabledBuildIndexTips'
+ unCreateBaseAggIndexNoDimensionTip: 'Can\'t add the base table index, as there are no dimensions in the model. Please add and try again.'
}
}
[kylin] 11/13: KYLIN-5664 no dim and meas index base type 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 0d942d51560877870aa7ac0b6da576cd11d93b90
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Jul 21 10:56:12 2023 +0800
KYLIN-5664 no dim and meas index base type issue
---
.../studio/StudioModel/ModelList/ModelSaveConfig/index.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index 632208af2c..13839e9a1c 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -169,7 +169,7 @@
</el-form-item>
</el-form>
<template v-if="mode === 'saveModel'">
- <div v-if="modelInstance && modelInstance.status !== 'BROKEN' && !isStreamModel && !this.isHaveNoDimMeas && !modelDesc.with_second_storage && !(modelInstance.has_base_table_index && modelInstance.has_base_agg_index)">
+ <div v-if="modelInstance && modelInstance.status !== 'BROKEN' && !isStreamModel && !isHaveNoDimMeas && !modelDesc.with_second_storage && !(modelInstance.has_base_table_index && modelInstance.has_base_agg_index)">
<div class="divide-block">
<div class="divider">
<span>{{$t('indexSetting')}}</span>
@@ -607,7 +607,7 @@ export default class ModelPartitionModal extends Vue {
const partition_desc = this.modelDesc.partition_desc
this.isExpand = !this.modelDesc.uuid && !this.isNotBatchModel
// 新建模型是,默认添加基础索引。编辑时已添加基础索引不显示,未添加索引是未勾选状态,用户可选择勾选
- if (!this.modelDesc.uuid) {
+ if (!this.modelDesc.uuid && !this.isHaveNoDimMeas && !this.modelDesc.with_second_storage) { // 新建模型&非无维度度量模型&非开启分层存储模型默认勾选基础索引
this.source_types = ['BASE_TABLE_INDEX', 'BASE_AGG_INDEX']
}
if (this.modelDesc.uuid && !(partition_desc && partition_desc.partition_date_column) && !this.isNotBatchModel) {
@@ -826,7 +826,7 @@ export default class ModelPartitionModal extends Vue {
isSubmit: isSubmit,
isPurgeSegment: this.isChangePartition,
data: temp,
- base_index_type: this.source_types
+ base_index_type: this.modelDesc.with_second_storage ? [] : this.source_types
})
this.hideModal()
this.resetModalForm()
[kylin] 07/13: KYLIN-5660 base indexes 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 e717b82b67397ed9cea70a000e4b1573848d6546
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 16:40:12 2023 +0800
KYLIN-5660 base indexes issue
---
.../studio/StudioModel/ModelEdit/index.vue | 4 +-
.../StudioModel/ModelList/ModelAggregate/index.vue | 107 ++++-----
.../ModelList/ModelAggregate/locales.js | 6 +-
.../ModelList/ModelLayout/modelLayout.vue | 1 -
.../ModelList/ModelSaveConfig/index.vue | 238 +++++++++++----------
.../ModelList/ModelSaveConfig/locales.js | 13 +-
.../studio/StudioModel/TableIndexEdit/store.js | 1 -
.../StudioModel/TableIndexEdit/tableindex_edit.vue | 3 +-
8 files changed, 178 insertions(+), 195 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
index 8382f1ebad..8b9a9a4919 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/index.vue
@@ -2046,7 +2046,7 @@ export default class ModelEdit extends Vue {
this.isPurgeSegment = res.isPurgeSegment // 修改分区列会清空所有segment,该字段引导用户去添加segment
}
if (res.isSubmit) {
- this.handleSaveModel({data, modelSaveConfigData: res.data, createBaseIndex: this.modelInstance.has_base_table_index && this.modelInstance.has_base_agg_index ? false : res.with_base_index})
+ this.handleSaveModel({data, modelSaveConfigData: res.data, createBaseIndex: res.base_index_type})
} else {
this.saveBtnLoading = false
}
@@ -2326,7 +2326,7 @@ export default class ModelEdit extends Vue {
}
handleSaveModel ({data, modelSaveConfigData, createBaseIndex}) {
this.saveModelType = 'saveModel'
- let para = {...data, with_base_index: createBaseIndex}
+ let para = {...data, base_index_type: createBaseIndex}
if (data.uuid) {
this.saveModelType = 'updataModel'
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
index bcc4f70f4a..98f3faa97c 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
@@ -1,12 +1,6 @@
<template>
<div class="model-aggregate ksd-mb-15" v-if="model" v-loading="isLoading">
<div class="aggregate-view">
- <div class="btn-groups" v-if="showModelTypeSwitch">
- <el-tabs class="btn-group-tabs" v-model="switchModelType" type="button" @tab-click="changeModelTab">
- <el-tab-pane :label="$t('kylinLang.common.BATCH')" name="BATCH" />
- <el-tab-pane :label="$t('kylinLang.common.STREAMING')" name="STREAMING" />
- </el-tabs>
- </div>
<div class="index-group">
<el-card class="agg-detail-card agg-detail">
<div class="detail-content" v-loading="indexLoading">
@@ -24,9 +18,9 @@
</div>
</el-popover>
<div class="date-range ksd-mb-16 ksd-fs-12 ksd-fleft">
- {{$t('dataRange')}}: {{getDataRange}}<span class="data-range-tips"><i v-if="!isRealTimeMode" v-popover:indexPopover class="el-icon-ksd-info ksd-fs-12 ksd-ml-8"></i></span>
+ {{$t('dataRange')}}: {{getDataRange}}<span class="data-range-tips"><i v-popover:indexPopover class="el-icon-ksd-info ksd-fs-12 ksd-ml-8"></i></span>
</div>
- <div v-if="isShowAggregateAction && isHaveComplementSegs && !isRealTimeMode" @click="complementedIndexes('allIndexes')" class="text-btn-like ksd-fleft ksd-ml-6">
+ <div v-if="isShowAggregateAction && isHaveComplementSegs" @click="complementedIndexes('allIndexes')" class="text-btn-like ksd-fleft ksd-ml-6">
<el-tooltip :content="$t('viewIncomplete')" effect="dark" placement="top">
<i class="el-ksd-icon-view_range_22"></i>
</el-tooltip>
@@ -39,10 +33,21 @@
</div>
</div>
<div class="clearfix" v-if="isShowAggregateAction">
- <el-alert class="ksd-mb-8" :title="$t('realTimeModelActionTips')" type="tip" show-icon v-if="isRealTimeMode&&isShowRealTimeModelActionTips" @close="isShowRealTimeModelActionTips = false" />
<el-dropdown style="margin-left:-14px !important;" class="ksd-ml-5 ksd-fleft" v-if="isShowAggregateAction && isShowIndexActions && !indexLoading">
<el-button icon="el-ksd-icon-add_22" type="primary" text>{{$t('index')}}</el-button>
<el-dropdown-menu slot="dropdown">
+ <el-dropdown-item class="dropdown-group-title" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'">
+ <span>{{$t('base')}}</span>
+ </el-dropdown-item>
+ <el-dropdown-item :class="{'action-disabled': Object.keys(indexStat).length && !indexStat.need_create_base_agg_index}" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'">
+ <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_agg_index ? $t('unCreateBaseAggIndexTip') : ''" @click="createBaseIndex('BASE_AGG_INDEX')">{{$t('BASE_AGG_INDEX')}}</span>
+ </el-dropdown-item>
+ <el-dropdown-item :class="{'action-disabled': Object.keys(indexStat).length && !indexStat.need_create_base_table_index}" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'">
+ <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_table_index ? $t('unCreateBaseTableIndexTip') : ''" @click="createBaseIndex('BASE_TABLE_INDEX')">{{$t('BASE_TABLE_INDEX')}}</span>
+ </el-dropdown-item>
+ <el-dropdown-item class="dropdown-group-title" divided v-if="isShowEditAgg || (isShowTableIndexActions&&!isHideEdit)">
+ <span>{{$t('custom')}}</span>
+ </el-dropdown-item>
<el-dropdown-item :class="{'action-disabled': !indexUpdateEnabled && model.model_type === 'STREAMING'}" @click.native="handleAggregateGroup" v-if="isShowEditAgg">
<el-tooltip :content="$t('refuseAddIndexTip')" effect="dark" placement="top" :disabled="indexUpdateEnabled || model.model_type !== 'STREAMING'">
<span>{{$t('aggregateGroup')}}</span>
@@ -53,21 +58,10 @@
<span>{{$t('tableIndex')}}</span>
</el-tooltip>
</el-dropdown-item>
- <el-dropdown-item :class="{'action-disabled': Object.keys(indexStat).length && !indexStat.need_create_base_agg_index && !indexStat.need_create_base_table_index}" v-if="model.model_type === 'HYBRID' ? switchModelType !== 'STREAMING' : model.model_type !== 'STREAMING'">
- <span :title="Object.keys(indexStat).length && !indexStat.need_create_base_agg_index && !indexStat.need_create_base_table_index ? $t('unCreateBaseIndexTip') : ''" @click="createBaseIndex">{{$t('baseIndex')}}</span>
- </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
- <el-button icon="el-ksd-icon-build_index_22" :disabled="!checkedList.length || isHaveLockedIndex" text type="primary" class="ksd-ml-2 ksd-fleft" v-if="datasourceActions.includes('buildIndex') && !isRealTimeMode" @click="complementedIndexes('batchIndexes')">{{$t('buildIndex')}}</el-button>
- <template v-if="isRealTimeMode">
- <el-tooltip placement="top" :content="!indexUpdateEnabled ? $t('refuseRemoveIndexTip') : $t('disabledDelBaseIndexTips')" v-if="datasourceActions.includes('delAggIdx') && (isDisableDelBaseIndex || !indexUpdateEnabled)">
- <div class="ksd-fleft">
- <el-button v-if="datasourceActions.includes('delAggIdx') && (isDisableDelBaseIndex || !indexUpdateEnabled)" :disabled="isDisableDelBaseIndex || !indexUpdateEnabled" type="primary" icon="el-ksd-icon-table_delete_22" @click="removeIndexes" text>{{$t('kylinLang.common.delete')}}</el-button>
- </div>
- </el-tooltip>
- <el-button v-if="datasourceActions.includes('delAggIdx') && !isDisableDelBaseIndex && indexUpdateEnabled" :disabled="!checkedList.length" type="primary" icon="el-ksd-icon-table_delete_22" class="ksd-fleft" @click="removeIndexes" text>{{$t('kylinLang.common.delete')}}</el-button>
- </template>
- <template v-else>
+ <el-button icon="el-ksd-icon-build_index_22" :disabled="!checkedList.length || isHaveLockedIndex" text type="primary" class="ksd-ml-2 ksd-fleft" v-if="datasourceActions.includes('buildIndex')" @click="complementedIndexes('batchIndexes')">{{$t('buildIndex')}}</el-button>
+ <template>
<el-tooltip placement="top" :content="$t('disabledDelBaseIndexTips')" v-if="datasourceActions.includes('delAggIdx')&&isDisableDelBaseIndex">
<div class="ksd-fleft">
<el-dropdown
@@ -117,7 +111,7 @@
<div class="filter-tags-layout"><el-tag size="mini" closable v-for="(item, index) in filterTags" :key="index" @close="handleClose(item)">{{`${$t(item.source)}:${$t(item.label)}`}}</el-tag></div>
<span class="clear-all-filters" @click="clearAllTags">{{$t('clearAll')}}</span>
</div>
- <div class="index-table-list" :class="{'is-show-filter': filterTags.length, 'is-show-tips' :isRealTimeMode&&isShowRealTimeModelActionTips, 'is-show-tab-button': showModelTypeSwitch, 'is-show-tips--tab-button': isRealTimeMode&&isShowRealTimeModelActionTips&&showModelTypeSwitch}">
+ <div class="index-table-list" :class="{'is-show-filter': filterTags.length}">
<el-table
ref="indexesTable"
:data="indexDatas"
@@ -176,7 +170,7 @@
</el-table-column>
<el-table-column :label="$t('kylinLang.common.action')" fixed="right" width="83" v-if="isShowAggregateAction">
<template slot-scope="scope">
- <common-tip :content="$t('buildIndex')" :disabled="scope.row.status === 'LOCKED'" v-if="isShowAggregateAction&&datasourceActions.includes('buildIndex')&&!isRealTimeMode">
+ <common-tip :content="$t('buildIndex')" :disabled="scope.row.status === 'LOCKED'" v-if="isShowAggregateAction&&datasourceActions.includes('buildIndex')">
<i class="el-ksd-icon-build_index_22 ksd-ml-5" :class="{'is-disabled': scope.row.status === 'LOCKED'}" @click="complementedIndexes('', scope.row.id)"></i>
</common-tip>
<common-tip :content="$t('editIndex')" v-if="isShowAggregateAction&&datasourceActions.includes('editAggGroup')">
@@ -322,27 +316,12 @@ export default class ModelAggregate extends Vue {
filterTags = []
checkedList = []
removeLoading = false
- indexRangeMap = {
- BATCH: ['HYBRID', 'BATCH'],
- STREAMING: ['HYBRID', 'STREAMING']
- }
switchIndexValue = 'index'
switchModelType = 'BATCH' // 默认批数据 - BATCH, 流数据 - STREAMING
isHaveComplementSegs = false
indexesByQueryHistory = true // 是否获取查询相关的索引
- isShowRealTimeModelActionTips = true
indexStat = {}
- // 控制显示流数据,批数据选项
- get showModelTypeSwitch () {
- return this.model && this.model.model_type === 'HYBRID'
- }
-
- // 判断是否时流数据模式
- get isRealTimeMode () {
- return (this.showModelTypeSwitch && this.switchModelType === 'STREAMING') || (this.model.model_type === 'STREAMING')
- }
-
get modelId () {
if (this.model.model_type !== 'HYBRID') {
return this.model.uuid
@@ -351,23 +330,6 @@ export default class ModelAggregate extends Vue {
}
}
- // 标识是融合数据模型下的批数据模式
- get isHybridBatch () {
- return this.model.model_type === 'HYBRID' && this.switchModelType === 'BATCH'
- }
-
- async changeModelTab (name) {
- // 切换tab 时需要重刷列表
- this.filterArgs.page_offset = 0
- this.filterArgs.page_size = +localStorage.getItem(this.pageRefTags.indexPager) || pageCount
- this.filterArgs.key = ''
- this.indexLoading = true
- await this.freshIndexGraph()
- await this.loadAggIndices()
- this.getIndexInfo()
- this.indexLoading = false
- }
-
formatDataSize (dataSize) {
const [size = +size, ext] = this.$root.$options.filters.dataSize(dataSize).split(' ')
const intType = ['B', 'KB']
@@ -425,7 +387,6 @@ export default class ModelAggregate extends Vue {
indexes: indexes,
submitText: submitText,
isRemoveIndex: isRemoveIndex,
- isHybridBatch: this.isHybridBatch,
model: this.model
})
this.refreshIndexGraphAfterSubmitSetting()
@@ -531,11 +492,10 @@ export default class ModelAggregate extends Vue {
editTableIndex (indexDesc) {
const { projectName, model } = this
this.showTableIndexEditModal({
- isHybridBatch: this.isHybridBatch,
modelInstance: this.modelInstance,
tableIndexDesc: indexDesc || {name: 'TableIndex_1'},
indexUpdateEnabled: this.indexUpdateEnabled,
- indexType: this.showModelTypeSwitch ? this.switchModelType : '',
+ indexType: '',
projectName,
model
}).then((res) => {
@@ -735,11 +695,7 @@ export default class ModelAggregate extends Vue {
}
async loadAggIndices (ids) {
try {
- // this.indexLoading = true
const params = {}
- if (this.showModelTypeSwitch) {
- params.range = this.indexRangeMap[this.switchModelType]
- }
if (this.indexesByQueryHistory && !this.layoutId && !this.isShowAggregateAction) {
this.indexDatas = []
this.totalSize = 0
@@ -755,10 +711,8 @@ export default class ModelAggregate extends Vue {
this.indexDatas = data.value
this.totalSize = data.total_size
this.indexUpdateEnabled = data.index_update_enabled
- // this.indexLoading = false
} catch (e) {
handleError(e)
- // this.indexLoading = false
}
}
created () {
@@ -780,7 +734,7 @@ export default class ModelAggregate extends Vue {
async handleAggregateGroup () {
if (!this.indexUpdateEnabled && this.model.model_type === 'STREAMING') return
const { projectName, model } = this
- const { isSubmit } = await this.callAggregateModal({ editType: 'new', model, projectName, indexUpdateEnabled: this.indexUpdateEnabled, indexType: this.showModelTypeSwitch ? this.switchModelType : '' })
+ const { isSubmit } = await this.callAggregateModal({ editType: 'new', model, projectName, indexUpdateEnabled: this.indexUpdateEnabled, indexType: '' })
isSubmit && await this.refreshIndexGraphAfterSubmitSetting()
isSubmit && await this.$emit('refreshModel')
}
@@ -844,18 +798,16 @@ export default class ModelAggregate extends Vue {
}
// 创建 base index
- createBaseIndex () {
- if (Object.keys(this.indexStat).length && !this.indexStat.need_create_base_agg_index && !this.indexStat.need_create_base_table_index) return
+ createBaseIndex (type) {
+ if (Object.keys(this.indexStat).length && (!this.indexStat.need_create_base_agg_index && type === 'BASE_AGG_INDEX' || !this.indexStat.need_create_base_table_index && type === 'BASE_TABLE_INDEX')) return
this.loadBaseIndex({
model_id: this.modelId,
project: this.projectName,
load_data: false,
- source_type: ['BASE_TABLE_INDEX', 'BASE_AGG_INDEX']
+ source_types: [type]
}).then(async (res) => {
const result = await handleSuccessAsync(res)
const layoutIds = []
- // const baseAggIndexNum = result.agg_index ? result.agg_index.dimension_count + result.agg_index.measure_count : 0
- // const baseTableIndexNum = result.table_index ? result.table_index.dimension_count + result.table_index.measure_count : 0
result.base_agg_index && layoutIds.push(result.base_agg_index.layout_id)
result.base_table_index && layoutIds.push(result.base_table_index.layout_id)
this.$message({
@@ -1258,6 +1210,19 @@ export default class ModelAggregate extends Vue {
&.action-disabled {
color: @text-disabled-color;
cursor: not-allowed;
+ &:focus {
+ color: @text-disabled-color;
+ cursor: not-allowed;
+ }
+ }
+ &.dropdown-group-title {
+ font-size: 12px;
+ color: @text-disabled-color;
+ line-height: 30px;
+ cursor: default;
+ &:hover {
+ background-color: @fff !important;
+ }
}
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
index 078b753175..545f76e14b 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/locales.js
@@ -28,6 +28,8 @@ export default {
RECOMMENDED_TABLE_INDEX: 'Recommended Table Index',
BASE_AGG_INDEX: 'Base Aggregate Index',
BASE_TABLE_INDEX: 'Base Table Index',
+ custom: 'Customize',
+ base: 'Base',
customAggIndex: 'Custom Aggregate Group: ',
customTableIndex: 'Custom Table Index: ',
indexContentTips: '{dimensionNum} dimension(s), {measureNum} measure(s)',
@@ -76,11 +78,11 @@ export default {
cardinality: 'Cardinality',
cardinalityColumnTips: 'Total amount of unique data in this column. Could be gathered from sampling.',
baseIndex: 'Base Index',
- unCreateBaseIndexTip: 'Base Indexes have already been added',
+ unCreateBaseAggIndexTip: 'Base Aggregate Index have already been added',
+ unCreateBaseTableIndexTip: 'Base Table Index have already been added',
buildBaseIndexTip: 'Successfully added {baseIndexNum} base index(es). ',
updateBaseIndexTips: 'A base index would be added. The previous base index might be in "locked" state while still could answer queries. Are you sure you wan to update?',
disabledDelBaseIndexTips: 'To delete the base table index, please turn off tiered storage for the model.',
- realTimeModelActionTips: 'To build streaming index needs to start the streaming job on the Job page. To add/delete streaming indexes, follow the steps: stop the streaming job, delete all the streaming segments, add/delete streaming indexes, start the streaming job.',
refuseAddIndexTip: 'Can\'t add streaming indexes. Please stop the streaming job and then delete all the streaming segments.',
refuseRemoveIndexTip: 'Can\'t delete streaming indexes. Please stop the streaming job and then delete all the streaming segments.',
disabledBuildIndexTips: 'disabledBuildIndexTips'
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index 4bb9f838ed..a84af715b4 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -416,7 +416,6 @@ export default class ModelLayout extends Vue {
refrashWarningSegment: refrashWarningSegment,
indexes: [],
submitText: submitText,
- isHybridBatch: this.currentModelRow.model_type === 'HYBRID',
model: model
})
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index efc76eb115..6578697518 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -9,8 +9,7 @@
@close="isShow && handleClose(false)"
:close-on-press-escape="false"
:close-on-click-modal="false">
- <!-- <div class="ky-list-title" v-if="!(modelInstance && modelInstance.uuid) && partitionMeta.table && partitionMeta.column">{{$t('partitionSet')}}</div> -->
- <div class="partition-set ksd-mb-10" v-if="mode === 'saveModel'">
+ <div class="partition-set" v-if="mode === 'saveModel'">
<el-alert
:title="cannotSaveModelTips"
type="error"
@@ -27,22 +26,24 @@
v-if="isShowWarning"
show-icon>
</el-alert>
- <div class="ksd-title-label-mini">{{$t('chooseBuildType')}}</div>
- <el-select v-model="buildType" class="ksd-mtb-10" @change="handChangeBuildType" :disabled="!datasourceActions.includes('changeBuildType')" style="width:100%">
- <el-option :label="$t('incremental')" value="incremental"></el-option>
- <el-option v-if="!isNotBatchModel" :label="$t('fullLoad')" value="fullLoad"></el-option>
- </el-select>
- <el-alert
- class="ksd-pt-0"
- :title="buildTips"
- type="info"
- :show-background="false"
- :closable="false"
- show-icon>
- </el-alert>
+ <el-tabs v-model="buildType" class="buildType-switch" type="button" @tab-click="handChangeBuildType">
+ <el-tab-pane name="incremental" :disabled="!datasourceActions.includes('changeBuildType')">
+ <span slot="label">
+ <el-tooltip :content="$t('incrementalTips')" placement="top">
+ <span>{{$t('incremental')}}<el-tag class="ksd-ml-5" size="mini" type="success">{{$t('recommend')}}</el-tag></span>
+ </el-tooltip>
+ </span>
+ </el-tab-pane>
+ <el-tab-pane :disabled="isNotBatchModel || !datasourceActions.includes('changeBuildType')" name="fullLoad">
+ <span slot="label">
+ <el-tooltip :content="!isNotBatchModel&&datasourceActions.includes('changeBuildType') ? $t('fullLoadTips', {storageSize: dataSize(modelDesc.storage)}) : this.$t('isNotBatchModel')" placement="top">
+ <span>{{$t('fullLoad')}}</span>
+ </el-tooltip>
+ </span>
+ </el-tab-pane>
+ </el-tabs>
</div>
<el-form v-if="mode === 'saveModel'&&buildType=== 'incremental'" :model="partitionMeta" ref="partitionForm" :rules="partitionRules" label-width="85px" label-position="top">
- <div class="ksd-title-label-mini ksd-mb-10">{{$t('partitionSet')}}</div>
<!-- 新建流数据、融合数据模型时提示 -->
<el-alert
class="ksd-mb-8"
@@ -57,7 +58,6 @@
<el-col :span="24">
<el-tooltip effect="dark" :content="$t('disableChangePartitionTips')" :disabled="!(isNotBatchModel&&!!modelDesc.uuid&&isAlreadyHavePartition)" placement="bottom">
<el-select :disabled="isLoadingNewRange||(isNotBatchModel&&!!modelDesc.uuid&&isAlreadyHavePartition)" v-model="partitionMeta.table" @change="partitionTableChange" :placeholder="$t('kylinLang.common.pleaseSelectOrSearch')" style="width:100%">
- <!-- <el-option :label="$t('noPartition')" value=""></el-option> -->
<el-option :label="t.alias" :value="t.alias" v-for="t in partitionTables" :key="t.alias">{{t.alias}}</el-option>
</el-select>
</el-tooltip>
@@ -108,11 +108,7 @@
<el-option-group>
<el-option v-if="dateFormatsOptions.map(it => it.value).indexOf(prevPartitionMeta.format) === -1 && prevPartitionMeta.format" :label="prevPartitionMeta.format" :value="prevPartitionMeta.format"></el-option>
<el-option :label="f.label" :value="f.value" v-for="f in dateFormatsOptions" :key="f.label"></el-option>
- <!-- <el-option label="" value="" v-if="partitionMeta.column && timeDataType.indexOf(getColumnInfo(partitionMeta.column).datatype)===-1"></el-option> -->
</el-option-group>
- <!-- <el-option-group>
- <el-option :label="f.label" :value="f.value" v-for="f in dateTimestampFormats" :key="f.label"></el-option>
- </el-option-group> -->
</el-select>
</el-tooltip>
</el-col>
@@ -132,8 +128,8 @@
<div class="error-format" v-if="errorFormat">{{errorFormat}}</div>
<div class="pre-format" v-if="formatedDate">{{$t('previewFormat')}}{{formatedDate}}</div>
<div class="format">{{$t('formatRule')}}
- <span v-if="isExpandFormatRule" @click="isExpandFormatRule = false">{{$t('viewDetail')}}<i class="el-icon-ksd-more_01-copy arrow"></i></span>
- <span v-else @click="isExpandFormatRule = true">{{$t('viewDetail')}}<i class="el-icon-ksd-more_02 arrow"></i></span>
+ <span v-if="isExpandFormatRule" @click="isExpandFormatRule = false">{{$t('viewDetail')}}<i class="el-ksd-icon-arrow_up_16 arrow ksd-fs-16"></i></span>
+ <span v-else @click="isExpandFormatRule = true">{{$t('viewDetail')}}<i class="el-ksd-icon-arrow_down_16 arrow ksd-fs-16"></i></span>
</div>
<div class="detail-content" v-if="isExpandFormatRule">
<p><span class="ksd-mr-2">1. </span><span>{{$t('rule1')}}</span></p>
@@ -146,7 +142,7 @@
<span slot="label">
<span>{{$t('multilevelPartition')}}</span>
<el-tooltip effect="dark" :content="$t('multilevelPartitionDesc')" placement="right">
- <i class="el-icon-ksd-what"></i>
+ <i class="el-icon-ksd-what ksd-fs-14"></i>
</el-tooltip>
</span>
<el-row>
@@ -173,13 +169,37 @@
</el-form-item>
</el-form>
<template v-if="mode === 'saveModel'">
- <div class="divide-block">
- <div class="divider"></div>
- <span v-if="isExpand" @click="toggleShowPartition">{{$t('advanceSetting')}}<i class="el-ksd-icon-arrow_up_16 arrow ksd-fs-16"></i></span>
- <span v-else @click="toggleShowPartition">{{$t('advanceSetting')}}<i class="el-ksd-icon-arrow_down_16 arrow ksd-fs-16"></i></span>
+ <div v-if="modelInstance && modelInstance.status !== 'BROKEN' && !isStreamModel && !this.isHaveNoDimMeas && !modelDesc.with_second_storage && !(modelInstance.has_base_table_index && modelInstance.has_base_agg_index)">
+ <div class="divide-block">
+ <div class="divider">
+ <span>{{$t('indexSetting')}}</span>
+ </div>
+ </div>
+ <div class="base-index-block ksd-ptb-16">
+ <el-checkbox-group v-model="source_types">
+ <el-checkbox label="BASE_AGG_INDEX" size="small" v-if="!modelInstance.has_base_agg_index">
+ <span>{{$t('addBaseAggIndexCheckBox')}}</span>
+ <el-tooltip effect="dark" :content="$t('baseAggIndexTips')" placement="top">
+ <i class="el-icon-ksd-what ksd-fs-14"></i>
+ </el-tooltip>
+ </el-checkbox>
+ <el-checkbox size="small" label="BASE_TABLE_INDEX" :disabled="modelDesc.with_second_storage" v-if="!modelInstance.has_base_table_index">
+ <span>{{$t('addBaseTableIndexCheckBox')}}</span>
+ <el-tooltip effect="dark" :content="$t('baseTableIndexTips')" placement="top">
+ <i class="el-icon-ksd-what ksd-fs-14"></i>
+ </el-tooltip>
+ </el-checkbox>
+ </el-checkbox-group>
+ </div>
+ </div>
+ <div class="divide-block advance-setting">
+ <div class="divider">
+ <span v-if="isExpand" @click="toggleShowPartition">{{$t('advanceSetting')}}<i class="el-ksd-icon-arrow_up_16 arrow ksd-fs-16"></i></span>
+ <span v-else @click="toggleShowPartition">{{$t('advanceSetting')}}<i class="el-ksd-icon-arrow_down_16 arrow ksd-fs-16"></i></span>
+ </div>
</div>
<div v-show="isExpand">
- <div class="ksd-mb-24" v-if="$store.state.project.second_storage_enabled">
+ <div class="second-setting ksd-mb-16" v-if="$store.state.project.second_storage_enabled">
<el-alert v-if="modelDesc.with_second_storage" show-icon type="warning" class="ksd-mb-8" :closable="false">
<span v-html="$t('forbidenComputedColumnTips')" class="ksd-fs-12"></span>
</el-alert>
@@ -209,7 +229,13 @@
v-if="isShowSecStorageTips"
show-icon>
</el-alert>
- <span class="ksd-title-label-mini">{{$t('secStorage')}}</span>
+ <span class="ksd-title-label-mini">
+ <span>{{$t('secStorage')}}</span>
+ <el-tooltip effect="dark" placement="right">
+ <span slot="content" v-html="$t('secStorageDesc')"></span>
+ <i class="el-icon-ksd-what ksd-fs-14"></i>
+ </el-tooltip>
+ </span>
<span class="sec-switch">
<common-tip :content="disableSecStorageTips" :disabled="!isNotBatchModel && !isHaveNoDimMeas">
<el-switch
@@ -221,13 +247,11 @@
</el-switch>
</common-tip>
</span>
- <div class="secStorage-desc ksd-mt-8" v-html="$t('secStorageDesc')"></div>
</div>
- <!-- <div class="divider"></div> -->
- <div class="ksd-title-label-mini ksd-mb-8">
+ <div class="data-filter ksd-title-label-mini ksd-mb-8">
{{$t('dataFilterCond')}}
<el-tooltip effect="dark" :content="$t('dataFilterCondTips')" placement="right">
- <i class="el-ksd-icon-more_info_16 ksd-fs-16 ksd-mb-2"></i>
+ <i class="el-icon-ksd-what ksd-fs-14"></i>
</el-tooltip>
</div>
<el-alert
@@ -245,16 +269,8 @@
</div>
</template>
<div slot="footer" class="dialog-footer ky-no-br-space">
- <div class="ksd-fleft" style="display: flex;" v-if="modelInstance && modelInstance.status !== 'BROKEN' && !isStreamModel && !modelDesc.with_second_storage && !this.isHaveNoDimMeas && !(modelInstance.has_base_table_index && modelInstance.has_base_agg_index)">
- <el-checkbox v-model="addBaseIndex">
- <span>{{$t('addBaseIndexCheckBox')}}</span>
- </el-checkbox>
- <el-tooltip effect="dark" :content="$t('baseIndexTips')" placement="top">
- <i class="el-ksd-icon-more_info_22 ksd-fs-22"></i>
- </el-tooltip>
- </div>
<el-button size="medium" @click="isShow && handleClose(false)">{{$t('kylinLang.common.cancel')}}</el-button>
- <el-button type="primary" v-if="isShow" :disabled="isLoadingNewRange||disabledSave" :loading="isLoadingSave" @click="savePartitionConfirm" size="medium">{{$t('kylinLang.common.submit')}}</el-button>
+ <el-button type="primary" v-if="isShow" :disabled="isLoadingNewRange||disabledSave" :loading="isLoadingSave" @click="savePartitionConfirm" size="medium">{{mode === 'saveModel' ? $t('modelSaveSet') : $t('kylinLang.common.submit')}}</el-button>
</div>
</el-dialog>
</template>
@@ -269,7 +285,6 @@ import locales from './locales'
import store, { types } from './store'
import { timeDataType, dateFormats, timestampFormats, dateTimestampFormats } from '../../../../../config'
import NModel from '../../ModelEdit/model.js'
-// import { titleMaps, cancelMaps, confirmMaps, getSubmitData } from './handler'
import { objectClone, isSubPartitionType, indexOfObjWithSomeKey, isStreamingPartitionType } from '../../../../../util'
import { handleSuccess, transToUTCMs } from 'util/business'
import { handleSuccessAsync, handleError } from 'util/index'
@@ -292,12 +307,6 @@ vuex.registerModule(['modals', 'ModelSaveConfig'], store)
exchangeJoinTableList: state => state.form.exchangeJoinTableList,
callback: state => state.callback
}),
- // ...mapState('DimensionsModal', {
- // otherColumns: state => state.otherColumns
- // }),
- // ...mapState('BatchMeasureModal', {
- // otherMeasureColumns: state => state.otherColumns
- // }),
...mapState({
otherColumns: state => state.model.otherColumns
})
@@ -366,7 +375,7 @@ export default class ModelPartitionModal extends Vue {
importantChange = false
isExpand = false
defaultBuildType = 'incremental'
- addBaseIndex = false
+ source_types = []
isShowSecStorageTips = false
isShowSecStorageTips2 = false
isShowSecondStoragePartitionTips = false
@@ -399,19 +408,16 @@ export default class ModelPartitionModal extends Vue {
return true
}
}
- get buildTips () {
- if (this.buildType === 'incremental') {
- return this.$t('incrementalTips')
- } else if (this.buildType === 'fullLoad') {
- return this.$t('fullLoadTips', {storageSize: Vue.filter('dataSize')(this.modelDesc.storage)})
- }
- }
get factTableType () {
const obj = this.modelInstance.getFactTable()
return obj.source_type
}
+ dataSize (storage) {
+ return Vue.filter('dataSize')(storage)
+ }
+
handChangeBuildType (val) {
this.isShowWarning = typeof this.modelDesc.available_indexes_count === 'number' && this.modelDesc.available_indexes_count > 0 && (this.defaultBuildType !== this.buildType || this.isChangePartition)
if (val === 'incremental' && !this.partitionMeta.table) {
@@ -489,7 +495,7 @@ export default class ModelPartitionModal extends Vue {
}
get partitionTitle () {
if (this.mode === 'saveModel') {
- return this.$t('modelSaveSet')
+ return this.$t('saveModel')
} else {
return this.$t('modelPartitionSet')
}
@@ -505,13 +511,7 @@ export default class ModelPartitionModal extends Vue {
}
return result
}
- // get showDataRange () {
- // // 分区列有空值或者和历史值一样
- // if (!this.partitionMeta.table || !this.partitionMeta.column || this.partitionMeta.table + '.' + this.partitionMeta.column === this.modelInstance.his_partition_desc.partition_date_column) {
- // return false
- // }
- // return true
- // }
+
// 获取破损的partition keys
get brokenPartitionColumns () {
if (this.partitionMeta.table) {
@@ -606,7 +606,10 @@ export default class ModelPartitionModal extends Vue {
// })
const partition_desc = this.modelDesc.partition_desc
this.isExpand = !this.modelDesc.uuid && !this.isNotBatchModel
- this.addBaseIndex = this.modelInstance && !(this.isStreamModel || this.modelDesc.with_second_storage || this.isHaveNoDimMeas || (this.modelInstance.has_base_table_index && this.modelInstance.has_base_agg_index))
+ // 新建模型是,默认添加基础索引。编辑时已添加基础索引不显示,未添加索引是未勾选状态,用户可选择勾选
+ if (!this.modelDesc.uuid) {
+ this.source_types = ['BASE_TABLE_INDEX', 'BASE_AGG_INDEX']
+ }
if (this.modelDesc.uuid && !(partition_desc && partition_desc.partition_date_column) && !this.isNotBatchModel) {
this.buildType = 'fullLoad'
this.defaultBuildType = 'fullLoad'
@@ -643,12 +646,7 @@ export default class ModelPartitionModal extends Vue {
this.partitionMeta.column = ''
this.partitionMeta.format = ''
this.partitionMeta.multiPartition = ''
- // this.$refs.partitionForm.validate()
}
- // partitionColumnChange () {
- // this.partitionMeta.format = 'yyyy-MM-dd'
- // this.$refs.partitionForm.validate()
- // }
resetForm () {
this.partitionMeta = {
table: '',
@@ -698,14 +696,8 @@ export default class ModelPartitionModal extends Vue {
}
let isOnlySave = true
if (typeof this.modelDesc.available_indexes_count === 'number' && this.modelDesc.available_indexes_count > 0) {
- // if (this.prevPartitionMeta.table && this.buildType === 'fullLoad') {
- // await kylinConfirm(this.$t('changeSegmentTip2', {modelName: this.modelDesc.name}), '', this.$t('kylinLang.common.tip'))
- // } else if ((this.prevPartitionMeta.table !== this.partitionMeta.table || this.prevPartitionMeta.column !== this.partitionMeta.column || this.prevPartitionMeta.format !== this.partitionMeta.format) && this.buildType === 'incremental') {
- // await kylinConfirm(this.$t('changeSegmentTip1', {tableColumn: `${this.partitionMeta.table}.${this.partitionMeta.column}`, dateType: this.partitionMeta.format, modelName: this.modelDesc.name}), '', this.$t('kylinLang.common.tip'))
- // }
if (this.isChangeToFullLoad || this.isChangePartition) {
this.importantChange = true
- // await kylinConfirm(this.$t('changeSegmentTips'), {confirmButtonText: this.$t('kylinLang.common.save'), type: 'warning', dangerouslyUseHTMLString: true}, this.$t('kylinLang.common.tip'))
const res = await this.callGlobalDetailDialog({
msg: this.$t('changeSegmentTips'),
title: this.$t('kylinLang.common.tip'),
@@ -786,13 +778,9 @@ export default class ModelPartitionModal extends Vue {
if (!(checkData && checkData.partition_desc && checkData.partition_desc.partition_date_column) || this.buildType === 'fullLoad') {
checkData.partition_desc = null
}
- // if (this.isHybridModel) {
- // checkData.batch_partition_desc = checkData.partition_desc
- // }
this.checkFilterConditon(checkData).then((res) => {
handleSuccess(res, async (data) => {
// TODO HA 模式时 post 等接口需要等待同步完去刷新列表
- // await handleWaiting()
if (!this.importantChange && 'rebuild_index' in data && data.rebuild_index) {
try {
const res = await this.callGlobalDetailDialog({
@@ -833,15 +821,12 @@ export default class ModelPartitionModal extends Vue {
this.filterErrorMsg = ''
// 不把这个信息记录下来的话,300 延迟后,modelDesc 就 undefined 了
let temp = objectClone(this.modelDesc)
- // if (this.isHybridModel) {
- // temp.batch_partition_desc = temp.partition_desc
- // }
setTimeout(() => {
this.callback && this.callback({
isSubmit: isSubmit,
isPurgeSegment: this.isChangePartition,
data: temp,
- with_base_index: this.modelDesc.with_second_storage ? false : this.addBaseIndex
+ base_index_type: this.source_types
})
this.hideModal()
this.resetModalForm()
@@ -894,9 +879,34 @@ export default class ModelPartitionModal extends Vue {
}
</script>
-<style lang="less" scoped>
+<style lang="less">
@import '../../../../../assets/styles/variables.less';
.model-partition-dialog {
+ .buildType-switch {
+ .el-tabs__header {
+ width: 100%;
+ .el-tabs__nav {
+ width: 97.8%;
+ .el-tabs__item {
+ width: 50%;
+ .el-tag {
+ position: relative;
+ bottom: 1px;
+ }
+ }
+ }
+ }
+ }
+ .el-tabs__item.is-disabled {
+ cursor: not-allowed;
+ }
+ .second-setting,
+ .data-filter {
+ .el-icon-ksd-what {
+ position: relative;
+ top: 1px;
+ }
+ }
.error-format {
color: @error-color-1;
font-size: 12px;
@@ -906,7 +916,9 @@ export default class ModelPartitionModal extends Vue {
color: @text-normal-color;
font-size: 14px;
margin-top: 4px;
- background-color: @base-background-color;
+ background-color: @ke-background-color-secondary;
+ border: 1px solid @ke-border-divider-color;
+ border-radius: 6px;
height: 26px;
line-height: 26px;
border-radius: 4px;
@@ -922,13 +934,14 @@ export default class ModelPartitionModal extends Vue {
color: @base-color;
cursor: pointer;
.arrow {
- transform: rotate( 90deg );
margin-left: 3px;
}
}
}
.detail-content {
- background-color: @base-background-color-1;
+ background-color: @ke-background-color-secondary;
+ border: 1px solid @ke-border-divider-color;
+ border-radius: 6px;
padding: 8px 16px;
box-sizing: border-box;
font-size: 12px;
@@ -954,26 +967,37 @@ export default class ModelPartitionModal extends Vue {
color: @error-color-1;
}
}
+ .base-index-block {
+ .el-icon-ksd-what {
+ position: relative;
+ top: 1px;
+ }
+ }
.divide-block {
- color: @text-title-color;
+ color: @text-placeholder-color;
position: relative;
text-align: center;
- margin-top: 5px;
+ margin-top: 16px;
font-size: 12px;
span {
- cursor: pointer;
+ cursor: default;
+ position: absolute;
+ display: inline-block;
+ top: -8px;
+ background-color: #fff;
+ padding: 0 10px;
+ left: 44%;
}
- // .arrow {
- // transform: rotate(90deg);
- // margin-left: 3px;
- // font-size: 5px;
- // color: @base-color;
- // position: absolute;
- // top: 15px;
- // }
.divider {
margin: 10px 0;
- border-bottom: 1px solid @ke-color-secondary;
+ border-bottom: 1px solid @ke-border-secondary;
+ position: relative;
+ }
+ &.advance-setting {
+ color: @ke-color-primary;
+ span {
+ cursor: pointer;
+ }
}
}
.item-desc {
@@ -983,16 +1007,6 @@ export default class ModelPartitionModal extends Vue {
.where-area {
margin-top:20px;
}
- // .error-msg {display:none}
- // .is-broken {
- // .el-input__inner{
- // border:solid 1px @color-danger;
- // }
- // .error-msg {
- // color:@color-danger;
- // display:block;
- // }
- // }
.up-performance{
i {
color:@normal-color-1;
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
index 2f99512b21..9b735733f8 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
@@ -33,7 +33,9 @@ export default {
chooseBuildType: 'Please select a load method',
incremental: 'Incremental Load',
fullLoad: 'Full Load',
- incrementalTips: 'The system could incrementally load data based on the selected partition column.',
+ recommend: 'Recommend',
+ isNotBatchModel: 'Can’t load the stream model in full.',
+ incrementalTips: 'It will load data incrementally based on the selected partition column, which is more resource-efficient.',
fullLoadTips: 'The system will load all data.',
changeBuildTypeTips: '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.',
editCCBuildTip: 'The modified expression of computed column would be effective until all the related indexes have been built. Do you want to save and build index now? ',
@@ -45,10 +47,12 @@ export default {
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. ',
+ indexSetting: 'Index Setting',
advanceSetting: 'Advanced Setting',
- addBaseIndexCheckBox: 'Add Base Indexes',
+ addBaseAggIndexCheckBox: 'Base Aggregate Index',
+ addBaseTableIndexCheckBox: 'Base Table Index',
secStorage: 'Tiered Storage',
- secStorageDesc: 'With this switch ON, the system will create a base table index, which will be sync to the tiered storage. It will improve the performance of ad-hoc query and detail query analysis scenarios.<br/>The index can\'t be deleted when the tiered storage is ON.',
+ secStorageDesc: 'Tiered storage can significantly improve the performance of flexible ultra-multidimensional analysis and detailed queries. It will add base table index by default and cannot be deleted for synchronizing data when open.',
secStorageTips: 'With this switch OFF, the model\'s tiered storage data will be cleared。',
openSecStorageTips: 'It\'s recommended to turn on the tiered storage, as too many dimensions are included.',
openSecStorageTips2: 'With the tiered storage ON, the existing data needs to be loaded to tiered storage to take effect.',
@@ -57,7 +61,8 @@ export default {
forbidenComputedColumnTips: 'The parquet files containing data prior to 1970 cannot be loaded. <a class="ky-a-like" href="https://docs.kyligence.io/books/v4.5/en/Designers-Guide/tiered_storage/" target="_blank">View the manual <i class="el-ksd-icon-spark_link_16"></i></a>',
secondStoragePartitionTips: 'Can\'t save the model. When the model uses incremental load method and the tiered storage is ON, the time partition column must be added as a dimension.',
streamSecStoragePartitionTips: 'Can\'t save the model. For fusion model, the time partition column must be added as a dimension.',
- baseIndexTips: 'Base indexes include all dimensions and measures of the model and automatically update as the model changes by default.',
+ baseAggIndexTips: 'The base aggregate index contains all dimensions and metrics of the model, and can override answering aggregated queries to avoid pushdown. It will automatically update as the model changes by default.',
+ baseTableIndexTips: 'The base table index contains all the columns used in the dimensions and metrics of the model, and can override answering detailed queries to avoid pushdown. It will automatically update as the model changes by default.',
notBatchModelPartitionTips: 'The time partition settings can\'t be modified after the fusion model or streaming model is saved.',
disableChangePartitionTips: 'The time partition settings can\'t be modified for fusion model and streaming model.',
previewFormat: 'Format preview: ',
diff --git a/kystudio/src/components/studio/StudioModel/TableIndexEdit/store.js b/kystudio/src/components/studio/StudioModel/TableIndexEdit/store.js
index bedfe56a6f..82e955b2d0 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndexEdit/store.js
+++ b/kystudio/src/components/studio/StudioModel/TableIndexEdit/store.js
@@ -12,7 +12,6 @@ const initialState = JSON.stringify({
isShow: false,
form: {
data: {
- isHybridBatch: false,
modelInstance: null,
tableIndexDesc: null,
indexUpdateEnabled: true
diff --git a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
index e035e29a77..fa222db8f1 100644
--- a/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
+++ b/kystudio/src/components/studio/StudioModel/TableIndexEdit/tableindex_edit.vue
@@ -104,7 +104,6 @@
]),
...mapState('TableIndexEditModal', {
isShow: state => state.isShow,
- isHybridBatch: state => state.isHybridBatch,
modelInstance: state => state.form.data.modelInstance,
tableIndexDesc: state => objectClone(state.form.data.tableIndexDesc),
indexUpdateEnabled: state => state.form.data.indexUpdateEnabled,
@@ -403,7 +402,7 @@
}
})
this.tableIndexMeta.project = this.currentSelectedProject
- this.tableIndexMeta.model_id = this.isHybridBatch ? this.modelInstance.batch_id : this.modelInstance.uuid
+ this.tableIndexMeta.model_id = this.modelInstance.uuid
'name' in this.tableIndexMeta && delete this.tableIndexMeta.name
if (this.tableIndexMeta.id) {
this.editTableIndex({...this.tableIndexMeta, index_range: this.tableIndexMeta.index_range || 'EMPTY'}).then(successCb, errorCb)
[kylin] 09/13: KYLIN-5662 model list lite 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 9c8496563b7c66820c3cdb59fd7d69915027d40f
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 18:25:59 2023 +0800
KYLIN-5662 model list lite issue
---
.../common/ModelERDiagram/ModelERDiagram.vue | 18 +++---
kystudio/src/components/query/query_result.vue | 6 --
.../ModelList/ModelActions/modelActions.vue | 17 +++++-
.../ModelList/ModelBuildModal/build.vue | 2 +-
.../ModelList/ModelLayout/modelLayout.vue | 29 +++-------
.../StudioModel/ModelList/ModelPartition/index.vue | 2 +-
.../studio/StudioModel/ModelList/index.vue | 66 +++++++++-------------
7 files changed, 62 insertions(+), 78 deletions(-)
diff --git a/kystudio/src/components/common/ModelERDiagram/ModelERDiagram.vue b/kystudio/src/components/common/ModelERDiagram/ModelERDiagram.vue
index 4c945b356c..f978fa52d9 100644
--- a/kystudio/src/components/common/ModelERDiagram/ModelERDiagram.vue
+++ b/kystudio/src/components/common/ModelERDiagram/ModelERDiagram.vue
@@ -45,7 +45,7 @@
<script>
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
-import { handleSuccessAsync, objectClone } from 'util'
+import { handleSuccessAsync, objectClone, dataGenerator } from 'util'
import { columnTypeIcon } from '../../../config'
import { mapActions, mapGetters, mapState, mapMutations } from 'vuex'
import { initPlumb, drawLines, customCanvasPosition, createAndUpdateSvgGroup } from './handler'
@@ -78,13 +78,14 @@ import locales from './locales'
modelList: state => state.model.modelsList
}),
...mapGetters([
- 'currentProjectData',
+ 'currentSelectedProject',
'isFullScreen'
])
},
methods: {
...mapActions({
- loadColumnOfModel: 'LOAD_DATASOURCE_OF_MODEL'
+ loadColumnOfModel: 'LOAD_DATASOURCE_OF_MODEL',
+ getModelByModelName: 'LOAD_MODEL_INFO'
}),
...mapMutations({
toggleFullScreen: 'TOGGLE_SCREEN'
@@ -97,6 +98,7 @@ import locales from './locales'
})
export default class ModelERDiagram extends Vue {
currentModel = null
+ modelData = null
columnTypeIconMap = columnTypeIcon
plumbTool = null
plumbInstance = null
@@ -137,6 +139,9 @@ export default class ModelERDiagram extends Vue {
}
async created () {
this.loadingER = true
+ const res = await this.getModelByModelName({model_name: this.model.alias, project: this.currentSelectedProject})
+ const { value } = await handleSuccessAsync(res)
+ this.modelData = dataGenerator.generateModel(value[0])
await this.getTableColumns()
this.$nextTick(() => {
const { plumbInstance, plumbTool } = initPlumb(this.$el.querySelector('.er-layout'), this.currentModel.canvas ?? this.defaultZoom)
@@ -180,13 +185,12 @@ export default class ModelERDiagram extends Vue {
}
getTableColumns () {
return new Promise((resolve, reject) => {
- const { name } = this.currentProjectData
const [{ canvas }] = this.modelList.filter(item => item.alias === this.model.name)
- this.loadColumnOfModel({project: name, model_name: this.model.name}).then(async (result) => {
+ this.loadColumnOfModel({project: this.currentSelectedProject, model_name: this.model.name}).then(async (result) => {
const values = await handleSuccessAsync(result)
this.currentModel = {
- ...this.model,
- tables: this.model.tables.map(table => {
+ ...this.modelData,
+ tables: this.modelData.tables.map(table => {
const [{ columns }] = values.filter(v => table.name === `${v.database}.${v.name}`)
return {
...table,
diff --git a/kystudio/src/components/query/query_result.vue b/kystudio/src/components/query/query_result.vue
index c091bb7445..0217620557 100644
--- a/kystudio/src/components/query/query_result.vue
+++ b/kystudio/src/components/query/query_result.vue
@@ -200,8 +200,6 @@ import { scToFloat, showNull, handleSuccessAsync } from '../../util/index'
import { hasRole, transToGmtTime, handleError } from '../../util/business'
import { pageRefTags, pageCount } from 'config'
import { getOptions, compareDataSize } from './handler'
-import IndexDetails from '../studio/StudioModel/ModelList/ModelAggregate/indexDetails'
-import ModelAggregate from '../studio/StudioModel/ModelList/ModelAggregate/index.vue'
import echarts from 'echarts'
@Component({
props: ['extraoption', 'isWorkspace', 'queryExportData', 'isStop', 'tabsItem'],
@@ -223,10 +221,6 @@ import echarts from 'echarts'
'datasourceActions'
])
},
- components: {
- IndexDetails,
- ModelAggregate
- },
locales: {
'en': {
username: 'Username',
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelActions/modelActions.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelActions/modelActions.vue
index db0ff9c2f4..9541ecb172 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelActions/modelActions.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelActions/modelActions.vue
@@ -272,7 +272,8 @@ import locales from './locales'
disableModel: 'DISABLE_MODEL',
enableModel: 'ENABLE_MODEL',
delModel: 'DELETE_MODEL',
- exportValidation: 'VALIDATE_EXPORT_TDS'
+ exportValidation: 'VALIDATE_EXPORT_TDS',
+ loadDataSourceByModel: 'LOAD_DATASOURCE_OF_MODEL'
}),
...mapActions('DetailDialogModal', {
callGlobalDetailDialog: 'CALL_MODAL'
@@ -425,9 +426,19 @@ export default class ModelActions extends Vue {
if (!(modelDesc.partition_desc && modelDesc.partition_desc.partition_date_column)) {
type = 'fullLoad'
}
+ let modelInfo = objectClone(modelDesc)
+ if (!modelDesc.simplified_tables) {
+ const result = await this.loadDataSourceByModel({ project: projectName, model_name: modelDesc.alias })
+ const datasource = await handleSuccessAsync(result)
+ datasource.forEach((item) => {
+ item.table = item.database + '.' + item.name
+ })
+ modelInfo.global_datasource = {}
+ modelInfo.global_datasource[this.currentSelectedProject] = datasource
+ }
this.$nextTick(async () => {
await this.callModelBuildDialog({
- modelDesc: modelDesc,
+ modelDesc: modelInfo,
type: type,
title: this.$t('build'),
isHaveSegment: !!total_size,
@@ -596,7 +607,7 @@ export default class ModelActions extends Vue {
}
get isHaveNoDimMeas () {
- return this.currentModel.simplified_dimensions.length === 0 && this.currentModel.simplified_measures.length === 1 && this.currentModel.simplified_measures[0].name === 'COUNT_ALL' // 没有设置维度,只有默认度量
+ return this.currentModel.empty_model // 没有设置维度,只有默认度量
}
get isHavePartitionColumn () {
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
index 010c41ed35..d5e5d6dab2 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelBuildModal/build.vue
@@ -901,7 +901,7 @@
await (this.$refs.rangeForm && this.$refs.rangeForm.validate()) || Promise.resolve()
await (this.$refs.partitionForm && this.$refs.partitionForm.validate()) || Promise.resolve()
const { column, table } = this.partitionMeta
- if (this.modelDesc.second_storage_enabled && !this.modelDesc.simplified_dimensions.map(it => it.column).includes(`${table}.${column}`)) {
+ if (this.modelDesc.second_storage_enabled && !(this.modelDesc.partition_column_in_dims || this.modelDesc.simplified_dimensions.map(it => it.column).includes(`${table}.${column}`))) {
this.secondStoragePartitionTips = true
this.btnLoading = false
return
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index a84af715b4..438e62f9d1 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -250,16 +250,12 @@ export default class ModelLayout extends Vue {
this.initModelData()
}
- initModelData () {
+ async initModelData () {
const { modelName, searchModelName, tabTypes } = this.$route.params
this.modelName = modelName
this.searchModelName = searchModelName || ''
- if (!this.modelList.filter(it => it.alias === this.modelName).length) {
- // 没有匹配到相应的 model
- this.$router.replace({name: 'ModelList'})
- return
- }
- this.currentModelRow = {...this.modelList.filter(it => it.alias === this.modelName)[0], tabTypes: typeof tabTypes !== 'undefined' ? tabTypes : 'overview'}
+ await this.refreshModelData()
+ this.currentModelRow = {...this.currentModelRow, tabTypes: typeof tabTypes !== 'undefined' ? tabTypes : 'overview'}
if (this.currentModelRow.tabTypes === 'second' && localStorage.getItem('isFirstSaveModel') === 'true') {
this.showGuide()
}
@@ -286,18 +282,6 @@ export default class ModelLayout extends Vue {
})
}
- selectModel ({model, ...args}) {
- let data = {searchModelName: this.searchModelName, ...args}
- let modelData = this.modelList.filter(it => it.alias === this.modelName)
- this.modelName = model.alias
- if (!modelData.length) {
- this.$router.replace({name: 'ModelList'})
- return
- }
- this.$set(this, 'currentModelRow', {...modelData[0], tabTypes: typeof data.tabTypes !== 'undefined' ? data.tabTypes : 'overview'})
- this.randomKey = Date.now().toString(32)
- }
-
loadModelList (name = '') {
const { modelPageOffest } = this
return new Promise((resolve, reject) => {
@@ -331,6 +315,9 @@ export default class ModelLayout extends Vue {
const { value } = await handleSuccessAsync(response)
if (value.length) {
this.currentModelRow = {...this.currentModelRow, ...value[0]}
+ } else {
+ // 没有匹配到相应的 model
+ this.$router.replace({ name: 'ModelList', params: {searchModelName: this.searchModelName} })
}
}
@@ -470,8 +457,8 @@ export default class ModelLayout extends Vue {
// 重新加载模型数据
async reloadModel () {
- await this.loadModelList()
- this.selectModel({model: this.currentModelRow, tabTypes: this.currentModelRow.tabTypes})
+ await this.refreshModelData()
+ this.randomKey = Date.now().toString(32)
}
// 首次创建模型引导
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
index fa0841949f..a26f90e44e 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelPartition/index.vue
@@ -402,7 +402,7 @@ export default class ModelPartition extends Vue {
const { table, column } = this.partitionMeta
await (this.$refs.rangeForm && this.$refs.rangeForm.validate()) || Promise.resolve()
await (this.$refs.partitionForm && this.$refs.partitionForm.validate()) || Promise.resolve()
- if (this.partitionMeta.table && this.modelDesc.second_storage_enabled && !this.modelDesc.simplified_dimensions.map(it => it.column).includes(`${table}.${column}`)) {
+ if (this.partitionMeta.table && this.modelDesc.second_storage_enabled && !(this.modelDesc.partition_column_in_dims || this.modelDesc.simplified_dimensions.map(it => it.column).includes(`${table}.${column}`))) {
this.secondStoragePartitionTips = true
return
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
index 57c4a18ff3..4b9b34423e 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
@@ -98,6 +98,8 @@
:expand-row-keys="expandedRows"
:row-key="renderRowKey"
@expand-change="expandRow"
+ virtual-cell-height="64.57px"
+ :scroll-ancestors="() => ['#scrollContent']"
ref="modelListTable"
style="width: 100%">
<el-table-column
@@ -123,7 +125,7 @@
@after-enter="(e) => afterPoppoverEnter(e, scope.row)"
popper-class="er-popover-layout"
>
- <div class="model-ER-layout"><ModelERDiagram v-if="scope.row.showER" ref="erDiagram" source="modelList" :show-shortcuts-group="false" :show-change-alert="false" :model="dataGenerator.generateModel(scope.row)" /></div>
+ <div class="model-ER-layout"><ModelERDiagram v-if="scope.row.showER" ref="erDiagram" source="modelList" :show-shortcuts-group="false" :show-change-alert="false" :model="scope.row" /></div>
</el-popover>
<span class="model-ER" v-popover="`${scope.row.alias}-ERPopover`">
<el-icon name="el-ksd-icon-table_er_diagram_22" class="ksd-fs-22" type="mult"></el-icon>
@@ -209,10 +211,6 @@
<ModelCloneModal/>
<!-- 模型添加 -->
<ModelAddModal/>
- <!-- 聚合索引编辑 -->
- <AggregateModal v-on:needShowBuildTips="needShowBuildTips" v-on:openBuildDialog="setModelBuldRange" v-on:openComplementAllIndexesDialog="openComplementSegment"/>
- <!-- 表索引编辑 -->
- <TableIndexEdit v-on:needShowBuildTips="needShowBuildTips" v-on:openBuildDialog="setModelBuldRange" v-on:openComplementAllIndexesDialog="openComplementSegment"/>
<!-- 选择去构建的segment -->
<ConfirmSegment v-on:reloadModelAndSegment="reloadModelAndSegment"/>
</div>
@@ -226,12 +224,10 @@ import { NamedRegex, pageRefTags, pageCount } from '../../../../config'
import { ModelStatusTagType } from '../../../../config/model.js'
import locales from './locales'
import { handleError, kylinMessage, jumpToJobs } from 'util/business'
-import { handleSuccessAsync, dataGenerator, sliceNumber, transToServerGmtTime } from 'util'
+import { sliceNumber, transToServerGmtTime } from 'util'
import TableIndex from '../TableIndex/index.vue'
import ModelSegment from './ModelSegment/index.vue'
import SegmentTabs from './ModelSegment/SegmentTabs.vue'
-import ModelAggregate from './ModelAggregate/index.vue'
-import ModelAggregateView from './ModelAggregateView/index.vue'
import TableIndexView from './TableIndexView/index.vue'
import ModelRenameModal from './ModelRenameModal/rename.vue'
import ModelCloneModal from './ModelCloneModal/clone.vue'
@@ -246,8 +242,6 @@ import ModelStreamingJob from './ModelStreamingJob/ModelStreamingJob.vue'
import { mockSQL } from './mock'
import DropdownFilter from '../../../common/DropdownFilter/DropdownFilter.vue'
import ModelOverview from './ModelOverview/ModelOverview.vue'
-import AggregateModal from './AggregateModal/index.vue'
-import TableIndexEdit from '../TableIndexEdit/tableindex_edit'
import ModelActions from './ModelActions/modelActions'
import ModelERDiagram from '../../../common/ModelERDiagram/ModelERDiagram'
import ModelTitleDescription from './Components/ModelTitleDescription'
@@ -265,7 +259,8 @@ function getDefaultFilters (that) {
model_alias_or_owner: '',
last_modify: [],
owner: '',
- model_attributes: []
+ model_attributes: [],
+ lite: true
}
}
@@ -350,8 +345,6 @@ function getDefaultFilters (that) {
TableIndex,
ModelSegment,
SegmentTabs,
- ModelAggregate,
- ModelAggregateView,
TableIndexView,
ModelRenameModal,
ModelCloneModal,
@@ -363,8 +356,6 @@ function getDefaultFilters (that) {
ModelSql,
ModelStreamingJob,
DropdownFilter,
- AggregateModal,
- TableIndexEdit,
ModelOverview,
ModelActions,
ModelERDiagram,
@@ -375,7 +366,6 @@ function getDefaultFilters (that) {
export default class ModelList extends Vue {
pageRefTags = pageRefTags
mockSQL = mockSQL
- dataGenerator = dataGenerator
sliceNumber = sliceNumber
transToServerGmtTime = transToServerGmtTime
filterArgs = getDefaultFilters(this)
@@ -598,29 +588,7 @@ export default class ModelList extends Vue {
)
}
}
- async setModelBuldRange (modelDesc, isNeedBuildGuild) {
- if (!modelDesc.total_indexes && !isNeedBuildGuild || (!this.$store.state.project.multi_partition_enabled && modelDesc.multi_partition_desc)) return
- const projectName = this.currentSelectedProject
- const modelName = modelDesc.uuid
- const res = await this.fetchSegments({ projectName, modelName })
- const { total_size, value } = await handleSuccessAsync(res)
- let type = 'incremental'
- if (!(modelDesc.partition_desc && modelDesc.partition_desc.partition_date_column) && modelDesc.model_type !== 'STREAMING') {
- type = 'fullLoad'
- }
- this.isModelListOpen = true
- this.$nextTick(async () => {
- await this.callModelBuildDialog({
- modelDesc: modelDesc,
- type: type,
- title: this.$t('build'),
- isHaveSegment: !!total_size,
- disableFullLoad: type === 'fullLoad' && value.length > 0 && value[0].status_to_display !== 'ONLINE' // 已存在全量加载任务时,屏蔽
- })
- await this.refreshSegment(modelDesc.alias)
- this.isModelListOpen = false
- })
- }
+
async refreshSegment (alias) {
this.$refs['segmentComp' + alias] && await this.$refs['segmentComp' + alias].$emit('refresh')
this.prevExpendContent = this.modelArray.filter(item => this.expandedRows.includes(item.alias))
@@ -876,6 +844,26 @@ export default class ModelList extends Vue {
})
})
}
+ handleAnimateChanged (event) {
+ const { className } = event.target
+ const isValidClass = className.indexOf('mode-list') !== -1 || className.indexOf('el-loading-mask') !== -1 || className.indexOf('el-button') !== -1
+ if (isValidClass) {
+ const $table = this.$refs['modelListTable']
+ if ($table) $table.verifyPosition()
+ }
+ }
+ mounted () {
+ const $contentPage = document.querySelector('.main-content .mode-list')
+ if ($contentPage) {
+ $contentPage.addEventListener('transitionend', this.handleAnimateChanged)
+ }
+ }
+ beforeDestroy () {
+ const $contentPage = document.querySelector('.main-content .mode-list')
+ if ($contentPage) {
+ $contentPage.removeEventListener('transitionend', this.handleAnimateChanged)
+ }
+ }
}
</script>
<style lang="less">
[kylin] 01/13: KYLIN-5654 Diagnostic host 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 e860a47638d9c8ca3a188d765e40ee75f1c1c4ca
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 19 14:55:56 2023 +0800
KYLIN-5654 Diagnostic host issue
---
kystudio/src/components/admin/Diagnostic/index.vue | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kystudio/src/components/admin/Diagnostic/index.vue b/kystudio/src/components/admin/Diagnostic/index.vue
index c79454ffbe..c33a823dd5 100644
--- a/kystudio/src/components/admin/Diagnostic/index.vue
+++ b/kystudio/src/components/admin/Diagnostic/index.vue
@@ -312,11 +312,11 @@ export default class Diagnostic extends Vue {
if (data) {
if (this.isQueryHistory) {
const hostItem = data.find((item) => item.host === this.queryServer)
- Object.prototype.toString.call(hostItem) === '[object Object]' && this.serverOptions.push({label: `${hostItem.host}(${hostItem.mode && hostItem.mode.toLocaleUpperCase()})`, value: hostItem.host})
+ Object.prototype.toString.call(hostItem) === '[object Object]' && this.serverOptions.push({label: `${hostItem.host}(${hostItem.mode && hostItem.mode.toLocaleUpperCase()})`, value: hostItem.secretName})
this.servers = this.serverOptions.length ? [this.serverOptions[0].value] : []
} else {
data.forEach(item => {
- Object.prototype.toString.call(item) === '[object Object]' && this.serverOptions.push({label: `${item.host}(${item.mode && item.mode.toLocaleUpperCase()})`, value: item.host})
+ Object.prototype.toString.call(item) === '[object Object]' && this.serverOptions.push({label: `${item.host}(${item.mode && item.mode.toLocaleUpperCase()})`, value: item.secretName})
})
this.servers = this.serverOptions.length ? [this.serverOptions[0].value] : []
}
@@ -407,10 +407,10 @@ export default class Diagnostic extends Vue {
end: new Date(this.dateTime.next).getTime()
}
}
- this.servers.forEach(async (host) => {
+ this.servers.forEach(async (secretName) => {
if (this.isQueryHistory) {
await this.getQueryDiagnostic({
- host: `http://${host.trim()}`,
+ host: secretName,
...data,
tm: this.getTimes()
}).then(() => {
@@ -423,7 +423,7 @@ export default class Diagnostic extends Vue {
})
} else {
await this.getDumpRemote({
- host: `http://${host.trim()}`,
+ host: secretName,
...data,
tm: this.getTimes()
}).then(() => {
[kylin] 02/13: KYLIN-5655 refine page list layout and new %X 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 cc42717d93a76707fdc85f44744f6c86235babb0
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Jul 19 16:11:20 2023 +0800
KYLIN-5655 refine page list layout and new %X issue
---
kystudio/src/components/admin/Group/index.vue | 2 +-
kystudio/src/components/admin/Group/locales.js | 6 +-
kystudio/src/components/admin/User/index.vue | 2 +-
kystudio/src/components/admin/User/locales.js | 2 +-
.../src/components/common/GroupEditModal/index.vue | 2 +-
.../components/common/GroupEditModal/locales.js | 4 +-
.../common/ProjectEditModal/ProjectEditModal.vue | 2 +-
.../components/common/ProjectEditModal/locales.js | 4 +-
.../src/components/common/UserEditModal/index.vue | 2 +-
.../src/components/common/UserEditModal/locales.js | 2 +-
.../components/layout/layout_left_right_top.vue | 2 -
kystudio/src/components/monitor/batchJobs/jobs.vue | 5 +-
.../src/components/monitor/batchJobs/locales.js | 2 +-
.../components/monitor/streamingJobs/locales.js | 71 --
.../monitor/streamingJobs/streamingJobs.vue | 1108 --------------------
kystudio/src/components/project/project_list.vue | 10 +-
.../ModelList/ModelAddModal/addmodel.vue | 2 +-
.../ModelList/ModelLayout/modelLayout.vue | 5 -
.../ModelStreamingJob/ModelStreamingJob.vue | 362 -------
.../ModelList/ModelStreamingJob/locales.js | 34 -
.../studio/StudioModel/ModelList/index.vue | 129 ++-
.../studio/StudioModel/ModelList/locales.js | 6 +-
kystudio/src/components/studio/snapshot/locales.js | 2 +-
.../src/components/studio/snapshot/snapshot.vue | 6 +-
kystudio/src/config/index.js | 4 +-
kystudio/src/locale/en.js | 13 +-
kystudio/src/router/index.js | 6 -
kystudio/src/service/monitor.js | 9 -
kystudio/src/store/model.js | 9 -
kystudio/src/store/monitor.js | 9 -
30 files changed, 100 insertions(+), 1722 deletions(-)
diff --git a/kystudio/src/components/admin/Group/index.vue b/kystudio/src/components/admin/Group/index.vue
index 32c2dd1e6e..f122878928 100644
--- a/kystudio/src/components/admin/Group/index.vue
+++ b/kystudio/src/components/admin/Group/index.vue
@@ -2,7 +2,7 @@
<div class="security-group" v-loading="isLoadingUserGroups">
<div class="ksd-title-label ksd-mt-20 ksd-mrl-20">{{$t('userGroupsList')}}</div>
<el-row class="ksd-mb-10 ksd-mt-10 ksd-mrl-20">
- <el-button type="primary" size="medium" v-if="groupActions.includes('addGroup')" :disabled="!isTestingSecurityProfile" icon="el-ksd-icon-add_22" @click="editGroup('new')">{{$t('userGroup')}}</el-button>
+ <el-button type="primary" size="medium" v-if="groupActions.includes('addGroup')" :disabled="!isTestingSecurityProfile" icon="el-ksd-icon-add_22" @click="editGroup('new')">{{$t('kylinLang.common.new')}}</el-button>
<div style="width:240px;" class="ksd-fright">
<el-input class="show-search-btn"
size="medium"
diff --git a/kystudio/src/components/admin/Group/locales.js b/kystudio/src/components/admin/Group/locales.js
index 49bfd12875..de90c7ab04 100644
--- a/kystudio/src/components/admin/Group/locales.js
+++ b/kystudio/src/components/admin/Group/locales.js
@@ -1,15 +1,15 @@
export default {
en: {
- newGroup: 'Add User Group',
+ newGroup: 'New User Group',
assignUsers: 'Assign Users',
willcheck: 'Unassigned Users',
haschecked: 'Assigned Users',
confirmDelGroup: 'Are you sure you want to delete the user group "{groupName}"?',
usersCount: 'Number of Users',
delGroupTitle: 'Delete Group',
- userGroupsList: 'User Group List',
+ userGroupsList: 'User Group',
groupFilter: 'Search by user group name',
userGroup: 'User Group',
- securityProfileTip: 'The current mode doesn\'t allow managing users/user groups, including operations such as adding, editing, deleting, assigning, and changing passwords.'
+ securityProfileTip: 'The current mode doesn\'t allow managing users/user groups, including operations such as creating, editing, deleting, assigning, and changing passwords.'
}
}
diff --git a/kystudio/src/components/admin/User/index.vue b/kystudio/src/components/admin/User/index.vue
index 79b0816a5f..2e9923d28e 100644
--- a/kystudio/src/components/admin/User/index.vue
+++ b/kystudio/src/components/admin/User/index.vue
@@ -16,7 +16,7 @@
icon="el-ksd-icon-add_22"
v-if="userActions.includes('addUser')&&isTestingSecurityProfile"
@click="editUser('new')">
- {{$t('user')}}
+ {{$t('kylinLang.common.new')}}
</el-button>
<div style="width:240px;" class="ksd-fright">
<el-input class="show-search-btn"
diff --git a/kystudio/src/components/admin/User/locales.js b/kystudio/src/components/admin/User/locales.js
index ee8282de7f..7d4eff330a 100644
--- a/kystudio/src/components/admin/User/locales.js
+++ b/kystudio/src/components/admin/User/locales.js
@@ -15,7 +15,7 @@ export default {
groupMembership: 'Assign to Group',
cofirmDelUser: 'Are you sure you want to delete the user {userName} ?',
delUserTitle: 'Delete User',
- userList: 'User List',
+ userList: 'User',
changeUserTips: 'Are you sure you want to {status} the user {userName} ?',
dataPermission: 'Data Permission'
}
diff --git a/kystudio/src/components/common/GroupEditModal/index.vue b/kystudio/src/components/common/GroupEditModal/index.vue
index 040f26bc04..ae26752d1a 100644
--- a/kystudio/src/components/common/GroupEditModal/index.vue
+++ b/kystudio/src/components/common/GroupEditModal/index.vue
@@ -29,7 +29,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="medium" @click="closeHandler(false)">{{$t('kylinLang.common.cancel')}}</el-button>
- <el-button type="primary" size="medium" :loading="submitLoading" :disabled="submitLoading" @click="submit">{{$t('ok')}}</el-button>
+ <el-button type="primary" size="medium" :loading="submitLoading" :disabled="submitLoading" @click="submit">{{$t(this.editType === 'assign' ? 'ok' : 'kylinLang.common.create')}}</el-button>
</div>
</el-dialog>
</template>
diff --git a/kystudio/src/components/common/GroupEditModal/locales.js b/kystudio/src/components/common/GroupEditModal/locales.js
index 2bc4633ea7..1429c18e8e 100644
--- a/kystudio/src/components/common/GroupEditModal/locales.js
+++ b/kystudio/src/components/common/GroupEditModal/locales.js
@@ -1,13 +1,13 @@
export default {
'en': {
- createGroup: 'Add User Group',
+ createGroup: 'New User Group',
willCheckGroup: 'Unassigned Users',
checkedGroup: 'Assigned Users',
assignUser: 'Assign Users',
ok: 'OK',
userGroupPld: 'Please enter user group name',
userPld: 'Search by username',
- saveUserGroupSuccess: ' Added the user group successfully.',
+ saveUserGroupSuccess: ' Created the user group successfully.',
updateUserOrGroupSuccess: 'Adjusted the assigned users and user groups successfully.',
groupnamePld: 'Not support Chinese, nor special symbols (/:\\*?"<>|\')'
}
diff --git a/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue b/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
index cae11f1d99..7b9b8b24ce 100644
--- a/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
+++ b/kystudio/src/components/common/ProjectEditModal/ProjectEditModal.vue
@@ -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" 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.create')}}</el-button>
</div>
</el-dialog>
</template>
diff --git a/kystudio/src/components/common/ProjectEditModal/locales.js b/kystudio/src/components/common/ProjectEditModal/locales.js
index 266534c662..14d4a49bea 100644
--- a/kystudio/src/components/common/ProjectEditModal/locales.js
+++ b/kystudio/src/components/common/ProjectEditModal/locales.js
@@ -2,14 +2,14 @@ export default {
'en': {
project: 'Project',
cancel: 'Cancel',
- addProject: 'Add Project',
+ addProject: 'New Project',
projectName: 'Project Name',
projectType: 'Project Type',
noProject: 'Please enter the project name',
description: 'Description',
projectPlace: 'Please enter project name',
projectDescription: 'Pleaser enter project description',
- saveSuccessful: 'Added the project successfully.',
+ saveSuccessful: 'Created the project successfully.',
projectConfig: 'Project Configuration',
property: 'Property',
propertyCannotChange: '[{keyName}] cannot be edited',
diff --git a/kystudio/src/components/common/UserEditModal/index.vue b/kystudio/src/components/common/UserEditModal/index.vue
index 0b8ed07e54..72da80e8c7 100644
--- a/kystudio/src/components/common/UserEditModal/index.vue
+++ b/kystudio/src/components/common/UserEditModal/index.vue
@@ -141,7 +141,7 @@
</el-form>
<div slot="footer" class="dialog-footer ky-no-br-space">
<el-button size="medium" v-if="showCancelBtn" @click="closeHandler(false)">{{$t('cancel')}}</el-button>
- <el-button type="primary" size="medium" @click="submit" :loading="isLoading">{{$t('ok')}}</el-button>
+ <el-button type="primary" size="medium" @click="submit" :loading="isLoading">{{$t(editType !== 'new' ? 'ok' : 'kylinLang.common.create')}}</el-button>
</div>
</el-dialog>
</template>
diff --git a/kystudio/src/components/common/UserEditModal/locales.js b/kystudio/src/components/common/UserEditModal/locales.js
index c4b3051c30..5576a237e2 100644
--- a/kystudio/src/components/common/UserEditModal/locales.js
+++ b/kystudio/src/components/common/UserEditModal/locales.js
@@ -1,6 +1,6 @@
export default {
'en': {
- addUser: 'Add User',
+ addUser: 'New User',
editRole: 'Edit Role',
resetPassword: 'Change Password',
username: 'Username',
diff --git a/kystudio/src/components/layout/layout_left_right_top.vue b/kystudio/src/components/layout/layout_left_right_top.vue
index 77c49829cb..b159e5e811 100644
--- a/kystudio/src/components/layout/layout_left_right_top.vue
+++ b/kystudio/src/components/layout/layout_left_right_top.vue
@@ -332,8 +332,6 @@ export default class LayoutLeftRightTop extends Vue {
switch (menuName) {
case 'snapshot':
return this.availableMenus.includes(menuName.toLowerCase()) && this.$store.state.project.snapshot_manual_management_enabled
- case 'streamingjob':
- 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':
diff --git a/kystudio/src/components/monitor/batchJobs/jobs.vue b/kystudio/src/components/monitor/batchJobs/jobs.vue
index 64fda35ed3..03fa732b67 100644
--- a/kystudio/src/components/monitor/batchJobs/jobs.vue
+++ b/kystudio/src/components/monitor/batchJobs/jobs.vue
@@ -14,9 +14,8 @@
</div>
</el-col>
<el-col :span="8">
- <el-button type="primary" text size="medium" class="ksd-ml-2 ksd-fright" icon="el-ksd-icon-refresh_22" @click="manualRefreshJobs">{{$t('refreshList')}}</el-button><el-input
- :placeholder="$t('pleaseSearch')" v-model="filter.key" v-global-key-event.enter.debounce="filterChange" @clear="filterChange()" class="show-search-btn ksd-fright" size="medium" prefix-icon="el-icon-search">
- </el-input>
+ <el-input :placeholder="$t('pleaseSearch')" v-model="filter.key" v-global-key-event.enter.debounce="filterChange" @clear="filterChange()" class="show-search-btn ksd-fright" size="medium" prefix-icon="el-icon-search">
+ </el-input><el-button type="primary" text size="medium" class="ksd-ml-2 ksd-fright" icon="el-ksd-icon-refresh_22" @click="manualRefreshJobs">{{$t('refreshList')}}</el-button>
</el-col>
</el-row>
<el-row class="filter-status-list" v-show="filterTags.length">
diff --git a/kystudio/src/components/monitor/batchJobs/locales.js b/kystudio/src/components/monitor/batchJobs/locales.js
index 536ba33da8..1e6c803b8a 100644
--- a/kystudio/src/components/monitor/batchJobs/locales.js
+++ b/kystudio/src/components/monitor/batchJobs/locales.js
@@ -63,7 +63,7 @@ export default {
triggerTime: 'Trigger Time',
order: 'Order',
jobTarget: 'Job Target: ',
- jobsList: 'Batch Job List',
+ jobsList: 'Batch Job',
sparkJobTip: 'Spark Job',
logInfoTip: 'Log Output',
openJobSteps: 'Open Job Steps',
diff --git a/kystudio/src/components/monitor/streamingJobs/locales.js b/kystudio/src/components/monitor/streamingJobs/locales.js
deleted file mode 100644
index e4770afe59..0000000000
--- a/kystudio/src/components/monitor/streamingJobs/locales.js
+++ /dev/null
@@ -1,71 +0,0 @@
-export default {
- 'en': {
- adminTips: 'Admin user can view all job information via Select All option in the project list.',
- streamingJobsList: 'Streaming Job List',
- jobStart: 'Start',
- jobRestart: 'Restart',
- jobStop: 'Stop',
- refreshList: 'Refresh List',
- pleaseSearch: 'Search Object',
- streamingIngestion: 'Data Ingestion',
- autoMerge: 'Auto-Merge',
- TargetObject: 'Object',
- JobType: 'Type',
- project: 'Project',
- status: 'Status',
- dataDuration: 'Data Latency',
- lastStatusChangeTime: 'Last Status Change Time',
- lastStatusDuration: 'Last Status Duration',
- Actions: 'Actions',
- configurations: 'Configurations',
- START: 'START',
- STARTING: 'STARTING',
- RUNNING: 'RUNNING',
- STOPPING: 'STOPPING',
- STOPPED: 'STOPPED',
- STOP: 'STOP',
- ERROR: 'ERROR',
- clearAll: 'Clear All',
- filteredTotalSize: '{totalSize} result(s)',
- ProgressStatus: 'Status',
- key: 'Key',
- value: 'Value',
- STREAMING_BUILD: 'STREAMING_BUILD',
- STREAMING_MERGE: 'STREAMING_MERGE',
- pleaseInputKey: 'Please enter the key',
- pleaseInputValue: 'Please enter the value',
- dataStatistics: 'Data Statistics',
- jobRecords: 'Job Start and Stop Records',
- noSelectJobs: 'Please select at least one job.',
- recordStatus: 'Status Change Records',
- consumptionRate: 'Consumption Rate',
- dataLatency: 'Data Latency',
- processingTime: 'Processing Time',
- consumptionUnit: 'msg/s',
- latencyUnit: 's',
- processingUnit: 's',
- isNoStatisticsData: 'No Statistics',
- isNoRecords: 'No Records',
- '30m': 'last 30 minutes',
- '1h': 'last 1 hours',
- '6h': 'last 6 hours',
- '12h': 'last 12 hours',
- '1d': 'last 1 day',
- '3d': 'last 3 days',
- '7d': 'last 7 days',
- stopStreamingJobTips: 'Stopping the job(s) may take several minutes. Are you sure you want to stop the job(s)?',
- stopStreamingJobImmeTips: 'Stopping the job immediately, some segments would be in "REFRESHING" or "LOCKED" state. They would be deleted when the job(s) starts again, or you could delete them manually. Are you sure you want to stop the job(s) immediately?',
- stopJob: 'Stop Job',
- stopJobImme: 'Stop Immediately',
- mulParamsKeyTips: 'This key already exists.',
- errorStautsTips: 'An unknown error occurred. Please contact the admin.',
- errorStautsTips2: 'An unknown error occurred. Please download system diagnostic package to view the log or contact the admin.',
- disableStartJobTips: 'Can\'t be used. Please add streaming indexes first.',
- borkenModelDisableStartJobTips: 'Can\'t be used. Model {modelName} is currently broken.',
- noPartitonColumnDisableStartJobTips: 'Can\'t be used. Please specify a timestamp field as the time partition column of this model.',
- logInfoTip: 'Log',
- sparkTaskDetails: 'Spark Info',
- output: 'Output',
- jobDiagnosis: 'Download Job Diagnostic Package'
- }
-}
diff --git a/kystudio/src/components/monitor/streamingJobs/streamingJobs.vue b/kystudio/src/components/monitor/streamingJobs/streamingJobs.vue
deleted file mode 100644
index e85a7a5dce..0000000000
--- a/kystudio/src/components/monitor/streamingJobs/streamingJobs.vue
+++ /dev/null
@@ -1,1108 +0,0 @@
-<template>
- <div id="streamingJobListPage">
- <el-alert :title="$t('adminTips')" type="tip" class="admin-tips" v-if="isShowAdminTips" @close="closeTips" show-icon></el-alert>
- <div class="streaming-jobs-list ksd-mrl-24">
- <div class="ksd-title-page ksd-mt-32">{{$t('streamingJobsList')}}</div>
- <el-row :gutter="20" class="jobs_tools_row ksd-mtb-8">
- <el-col :span="16">
- <div class="action_groups ksd-btn-group-minwidth ksd-fleft" v-if="monitorActions.includes('jobActions')">
- <el-button type="primary" text size="medium" icon="el-ksd-icon-play_with_border_22" :disabled="!batchBtnsEnabled.start" :loading="startLoading" @click="batchStart">{{$t('jobStart')}}</el-button>
- <el-button type="primary" text size="medium" icon="el-ksd-icon-resure_22" class="ksd-ml-2" :disabled="!batchBtnsEnabled.restart" :loading="restartLoading" @click="batchRestart">{{$t('jobRestart')}}</el-button>
- <el-button type="primary" text size="medium" icon="el-ksd-icon-stop_with_border_22" class="ksd-ml-2" :disabled="!batchBtnsEnabled.stop" :loading="stopLoading" @click="batchStop(false)">{{$t('jobStop')}}</el-button>
- <el-button type="primary" text size="medium" icon="el-ksd-icon-stop_with_border_22" class="ksd-ml-2" :disabled="!batchBtnsEnabled.stopImme" :loading="stopImmeLoading" @click="batchStop(true)">{{$t('stopJobImme')}}</el-button>
- </div>
- </el-col>
- <el-col :span="8">
- <el-button type="primary" text size="medium" class="ksd-ml-2 ksd-fright" icon="el-ksd-icon-refresh_22" @click="manualRefreshJobs">{{$t('refreshList')}}</el-button><el-input
- :placeholder="$t('pleaseSearch')" v-model="filter.model_name" v-global-key-event.enter.debounce="filterChange" @clear="filterChange()" class="show-search-btn ksd-fright" size="medium" prefix-icon="el-icon-search">
- </el-input>
- </el-col>
- </el-row>
- <el-row class="filter-status-list" v-show="filterTags.length">
- <div class="tag-layout">
- <el-tag closable v-for="(item, index) in filterTags" :key="index" @close="handleClose(item)">{{`${$t(item.source)}${$t('kylinLang.common.colon')}${item.label}`}}</el-tag><span class="clear-all-tags" @click="handleClearAllTags">{{$t('clearAll')}}</span>
- </div>
- <span class="filter-job-size">{{$t('filteredTotalSize', {totalSize: jobTotal})}}</span>
- </el-row>
- <el-row :gutter="10" id="listBox">
- <el-col :span="showStep?18:24" id="leftStreamingTableBox" :class="{'show-steps': showStep}">
- <el-table class="ksd-el-table streaming-jobs-table"
- tooltip-effect="dark"
- v-scroll-shadow
- ref="streamingJobsTable"
- :data="jobsList"
- highlight-current-row
- :default-sort = "{prop: 'create_time', order: 'descending'}"
- :empty-text="emptyText"
- @sort-change="sortJobList"
- @selection-change="handleSelectionChange"
- @cell-click="showLineSteps"
- :row-class-name="tableRowClassName"
- :key="$store.state.project.isAllProject">
- <el-table-column
- class-name="icon-column"
- :selectable="setJobSelectable"
- :checkbox-disable-tooltip="(row) => disableStartJobTips(row)"
- checkbox-disable-tooltip-placement="top"
- type="selection" align="center" width="32"></el-table-column>
- <el-table-column class-name="icon-column" align="center" width="32" prop="icon" v-if="monitorActions.includes('jobActions')">
- <template slot-scope="scope">
- <i class="ksd-fs-22" :class="{
- 'el-ksd-icon-arrow_table_right_22': scope.row.uuid !== selectedJob.uuid || !showStep,
- 'el-ksd-icon-arrow_table_down_22': scope.row.uuid == selectedJob.uuid && showStep}"></i>
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('TargetObject')"
- sortable="custom"
- min-width="140"
- :show-search-input="true"
- :placeholder="$t('pleaseSearch')"
- :emptyFilterText="$t('kylinLang.common.noData')"
- :filter-filters-change="(v) => loadModelObjectList(v)"
- customFilterClass="filter-submitter"
- :filters="modelFilteArr.map(item => ({text: item, value: item}))"
- :filtered-value="filter.model_names"
- filter-icon="el-ksd-icon-filter_22"
- :show-multiple-footer="false"
- :filter-change="(v) => filterContent(v, 'model_names')"
- show-overflow-tooltip
- prop="model_alias">
- <template slot-scope="scope">
- <a class="link" @click="gotoModelList(scope.row)">{{scope.row.model_alias}}</a>
- </template>
- </el-table-column>
- <el-table-column
- :filters="jobTypeFilteArr.map(item => ({text: $t(item), value: item}))"
- :filtered-value="filter.job_types"
- :label="$t('JobType')"
- filter-icon="el-ksd-icon-filter_22"
- :show-multiple-footer="false"
- :filter-change="(v) => filterContent(v, 'job_types')"
- prop="job_type"
- width="164">
- <template slot-scope="scope">
- {{$t(scope.row.job_type)}}
- </template>
- </el-table-column>
- <el-table-column v-if="$store.state.project.isAllProject"
- :label="$t('project')"
- sortable='custom'
- :width="120"
- show-overflow-tooltip
- prop="project">
- </el-table-column>
- <el-table-column
- width="180"
- :filters="allStatus.map(item => ({text: $t(item), value: item}))"
- :filtered-value="filter.status" :label="$t('status')"
- filter-icon="el-ksd-icon-filter_22"
- :show-multiple-footer="false"
- :filter-change="(v) => filterContent(v, 'status')">
- <template slot-scope="scope">
- <common-tip :content="scope.row.launching_error?$t('errorStautsTips2'):$t('errorStautsTips')" :disabled="scope.row.job_status!=='ERROR'">
- <el-tag :type="jobStatus(scope.row.job_status)" size="small">{{$t(scope.row.job_status)}}</el-tag>
- </common-tip>
- </template>
- </el-table-column>
- <el-table-column
- width="140"
- sortable="custom"
- prop="data_latency"
- :label="$t('dataDuration')">
- <template slot-scope="scope">
- {{scope.row.data_latency | timeSize }}
- </template>
- </el-table-column>
- <el-table-column
- width="218"
- :label="$t('lastStatusChangeTime')"
- show-overflow-tooltip
- prop="last_modified"
- sortable="custom">
- <template slot-scope="scope">
- {{transToGmtTime(scope.row.last_modified)}}
- </template>
- </el-table-column>
- <el-table-column
- width="218"
- :label="$t('lastStatusDuration')"
- show-overflow-tooltip
- prop="last_status_duration"
- sortable="custom">
- <template slot-scope="scope">
- {{scope.row.last_status_duration | timeSize }}
- </template>
- </el-table-column>
- <el-table-column
- :label="$t('Actions')"
- v-if="monitorActions.includes('jobActions')"
- class-name="job-fc-icon"
- width="96">
- <template slot-scope="scope">
- <common-tip :content="$t('jobDiagnosis')" v-if="monitorActions.includes('diagnostic')">
- <i class="el-icon-ksd-ostin_diagnose ksd-fs-14 ksd-ml-4" @click.stop="showDiagnosisDetail(scope.row.uuid)"></i>
- </common-tip>
- <common-tip :content="$t('configurations')">
- <i class="el-ksd-icon-controller_22 ksd-fs-22 ksd-ml-4" @click.stop="configJob(scope.row)"></i>
- </common-tip>
- <common-tip :content="$t('kylinLang.common.moreActions')" v-if="(!scope.row.launching_error&&scope.row.job_status!=='STARTING')||scope.row.yarn_app_url" >
- <el-dropdown trigger="click">
- <span class="el-dropdown-link" @click.stop>
- <common-tip :content="$t('kylinLang.common.moreActions')">
- <i class="el-icon-ksd-table_others ksd-fs-16"></i>
- </common-tip>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if="!scope.row.launching_error&&scope.row.job_status!=='STARTING'" @click.native="clickFile(scope.row)">{{$t('logInfoTip')}}</el-dropdown-item>
- <el-dropdown-item v-if="scope.row.yarn_app_url" @click.native="skipToSparkDetail(scope.row)">{{$t('sparkTaskDetails')}}<i class="el-icon-ksd-export ksd-ml-4"></i></el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </common-tip>
- </template>
- </el-table-column>
- </el-table>
- <kylin-pager :totalSize="jobTotal" :curPage="filter.page_offset+1" v-on:handleCurrentChange='currentChange' ref="jobPager" :refTag="pageRefTags.streamingJobPager" class="ksd-mtb-16 ksd-center" ></kylin-pager>
- </el-col>
- <el-col :span="6" v-if="showStep" id="rightDetail" :class="{'is-admin-tips': $store.state.user.isShowAdminTips&&isAdminRole}">
- <el-tabs v-model="jobDetailTab" @tab-click="handleChangeTab">
- <el-tab-pane :label="$t('dataStatistics')" name="statistics">
- <el-select class="ksd-fright" size="small" v-model="time_filter">
- <el-option
- v-for="item in filterOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <div v-if="!isNoStatisticsData">
- <div class="data-consumption-chart">
- <div class="chart-title">{{$t('consumptionRate')}}</div>
- <div id="consumption-chart" class="data-chart"></div>
- </div>
- <div class="data-latency-chart ksd-mt-16">
- <div class="chart-title">{{$t('dataLatency')}}</div>
- <div id="latency-chart" class="data-chart"></div>
- </div>
- <div class="data-processing-chart ksd-mt-16">
- <div class="chart-title">{{$t('processingTime')}}</div>
- <div id="processing-chart" class="data-chart"></div>
- </div>
- </div>
- <kylin-nodata v-else :content="$t('isNoStatisticsData')"></kylin-nodata>
- </el-tab-pane>
- <el-tab-pane :label="$t('recordStatus')" name="records">
- <div class="ksd-list" v-if="selectedJobRecords.length">
- <p class="list" v-for="r in selectedJobRecords" :key="r.create_time">
- <span class="label">{{$t(r.action)}}</span><span class="text ksd-ml-24">{{transToGmtTime(r.create_time)}}</span>
- </p>
- </div>
- <kylin-nodata v-else :content="$t('isNoRecords')"></kylin-nodata>
- </el-tab-pane>
- </el-tabs>
- <div class='job-btn' id="jobDetailBtn" v-show="isShowBtn" :class="{'is-filter-list': filterTags.length}" @click='showStep=false'><i class='el-ksd-icon-arrow_right_16' aria-hidden='true'></i></div>
- </el-col>
- </el-row>
- </div>
- <el-dialog
- :title="$t('configurations')"
- append-to-body
- class="configurations-dialog"
- :close-on-press-escape="false"
- :close-on-click-modal="false"
- :visible.sync="showConfigurations"
- @close="handleConfigurationsClose"
- width="600px">
- <div>
- <el-row :gutter="10">
- <el-col :span="14"><span class="title">{{$t('key')}}</span></el-col>
- <el-col :span="6"><span class="title">{{$t('value')}}</span></el-col>
- <el-col :span="4"></el-col>
- </el-row>
- <el-row :gutter="10" class="ksd-mt-10" v-for="(item, index) in paramsConfigs" :key="index">
- <el-col :span="14">
- <el-input v-model.trim="paramsConfigs[index][0]"
- :disabled="paramsConfigs[index] && !!paramsConfigs[index][2].isDefault"
- :class="{'is-mul-key': paramsConfigs[index][2].isMulParamsKey, 'is-empty': paramsConfigs[index][2].isEmpty&&!paramsConfigs[index][0]}"
- @change="handleValidateParamsKey()"
- :placeholder="$t('pleaseInputKey')"></el-input>
- <div class="error-msg" v-if="paramsConfigs[index][2].isMulParamsKey&&!paramsConfigs[index][2].isDefault">{{$t('mulParamsKeyTips')}}</div>
- </el-col>
- <el-col :span="6">
- <el-input v-number2="paramsConfigs[index][1]"
- v-model.trim="paramsConfigs[index][1]"
- :class="{'is-empty': paramsConfigs[index][2].isEmpty&&!paramsConfigs[index][1]}"
- :placeholder="$t('pleaseInputValue')"
- @change="handleValidateParamsKey()"
- v-if="numberParams.indexOf(item[0]) !== -1"></el-input>
- <el-input v-else v-model.trim="paramsConfigs[index][1]" :class="{'is-empty': paramsConfigs[index][2].isEmpty&&!paramsConfigs[index][1]}" :placeholder="$t('pleaseInputValue')" />
- </el-col>
- <el-col :span="4">
- <span class="action-btns ksd-ml-5">
- <el-button type="primary" icon="el-ksd-icon-add_22" plain circle size="small" @click="addParamsConfigs()"></el-button>
- <el-button icon="el-ksd-icon-minus_22" class="ksd-ml-5" plain circle size="small" :disabled="[...buildDefaultParams, ...mergeDefaultParams].indexOf(item[0]) !== -1" @click="removeParamsConfigs(index)"></el-button>
- </span>
- </el-col>
- </el-row>
- </div>
- <div slot="footer" class="dialog-footer ky-no-br-space">
- <el-button plain @click="handleConfigurationsClose">{{$t('kylinLang.common.cancel')}}</el-button>
- <el-button type="primary" :loading="loadingSetting" @click="saveSettings">{{$t('kylinLang.common.save')}}</el-button>
- </div>
- </el-dialog>
- <el-dialog
- id="show-diagnos"
- limited-area
- :title="$t('output')"
- :visible.sync="dialogVisible"
- @close="handleCloseOutputDialog"
- :close-on-press-escape="false"
- :close-on-click-modal="false">
- <job_dialog :stepDetail="outputDetail" :showOutputJob="showOutputJob"></job_dialog>
- <span slot="footer" class="dialog-footer">
- <el-button plain size="medium" @click="dialogVisible = false">{{$t('kylinLang.common.close')}}</el-button>
- </span>
- </el-dialog>
- <diagnostic v-if="showDiagnostic" @close="showDiagnostic = false" :jobId="diagnosticId"/>
- </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import { Component, Watch } from 'vue-property-decorator'
-import { mapActions, mapGetters, mapMutations } from 'vuex'
-import { cacheLocalStorage, objectClone, indexOfObjWithSomeKey, countObjWithSomeKey } from 'util/index'
-import { handleError, handleSuccess, transToGmtTime, kylinConfirm } from 'util/business'
-import { pageRefTags, bigPageCount } from 'config'
-import $ from 'jquery'
-import locales from './locales'
-import { handleSuccessAsync } from 'util'
-import charts from 'util/charts'
-import echarts from 'echarts'
-import jobDialog from '../job_dialog'
-import Diagnostic from 'components/admin/Diagnostic/index'
-@Component({
- methods: {
- ...mapActions({
- loadStreamingJobsList: 'LOAD_STREAMING_JOBS_LIST',
- getStreamingJobRecords: 'GET_STREAMING_JOB_RECORDS',
- updateStreamingConfig: 'UPDATE_STREAMING_CONFIGURATIONS',
- updateStreamingJobs: 'UPDATE_STREAMING_JOBS',
- getStreamingChartData: 'GET_STREAMING_CHART_DATA',
- getModelObjectList: 'GET_MODEL_OBJECT_LIST',
- getJobSimpleLog: 'GET_JOB_SIMPLE_LOG'
- }),
- ...mapMutations({
- setProject: 'SET_PROJECT'
- }),
- ...mapActions('DetailDialogModal', {
- callGlobalDetailDialog: 'CALL_MODAL'
- })
- },
- components: {
- 'job_dialog': jobDialog,
- Diagnostic
- },
- computed: {
- ...mapGetters([
- 'currentSelectedProject',
- 'monitorActions',
- 'isAdminRole'
- ])
- },
- locales
-})
-export default class StreamingJobsList extends Vue {
- pageRefTags = pageRefTags
- transToGmtTime = transToGmtTime
- filter = {
- page_offset: 0,
- page_size: +localStorage.getItem(this.pageRefTags.streamingJobPager) || bigPageCount,
- job_types: [],
- model_names: [],
- sort_by: 'create_time',
- reverse: true,
- status: [],
- model_name: '',
- isAuto: false
- }
- startLoading = false
- restartLoading = false
- stopLoading = false
- stopImmeLoading = false
- batchBtnsEnabled = {
- start: false,
- restart: false,
- stop: false,
- stopImme: false
- }
- stCycle = null
- showStep = false
- jobDetailTab = 'statistics'
- isNoStatisticsData = false
- paramsConfigs = []
- filterTags = []
- jobsList = []
- jobTotal = 0
- multipleSelection = []
- isPausePolling = false
- selectedJob = {}
- settingJob = null
- selectedJobRecords = []
- modelFilteArr = []
- filterOptions = [
- {value: '30', label: this.$t('30m')},
- {value: '60', label: this.$t('1h')},
- {value: '360', label: this.$t('6h')},
- {value: '720', label: this.$t('12h')},
- {value: '1440', label: this.$t('1d')},
- {value: '4320', label: this.$t('3d')},
- {value: '10080', label: this.$t('7d')}
- ]
- jobTypeFilteArr = ['STREAMING_BUILD', 'STREAMING_MERGE']
- allStatus = ['STARTING', 'RUNNING', 'STOPPING', 'ERROR', 'STOPPED']
- buildDefaultParams = ['spark.master', 'spark.driver.memory', 'spark.executor.instances', 'spark.executor.cores', 'spark.executor.memory', 'spark.sql.shuffle.partitions', 'kylin.streaming.duration', 'kylin.streaming.job-retry-enabled', 'kylin.streaming.kafka-conf.maxOffsetsPerTrigger']
- mergeDefaultParams = ['spark.master', 'spark.driver.memory', 'spark.executor.instances', 'spark.executor.cores', 'spark.executor.memory', 'spark.sql.shuffle.partitions', 'kylin.streaming.segment-max-size', 'kylin.streaming.segment-merge-threshold', 'kylin.streaming.job-retry-enabled']
- numberParams = ['spark.executor.cores', 'kylin.streaming.duration', 'spark.executor.instances', 'kylin.streaming.segment-merge-threshold', 'kylin.streaming.kafka-conf.maxOffsetsPerTrigger']
- showConfigurations = false
- loadingSetting = false
- consumpChart = null
- latencyChart = null
- processingChart = null
- time_filter = '30'
- isShowBtn = true
- isMulParamsKey = false
- dialogVisible = false
- showOutputJob = null
- outputDetail = ''
- showDiagnostic = false
- diagnosticId = ''
- get isShowAdminTips () {
- return this.$store.state.user.isShowAdminTips && this.isAdminRole && !this.$store.state.system.isShowGlobalAlter
- }
- get emptyText () {
- return this.filter.key || this.filter.job_types.length || this.filter.status.length ? this.$t('kylinLang.common.noResults') : this.$t('kylinLang.common.noData')
- }
-
- // 模型无索引时不让启动任务
- setJobSelectable (row) {
- return row.model_indexes && row.model_indexes > 0 && !row.model_broken && !!row.partition_desc && !!row.partition_desc.partition_date_column
- }
-
- disableStartJobTips (row) {
- if (row.model_broken) {
- return this.$t('borkenModelDisableStartJobTips', {modelName: row.model_alias})
- } else if (!(row.partition_desc && row.partition_desc.partition_date_column)) {
- return this.$t('noPartitonColumnDisableStartJobTips')
- } else {
- return this.$t('disableStartJobTips')
- }
- }
-
- @Watch('$store.state.project.isAllProject')
- selectAllProject (curVal) {
- if (curVal) {
- this.jobsList = []
- this.$nextTick(() => {
- this.manualRefreshJobs()
- this.loadModelObjectList()
- })
- }
- }
-
- closeTips () {
- this.$store.state.user.isShowAdminTips = false
- cacheLocalStorage('isHideAdminTips', true)
- }
- async batchStart () {
- if (!this.batchBtnsEnabled.start) return
- if (!this.multipleSelection.length) {
- this.$message.warning(this.$t('noSelectJobs'))
- } else {
- try {
- this.startLoading = true
- const data = {project: this.currentSelectedProject, action: 'START', job_ids: this.idsArr}
- if (this.$store.state.project.isAllProject) {
- delete data.project
- }
- const res = await this.updateStreamingJobs(data)
- await handleSuccessAsync(res)
- this.startLoading = false
- this.$message({
- type: 'success',
- message: this.$t('kylinLang.common.actionSuccess')
- })
- this.manualRefreshJobs()
- } catch (e) {
- handleError(e)
- this.startLoading = false
- }
- }
- }
- async batchRestart () {
- if (!this.batchBtnsEnabled.restart) return
- if (!this.multipleSelection.length) {
- this.$message.warning(this.$t('noSelectJobs'))
- } else {
- try {
- this.restartLoading = true
- const data = {project: this.currentSelectedProject, action: 'RESTART', job_ids: this.idsArr}
- if (this.$store.state.project.isAllProject) {
- delete data.project
- }
- const res = await this.updateStreamingJobs(data)
- await handleSuccessAsync(res)
- this.restartLoading = false
- this.$message({
- type: 'success',
- message: this.$t('kylinLang.common.actionSuccess')
- })
- this.manualRefreshJobs()
- } catch (e) {
- handleError(e)
- this.restartLoading = false
- }
- }
- }
- async stopJob (data, isStopImme) {
- const loadingType = isStopImme ? 'stopImmeLoading' : 'stopLoading'
- try {
- this[loadingType] = true
- const res = await this.updateStreamingJobs(data)
- await handleSuccessAsync(res)
- this[loadingType] = false
- this.$message({
- type: 'success',
- message: this.$t('kylinLang.common.actionSuccess')
- })
- this.manualRefreshJobs()
- } catch (e) {
- handleError(e)
- this[loadingType] = false
- }
- }
- async batchStop (isStopImme) {
- if (!isStopImme && !this.batchBtnsEnabled.stop) return
- if (isStopImme && !this.batchBtnsEnabled.stopImme) return
- if (!this.multipleSelection.length) {
- this.$message.warning(this.$t('noSelectJobs'))
- } else {
- const msg = isStopImme ? this.$t('stopStreamingJobImmeTips') : this.$t('stopStreamingJobTips')
- const stopJobType = isStopImme ? this.$t('stopJobImme') : this.$t('stopJob')
- await kylinConfirm(msg, {confirmButtonText: stopJobType}, stopJobType)
- const data = {project: this.currentSelectedProject, action: isStopImme ? 'FORCE_STOP' : 'STOP', job_ids: this.idsArr}
- // const isSubmit = await this.callGlobalDetailDialog({
- // msg: this.$t('stopStreamingJobTips'),
- // title: this.$t('stopJob'),
- // dialogType: '',
- // wid: '600px',
- // showDetailBtn: false,
- // isSubSubmit: true,
- // submitSubText: this.$t('stopJob'),
- // submitText: this.$t('stopJobImme')
- // })
- // data.action = isSubmit.isOnlySave ? 'STOP' : 'FORCE_STOP'
- if (this.$store.state.project.isAllProject) {
- delete data.project
- }
- this.stopJob(data, isStopImme)
- }
- }
- filterChange (val) {
- this.searchLoading = true
- this.filter.page_offset = 0
- this.manualRefreshJobs()
- this.showStep = false
- }
- resetSelection () {
- this.multipleSelection = []
- this.$refs.streamingJobsTable && this.$refs.streamingJobsTable.clearSelection && this.$refs.streamingJobsTable.clearSelection()
- this.idsArrCopy = []
- this.idsArr = []
- }
- configJob (rows) {
- this.settingJob = rows
- const defaultParams = rows.job_type === 'STREAMING_BUILD' ? this.buildDefaultParams : this.mergeDefaultParams
- this.paramsConfigs = Object.entries(rows.params).map(it => ([...it, {isDefault: defaultParams.indexOf(it[0]) !== -1}]))
- this.showConfigurations = true
- }
- handleConfigurationsClose (isSubmit) {
- this.showConfigurations = false
- if (isSubmit) {
- this.loadList()
- }
- }
- async clickFile (row) {
- try {
- const res = await this.getJobSimpleLog({ project: row.project, job_id: row.uuid })
- const data = await handleSuccessAsync(res)
- this.outputDetail = data.cmd_output
- this.showOutputJob = row
- this.dialogVisible = true
- } catch (e) {
- handleError(e)
- this.dialogVisible = false
- this.showOutputJob = null
- }
- }
- skipToSparkDetail (row) {
- window.open(row.yarn_app_url)
- }
- handleCloseOutputDialog () {
- this.showOutputJob = null
- }
- currentChange (size, count) {
- this.filter.page_offset = size
- this.filter.page_size = count
- this.resetSelection()
- this.getJobsList()
- this.closeIt()
- }
- closeIt () {
- if (this.showStep) {
- this.showStep = false
- }
- }
- // 增加配置
- addParamsConfigs () {
- this.paramsConfigs.unshift(['', '', {isDefault: false}])
- }
- // 删减配置
- removeParamsConfigs (index) {
- this.paramsConfigs.splice(index, 1)
- this.handleValidateParamsKey()
- }
- // 检测key是否重复
- handleValidateParamsKey () {
- this.isMulParamsKey = false
- this.paramsConfigs.forEach((p, index) => {
- if (countObjWithSomeKey(this.paramsConfigs, 0, p[0]) > 1) {
- this.$set(this.paramsConfigs[index][2], 'isMulParamsKey', true)
- this.isMulParamsKey = true
- } else {
- this.$set(this.paramsConfigs[index][2], 'isMulParamsKey', false)
- }
- if (!p[0] || !p[1]) {
- this.$set(this.paramsConfigs[index][2], 'isEmpty', true)
- }
- })
- }
- saveSettings () {
- this.handleValidateParamsKey()
- const params = {}
- let isEmptyValue
- this.paramsConfigs.forEach((item, index) => {
- if (!item[0] || !item[1]) {
- isEmptyValue = true
- }
- params[item[0]] = item[1]
- })
- if (isEmptyValue || this.isMulParamsKey) return // 默认参数有空值不能提交,key值重复不能提交
- this.loadingSetting = true
- this.updateStreamingConfig({project: this.currentSelectedProject, job_id: this.settingJob.uuid, params}).then(() => {
- this.loadingSetting = false
- this.handleConfigurationsClose(true)
- this.$message({
- type: 'success',
- message: this.$t('kylinLang.common.actionSuccess')
- })
- }).catch((e) => {
- handleError(e)
- this.loadingSetting = false
- })
- }
- // 删除单个筛选条件
- handleClose (tag) {
- const index = this.filter[tag.key].indexOf(tag.label)
- index > -1 && this.filter[tag.key].splice(index, 1)
- this.filterTags = this.filterTags.filter(item => item.key !== tag.key || item.key === tag.key && tag.label !== item.label)
- this.filter.page_offset = 0
- this.manualRefreshJobs()
- }
- // 清除所有的tags
- handleClearAllTags () {
- this.filter.page_offset = 0
- this.filter.model_names.splice(0, this.filter.model_names.length)
- this.filter.job_types.splice(0, this.filter.job_types.length)
- this.filter.status.splice(0, this.filter.status.length)
- this.filterTags = []
- this.manualRefreshJobs()
- }
- sortJobList ({ column, prop, order }) {
- if (order === 'ascending') {
- this.filter.reverse = false
- } else {
- this.filter.reverse = true
- }
- this.filter.sort_by = prop
- this.filter.page_offset = 0
- this.manualRefreshJobs()
- }
- handleSelectionChange (val) {
- if (val && val.length) {
- this.multipleSelection = val
- this.isPausePolling = true
- const selectedStatus = this.multipleSelection.map((item) => {
- return item.job_status
- })
- this.getBatchBtnStatus(selectedStatus)
- this.idsArr = this.multipleSelection.map((item) => {
- return item.uuid
- })
- } else {
- this.isPausePolling = false
- this.multipleSelection = []
- this.batchBtnsEnabled = {
- start: false,
- restart: false,
- stop: false,
- stopImme: false
- }
- this.idsArr = []
- }
- }
- jobStatus (status) {
- switch (status) {
- case 'STARTING': return ''
- case 'STOPPING': return ''
- case 'STOPPED': return 'warning'
- case 'ERROR': return 'danger'
- default: return ''
- }
- }
- getBatchBtnStatus (statusArr) {
- const batchBtns = {
- start: ['ERROR', 'STOPPED'],
- restart: ['RUNNING'],
- stop: ['RUNNING'],
- stopImme: ['STARTING', 'RUNNING', 'STOPPING']
- }
- $.each(batchBtns, (key, item) => {
- this.batchBtnsEnabled[key] = this.isContain(item, statusArr)
- })
- }
- isContain (arr1, arr2) {
- for (let i = arr2.length - 1; i >= 0; i--) {
- if (!arr1.includes(arr2[i])) {
- return false
- }
- }
- return true
- }
- showLineSteps (row, column, cell) {
- if (column.property === 'icon') {
- var needShow = false
- if (row.uuid !== this.selectedJob.uuid) {
- needShow = true
- } else {
- needShow = !this.showStep
- }
- this.showStep = needShow
- this.selectedJob = row
- // this.jobDetailTab = 'statistics'
- if (this.jobDetailTab === 'records') {
- this.selectedJobRecords = []
- this.getRecordsData()
- } else {
- this.getChartData()
- }
- }
- }
- initLineChart (data) {
- if (!this.showStep) return
- if (data.create_time.length > 0) {
- this.isNoStatisticsData = false
- setTimeout(() => {
- const consumptionId = document.getElementById('consumption-chart')
- const latencyId = document.getElementById('latency-chart')
- const processingId = document.getElementById('processing-chart')
- const xDates = data.create_time && data.create_time.reverse().map(it => {
- const dateSplit = transToGmtTime(+it).split(' ')
- return dateSplit[0] + '\n' + dateSplit[1] + ' ' + dateSplit[2]
- })
- const yConsumpVol = data.consumption_rate_hist.reverse()
- const yLatencyVol = data.data_latency_hist.reverse()
- const yProcessingVol = data.processing_time_hist.reverse()
- const consumpDatas = {}
- const latencyDatas = {}
- const processingDatas = {}
- data.create_time && data.create_time.forEach((k, index) => {
- consumpDatas[k] = data.consumption_rate_hist[index]
- latencyDatas[k] = data.data_latency_hist[index]
- processingDatas[k] = data.processing_time_hist[index]
- })
- this.consumpChart = echarts.init(consumptionId)
- const consumpOption = charts.line(this, xDates, yConsumpVol, consumpDatas)
- consumpOption.grid.left = 38
- consumpOption.yAxis.axisLabel.formatter = (val) => {
- if (val > 0 && val < 1) {
- return ''
- } else if (val < 1000) {
- return `${val}`
- } else {
- return `${val / 1000}K`
- }
- }
- consumpOption.yAxis.name = this.$t('consumptionUnit')
- consumpOption.tooltip.trigger = 'axis'
- consumpOption.tooltip.formatter = (vals) => {
- return `<div>${vals[0].name}</div><div>${vals[0].data} ${this.$t('consumptionUnit')}</div>`
- }
- this.consumpChart.setOption(consumpOption)
- this.latencyChart = echarts.init(latencyId)
- const latencyOption = charts.line(this, xDates, yLatencyVol, latencyDatas)
- latencyOption.yAxis.axisLabel.formatter = (val) => {
- if (val / 1000 < 1000) {
- return `${val / 1000}`
- } else {
- return `${val / 1000 / 1000}K`
- }
- }
- latencyOption.grid.left = 38
- latencyOption.yAxis.name = this.$t('latencyUnit')
- latencyOption.tooltip.trigger = 'axis'
- latencyOption.tooltip.formatter = (vals) => {
- return `<span>${vals[0].name}: ${vals[0].data / 1000} ${this.$t('latencyUnit')}</span>`
- }
- this.latencyChart.setOption(latencyOption)
- this.processingChart = echarts.init(processingId)
- const processingOption = charts.line(this, xDates, yProcessingVol, processingDatas)
- processingOption.yAxis.axisLabel.formatter = (val) => {
- if (val / 1000 < 1000) {
- return `${val / 1000}`
- } else {
- return `${val / 1000 / 1000}K`
- }
- }
- processingOption.grid.left = 38
- processingOption.yAxis.name = this.$t('processingUnit')
- processingOption.tooltip.trigger = 'axis'
- processingOption.tooltip.formatter = (vals) => {
- return `<span>${vals[0].name}: ${vals[0].data / 1000} ${this.$t('processingUnit')}</span>`
- }
- this.processingChart.setOption(processingOption)
- })
- } else {
- this.isNoStatisticsData = true
- }
- }
- handleChangeTab (tab) {
- if (tab.name === 'records') {
- this.getRecordsData()
- } else {
- this.getChartData()
- }
- }
- tableRowClassName ({row, rowIndex}) {
- if (row.uuid === this.selectedJob.uuid && this.showStep) {
- return 'current-row2'
- }
- }
- gotoModelList (item) {
- // 暂停轮询,清掉计时器
- clearTimeout(this.stCycle)
- this.isPausePolling = true
- // 如果是全 project 模式,需要先改变当前 project 选中值
- if (this.$store.state.project.isAllProject) {
- this.setProject(item.project)
- }
- this.$router.push({name: 'ModelList', params: { modelAlias: item.model_alias }})
- }
- // 查询状态过滤回调函数
- filterContent (val, type) {
- const maps = {
- job_types: 'JobType',
- status: 'ProgressStatus',
- model_names: 'TargetObject'
- }
-
- this.filterTags = this.filterTags.filter((item, index) => item.key !== type || item.key === type && val.includes(item.label))
- const list = this.filterTags.filter(it => it.key === type).map(it => it.label)
- val.length && val.forEach(item => {
- if (!list.includes(item)) {
- let label
- if (type === 'model_names') {
- label = item
- } else {
- label = this.$t(item)
- }
- this.filterTags.push({label: label, source: maps[type], key: type})
- }
- })
- this.filter[type] = val
- this.filter.page_offset = 0
- this.manualRefreshJobs()
- }
- getRecordsData () {
- this.getStreamingJobRecords({project: this.selectedJob.project, job_id: this.selectedJob.uuid}).then((res) => {
- handleSuccess(res, (data) => {
- this.selectedJobRecords = data
- }, (resError) => {
- handleError(resError)
- })
- })
- }
- getChartData () {
- this.getStreamingChartData({project: this.selectedJob.project, job_id: this.selectedJob.uuid, time_filter: this.time_filter}).then((res) => {
- handleSuccess(res, (data) => {
- this.initLineChart(data)
- })
- }, (resError) => {
- handleError(resError)
- })
- }
- getJobsList () {
- return new Promise((resolve, reject) => {
- if (!this.currentSelectedProject) return reject()
- let data = {}
- const statuses = this.filter.status.join(',')
- Object.keys(this.filter).forEach(key => key !== 'status' && (data[key] = this.filter[key]))
- this.loadStreamingJobsList({...data, statuses}).then((res) => {
- handleSuccess(res, (data) => {
- if (data.total_size) {
- this.jobsList = data.value
- if (this.selectedJob) {
- const selectedIndex = indexOfObjWithSomeKey(this.jobsList, 'uuid', this.selectedJob.uuid)
- if (selectedIndex !== -1) {
- this.selectedJob = this.jobsList[selectedIndex]
- if (this.jobDetailTab === 'records') {
- this.getRecordsData()
- } else {
- this.getChartData()
- }
- }
- }
- if (this.multipleSelection.length) {
- const cloneSelections = objectClone(this.multipleSelection)
- this.multipleSelection = []
- cloneSelections.forEach((m) => {
- const index = indexOfObjWithSomeKey(this.jobsList, 'uuid', m.uuid)
- if (index !== -1) {
- this.$nextTick(() => {
- this.$refs.streamingJobsTable.toggleRowSelection(this.jobsList[index])
- })
- }
- })
- }
- this.jobTotal = data.total_size
- } else {
- this.jobsList = []
- this.jobTotal = 0
- }
- this.searchLoading = false
- })
- resolve()
- }, (res) => {
- handleError(res)
- this.searchLoading = false
- reject()
- })
- })
- }
- loadList () {
- if (this.$store.state.project.isAllProject) {
- delete this.filter.project
- } else {
- this.filter.project = this.currentSelectedProject
- }
- return this.getJobsList()
- }
- manualRefreshJobs () {
- // 手动刷新部分,接口skip session 设为false
- this.filter.isAuto = false
- // this.waitingFilter.isAuto = false
- this.resetSelection()
- this.loadList()
- }
- refreshJobs () {
- if (!this.isPausePolling) {
- return this.loadList()
- } else {
- return new Promise((resolve) => {
- resolve()
- })
- }
- }
- autoFilter () {
- if (this.stCycle) {
- this.filter.isAuto = true
- }
- clearTimeout(this.stCycle)
- this.stCycle = setTimeout(() => {
- this.refreshJobs().then((res) => {
- handleSuccess(res, (data) => {
- if (this._isDestroyed) {
- return
- }
- this.autoFilter()
- })
- }, (res) => {
- handleError(res)
- })
- }, 5000)
- }
- async loadModelObjectList (filterValue) {
- try {
- const data = { project: this.currentSelectedProject, model_name: filterValue, page_size: 100 }
- if (this.$store.state.project.isAllProject) {
- delete data.project
- }
- const res = await this.getModelObjectList(data)
- this.modelFilteArr = await handleSuccessAsync(res)
- } catch (e) {
- handleError(e)
- }
- }
- created () {
- // const { modelAlias, jobStatus } = this.$route.query
- // modelAlias && (this.filter.subject = modelAlias)
- // jobStatus && (this.filter.status = jobStatus)
- // this.selectedJob = {} // 防止切换project时,发一个不存在该项目jobId的jobDetail的请求
- this.filter.project = this.currentSelectedProject
- if (this.currentSelectedProject) {
- this.autoFilter()
- this.getJobsList()
- this.loadModelObjectList()
- }
- }
- isShowJobBtn (e) {
- if (!e) return
- const sTop = e.target.scrollTop
- const rightDetailH = document.getElementById('rightDetail') && document.getElementById('rightDetail').clientHeight
- let jobBtn = document.getElementById('jobDetailBtn')
- if (jobBtn) {
- const top = sTop > (rightDetailH - 20) ? rightDetailH - 70 : sTop
- jobBtn.style.cssText = `top: ${top + 20}px;`
- }
- }
- mounted () {
- if (document.getElementById('scrollContent')) {
- document.getElementById('scrollContent').addEventListener('scroll', this.isShowJobBtn, false)
- }
- }
- beforeDestroy () {
- clearTimeout(this.stCycle)
- if (document.getElementById('scrollContent')) {
- document.getElementById('scrollContent').removeEventListener('scroll', this.isShowJobBtn, false)
- }
- }
- showDiagnosisDetail (id) {
- this.diagnosticId = id
- this.showDiagnostic = true
- }
-}
-</script>
-
-<style lang="less">
- @import '../../../assets/styles/variables.less';
- #streamingJobListPage {
- .jobs_tools_row {
- font-size: 0px;
- }
- .show-search-btn {
- width: 248px;
- }
- .streaming-jobs-table {
- .icon-column {
- .cell {
- padding-left: 5px;
- padding-right: 5px;
- }
- }
- .el-ksd-icon-arrow_table_right_22,
- .el-ksd-icon-arrow_table_down_22 {
- color: @text-disabled-color;
- }
- .link{
- text-decoration: underline;
- color:@base-color;
- }
- .el-ksd-icon-controller_22,
- .el-ksd-icon-log_22 {
- cursor: pointer;
- }
- }
- #rightDetail {
- width: 410px;
- border-radius: 0;
- box-shadow: -3px 3px 5px @ke-color-secondary;
- border: 0;
- padding: 16px 0 16px 16px !important;
- min-height: calc(~'100vh - 168px');
- position: relative;
- &.is-admin-tips {
- min-height: calc(~'100vh - 205px');
- }
- .el-tabs__content {
- overflow: visible;
- min-height: calc(~'100vh - 260px');
- .el-radio-group {
- position: absolute;
- right: 0px;
- }
- }
- .job-btn {
- position: absolute;
- // right: 345px;
- left: -9px;
- top: 20px;
- height: 24px;
- width: 24px;
- border-radius: 100%;
- box-shadow: 0px 2px 8px rgba(50, 73, 107, 0.24);
- cursor: pointer;
- text-align: center;
- background-color: @fff;
- z-index: 10;
- &.is-filter-list {
- top: 270px;
- }
- i {
- font-size: 16px;
- margin-top: 2px;
- }
- &:hover {
- background-color: @ke-color-primary-hover;
- i {
- color: @fff;
- }
- }
- &:active {
- background-color: @ke-color-primary-active;
- }
- }
- .chart-title {
- color: @text-title-color;
- font-size: 14px;
- line-height: 22px;
- margin-bottom: 12px;
- }
- .data-chart {
- height: 125px;
- }
- .record-title {
- color: @text-normal-color;
- font-size: 14px;
- line-height: 22px;
- font-weight: @font-medium;
- margin-top: 24px;
- }
- }
- #leftStreamingTableBox {
- width: 100%;
- &.show-steps {
- width: calc(~'100% - 410px');
- }
- }
- }
- .configurations-dialog {
- .error-msg {
- color: @ke-color-danger;
- }
- .is-mul-key .el-input__inner,
- .is-empty .el-input__inner{
- border-color: #E03B3B;
- box-shadow: 0px 0px 0px 2px rgba(218, 8, 8, 0.1);
- }
- }
-</style>
diff --git a/kystudio/src/components/project/project_list.vue b/kystudio/src/components/project/project_list.vue
index e0403af7bc..db8f702288 100644
--- a/kystudio/src/components/project/project_list.vue
+++ b/kystudio/src/components/project/project_list.vue
@@ -2,7 +2,7 @@
<div class="paddingbox" id="project-list">
<div class="ksd-title-label ksd-mt-20">{{$t('projectsList')}}</div>
<div>
- <el-button type="primary" size="medium" class="ksd-mb-10 ksd-mt-10" icon="el-ksd-icon-add_22" v-if="projectActions.includes('addProject')" @click="newProject">{{$t('kylinLang.common.project')}}</el-button>
+ <el-button type="primary" size="medium" class="ksd-mb-10 ksd-mt-10" icon="el-ksd-icon-add_22" v-if="projectActions.includes('addProject')" @click="newProject">{{$t('kylinLang.common.new')}}</el-button>
<div style="width:240px;" class="ksd-fright ksd-mtb-10">
<el-input class="show-search-btn"
size="medium"
@@ -182,13 +182,13 @@ import { Component } from 'vue-property-decorator'
delProjectTitle: 'Delete Project',
cancel: 'Cancel',
yes: 'Ok',
- saveSuccessful: 'Added the project successfully.',
- saveFailed: 'Can\'t add the project at the moment.',
+ saveSuccessful: 'Created the project successfully.',
+ saveFailed: 'Can\'t create the project at the moment.',
deleteProjectTip: 'The project "{projectName}" cannot be restored after deletion. Are you sure you want to delete?',
projectConfig: 'Configuration',
backupProject: 'Are you sure you want to backup this project ?',
- noProject: 'No project was found. Please click the button to add a project.',
- projectsList: 'Project List',
+ noProject: 'No project was found. Please click the button to new a project.',
+ projectsList: 'Project',
projectFilter: 'Search by project name',
backupPro: 'Backup Project',
author: 'Authorization',
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAddModal/addmodel.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAddModal/addmodel.vue
index e0c1a5bee2..a6bd3e06d1 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAddModal/addmodel.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAddModal/addmodel.vue
@@ -18,7 +18,7 @@
</el-form>
<div slot="footer" class="dialog-footer ky-no-br-space">
<el-button @click="closeModal" size="medium">{{$t('kylinLang.common.cancel')}}</el-button>
- <el-button type="primary" @click="submit" :loading="btnLoading" size="medium">{{$t('kylinLang.common.submit')}}</el-button>
+ <el-button type="primary" @click="submit" :loading="btnLoading" size="medium">{{$t('kylinLang.common.create')}}</el-button>
</div>
</el-dialog>
</template>
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
index d56c6e5a0b..f80774ee07 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelLayout/modelLayout.vue
@@ -109,9 +109,6 @@
<el-tab-pane class="tab-pane-item" :label="$t('developers')" name="fifth">
<Developers v-if="currentModelRow.tabTypes === 'fifth'" :currentModelRow="currentModelRow"/>
</el-tab-pane>
- <!-- <el-tab-pane class="tab-pane-item" :label="$t('streaming')" name="streaming" v-if="currentModelRow.model_type !== 'BATCH'">
- <ModelStreamingJob v-if="currentModelRow.tabTypes === 'streaming'" class="ksd-mrl-15 ksd-mt-15" :model="currentModelRow.uuid"/>
- </el-tab-pane> -->
</el-tabs>
<!-- 模型构建 -->
@@ -154,7 +151,6 @@ import ModelActions from '../ModelActions/modelActions'
import ModelRenameModal from '../ModelRenameModal/rename.vue'
import ModelCloneModal from '../ModelCloneModal/clone.vue'
import ModelPartition from '../ModelPartition/index.vue'
-import ModelStreamingJob from '../ModelStreamingJob/ModelStreamingJob.vue'
import ModelTitleDescription from '../Components/ModelTitleDescription'
@Component({
@@ -224,7 +220,6 @@ import ModelTitleDescription from '../Components/ModelTitleDescription'
ModelRenameModal,
ModelCloneModal,
ModelPartition,
- ModelStreamingJob,
ModelTitleDescription
},
locales
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/ModelStreamingJob.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/ModelStreamingJob.vue
deleted file mode 100644
index 8398ed175c..0000000000
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/ModelStreamingJob.vue
+++ /dev/null
@@ -1,362 +0,0 @@
-<template>
- <div class="streaming-job">
- <div class="ksd-title-label-small streaming-header">
- <span>{{$t('streaming')}}</span>
- <div class="actions">
- <el-button @click="refreshJobInfo" type="primary" :loading="isRefreshJobInfoLoading" text>{{$t('refresh')}}</el-button>
- <el-button @click="stopStreaming" type="primary" :loading="isStopLoading" icon="el-icon-ksd-stop" :disabled="isDisabled" text v-if="statusOptions.streamingIngestion === 'RUNNING' || statusOptions.autoMerge === 'RUNNING'">{{$t('stop')}}</el-button><el-button @click="startStreaming" type="primary" :loading="isStartLoading" icon="el-icon-ksd-restart" text v-else :disabled="isDisabled">{{$t('restart')}}</el-button><el-dropdown trigger="click" class="ksd-ml-10" @command="handleCommand">
- <el-button type="primary" icon="el-icon-ksd-configurations" text>{{$t('setting')}}</el-button>
- <el-dropdown-menu slot="dropdown">
- <!-- <el-dropdown-item command="log">{{$t('logDetails')}}</el-dropdown-item> -->
- <el-dropdown-item command="configurations">{{$t('configurations')}}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <!-- <span class="item" @click="startStreaming"><i class="el-icon-ksd-table_resume ksd-mr-5"></i>{{$t('restart')}}</span>
- <span class="item" @click="stopStreaming"><i class="el-icon-ksd-login_intro ksd-mr-5"></i>{{$t('setting')}}</span> -->
- </div>
- </div>
- <el-row :gutter="15" class="ksd-mt-10">
- <el-col :span="5">
- <div class="job-info">
- <div class="job-sub-title ksd-mb-15">{{$t('status')}}</div>
- <p class="contain job-status" v-for="item in Object.keys(statusOptions)" :key="item">
- <span class="title">{{$t(item)}}:</span>
- <span class="status"><span :class="['flag', statusOptions[item].toLocaleLowerCase(), 'ksd-mr-5']"></span><span>{{$t(statusOptions[item])}}</span></span>
- </p>
- </div>
- </el-col>
- <el-col :span="8">
- <div class="job-info">
- <div class="job-sub-title ksd-mb-15">{{$t('metrics')}}</div>
- <p class="contain average-metrics" v-for="item in Object.keys(metricsOptions)" :key="item">
- <span class="title">{{$t(item)}}</span>
- <span>{{metricsOptions[item]}}</span>
- </p>
- </div>
- </el-col>
- <el-col :span="11">
- <div class="job-info">
- <div class="job-sub-title ksd-mb-15">{{$t('dataIngestion')}}</div>
- <p class="contain dataIngestion" v-for="item in Object.keys(dataIngestionOptions)" :key="item">
- <span class="title">{{$t(item)}}</span>
- <span>{{dataIngestionOptions[item]}}</span>
- </p>
- </div>
- </el-col>
- </el-row>
- <el-dialog
- :title="$t('configurations')"
- append-to-body
- class="configurations-dialog"
- :close-on-press-escape="false"
- :close-on-click-modal="false"
- :visible.sync="showConfigurations"
- @close="handleClose"
- width="480px">
- <div>
- <el-tabs v-model="paramsTab" type="card" @tab-click="handleClickTab">
- <el-tab-pane :label="tab.label" :name="tab.name" v-for="tab in paramsConfigTabs" :key="tab.name">
- <el-row :gutter="10">
- <el-col :span="14"><span class="title">{{$t('key')}}</span></el-col>
- <el-col :span="6"><span class="title">{{$t('value')}}</span></el-col>
- <el-col :span="4"></el-col>
- </el-row>
- <el-row :gutter="10" class="ksd-mt-10" v-for="(item, index) in tab.config" :key="index">
- <el-col :span="14"><el-input v-model.trim="tab.config[index][0]" :disabled="tab.config[index] && !!tab.config[index][2]" :placeholder="$t('pleaseInputKey')" /></el-col>
- <el-col :span="6">
- <el-input v-number2="tab.config[index][1]" v-model.trim="tab.config[index][1]" :placeholder="$t('pleaseInputValue')" :class="{'is-empty': !tab.config[index][1]}" v-if="numberParams.indexOf(item[0]) !== -1"></el-input>
- <el-input v-else v-model.trim="tab.config[index][1]" :class="{'is-empty': !tab.config[index][1]}" :placeholder="$t('pleaseInputValue')" />
- </el-col>
- <!-- <el-col :span="4">
- <span class="action-btns ksd-ml-5">
- <el-button type="primary" icon="el-icon-ksd-add_2" plain circle size="mini" @click="addParamsConfigs(tab.type)"></el-button>
- <el-button icon="el-icon-minus" class="ksd-ml-5" plain circle size="mini" :disabled="tab.config.length === 1 && index === 0 || (tab.config[index] && !!tab.config[index][2])" @click="removeParamsConfigs(tab.type, index)"></el-button>
- </span>
- </el-col> -->
- </el-row>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div slot="footer" class="dialog-footer ky-no-br-space">
- <el-button plain @click="handleClose">{{$t('kylinLang.common.cancel')}}</el-button>
- <el-button type="primary" :loading="loadingSetting" @click="saveSettings">{{$t('kylinLang.common.save')}}</el-button>
- </div>
- </el-dialog>
- </div>
-</template>
-
-<script>
-import Vue from 'vue'
-import { Component } from 'vue-property-decorator'
-import { handleSuccessAsync, handleError } from 'util/index'
-import { mapActions, mapGetters } from 'vuex'
-import locales from './locales'
-import { kylinConfirm, objectClone, transToGmtTime } from '../../../../../util'
-
-@Component({
- name: 'ModelStreamingJob',
- props: ['model'],
- locales,
- computed: {
- ...mapGetters([
- 'currentSelectedProject'
- ])
- },
- methods: {
- ...mapActions({
- getStreamingJob: 'GET_STREAMING_JOB',
- changeStreamingJobStatus: 'CHANGE_STREAMING_JOB_STATUS',
- updateStreamingConfig: 'UPDATE_STREAMING_CONFIGURATIONS'
- })
- }
-})
-export default class ModelStreamingJob extends Vue {
- statusOptions = {
- streamingIngestion: '',
- autoMerge: ''
- }
- metricsOptions = {
- avg_consume_rate_in_5mins: '-',
- avg_consume_rate_in_15mins: '-',
- avg_consume_rate_in_30mins: '-',
- avg_consume_rate_in_All: '-'
- }
- dataIngestionOptions = {
- last_build_time: '-',
- last_update_time: '-',
- latency: '-'
- }
- loadingSetting = false
- showConfigurations = false
- isStartLoading = false
- isStopLoading = false
- isRefreshJobInfoLoading = false
- paramsTab = 'buildParams'
- buildParamsConfigs = [[]]
- buildParamsConfigsCache = [[]]
- mergeParamsConfigs = [[]]
- mergeParamsConfigsCache = [[]]
- commonParamsConfigs = [[]]
- buildDefaultParams = ['spark.master', 'spark.driver.memory', 'spark.executor.instances', 'spark.executor.cores', 'spark.executor.memory', 'spark.sql.shuffle.partitions', 'kylin.streaming.duration', 'kylin.streaming.job-retry-enabled', 'kylin.streaming.kafka-conf.maxOffsetsPerTrigger', 'kylin.streaming.watermark']
- mergeDefaultParams = ['spark.master', 'spark.driver.memory', 'spark.executor.instances', 'spark.executor.cores', 'spark.executor.memory', 'spark.sql.shuffle.partitions', 'kylin.streaming.segment-max-size', 'kylin.streaming.segment-merge-threshold', 'kylin.streaming.job-retry-enabled']
- numberParams = ['spark.executor.cores', 'kylin.streaming.duration', 'spark.executor.instances', 'kylin.streaming.segment-merge-threshold']
- get paramsConfigTabs () {
- return [
- {label: this.$t('streamingIngestion'), name: 'buildParams', config: this.buildParamsConfigs, type: 'build', actions: {add: this.addParamsConfigs, remove: this.removeParamsConfigs}},
- {label: this.$t('autoMerge'), name: 'mergeParams', config: this.mergeParamsConfigs, type: 'merge', actions: {add: this.addParamsConfigs, remove: this.removeParamsConfigs}}
- // {label: 'p3', name: 'commonParams', config: this.commonParamsConfigs, type: 'common', actions: {add: this.addParamsConfigs, remove: this.removeParamsConfigs}}
- ]
- }
- get isDisabled () {
- return this.statusOptions.streamingIngestion === 'STARTING' || this.statusOptions.streamingIngestion === 'STOPPING' || this.statusOptions.autoMerge === 'STARTING' || this.statusOptions.autoMerge === 'STOPPING'
- }
- refreshJobInfo () {
- this.initData()
- }
- initData () {
- this.getStreamingJob({project: this.currentSelectedProject, model_id: this.model}).then(async (res) => {
- const results = await handleSuccessAsync(res)
- const { build_job_meta, merge_job_meta, avg_consume_rate_in_5mins, avg_consume_rate_in_15mins, avg_consume_rate_in_30mins, avg_consume_rate_in_All, last_update_time, last_build_time, latency } = results
- this.metricsOptions = {
- avg_consume_rate_in_5mins: avg_consume_rate_in_5mins > 10000 ? (avg_consume_rate_in_5mins / 1000).toFixed(2) + ' kmsg/s' : avg_consume_rate_in_5mins.toFixed(2) + ' msg/s',
- avg_consume_rate_in_15mins: avg_consume_rate_in_15mins > 10000 ? (avg_consume_rate_in_15mins / 1000).toFixed(2) + ' kmsg/s' : avg_consume_rate_in_15mins.toFixed(2) + ' msg/s',
- avg_consume_rate_in_30mins: avg_consume_rate_in_30mins > 10000 ? (avg_consume_rate_in_30mins / 1000).toFixed(2) + ' kmsg/s' : avg_consume_rate_in_30mins.toFixed(2) + ' msg/s',
- avg_consume_rate_in_All: avg_consume_rate_in_All > 10000 ? (avg_consume_rate_in_All / 1000).toFixed(2) + ' kmsg/s' : avg_consume_rate_in_All.toFixed(2) + ' msg/s'
- }
- this.dataIngestionOptions = {
- last_build_time: last_build_time ? transToGmtTime(last_build_time) : '-',
- last_update_time: last_update_time ? transToGmtTime(last_update_time) : '-',
- latency: latency ? (latency / 60 / 1000).toFixed(2) + ' mins' : '-'
- }
- this.statusOptions.streamingIngestion = build_job_meta.job_status === 'NEW' ? 'STOPPED' : build_job_meta.job_status
- this.statusOptions.autoMerge = merge_job_meta.job_status === 'NEW' ? 'STOPPED' : merge_job_meta.job_status
- this.buildParamsConfigs = Object.entries(build_job_meta.params).map(it => ([...it, this.buildDefaultParams.indexOf(it[0]) !== -1]))
- this.buildParamsConfigsCache = objectClone(this.buildParamsConfigs)
- this.mergeParamsConfigs = Object.entries(merge_job_meta.params).map(it => ([...it, this.mergeDefaultParams.indexOf(it[0]) !== -1]))
- this.mergeParamsConfigsCache = objectClone(this.mergeParamsConfigs)
- }).catch((e) => {
- handleError(e)
- })
- }
- // 开启任务
- async startStreaming () {
- if (this.isStartLoading) return
- try {
- this.isStartLoading = true
- const res = await this.changeStreamingJobStatus({project: this.currentSelectedProject, model_id: this.model, action: 'START'})
- await handleSuccessAsync(res)
- this.isStartLoading = false
- this.initData()
- } catch (e) {
- this.isStartLoading = false
- handleError(e)
- this.initData()
- }
- }
- // 终止任务
- async stopStreaming () {
- if (this.isStopLoading) return
- await kylinConfirm(this.$t('cofirmStopStreaming'), {confirmButtonText: this.$t('stop')}, this.$t('stopStreamingTitle'))
- try {
- this.isStopLoading = true
- const res = await this.changeStreamingJobStatus({project: this.currentSelectedProject, model_id: this.model, action: 'STOP'})
- await handleSuccessAsync(res)
- this.isStopLoading = false
- this.initData()
- } catch (e) {
- this.isStopLoading = false
- handleError(e)
- this.initData()
- }
- }
- handleCommand (command) {
- if (command === 'configurations') {
- this.showConfigurations = true
- this.buildParamsConfigs = objectClone(this.buildParamsConfigsCache)
- this.mergeParamsConfigs = objectClone(this.mergeParamsConfigsCache)
- }
- }
- // 关闭配置弹窗
- handleClose () {
- this.showConfigurations = false
- this.initData()
- }
- // 更新配置
- saveSettings () {
- this.loadingSetting = true
- const buildParams = {}
- const mergeParams = {}
- this.buildParamsConfigs.forEach(item => {
- buildParams[item[0]] = item[1]
- })
- this.mergeParamsConfigs.forEach(item => {
- mergeParams[item[0]] = item[1]
- })
- this.updateStreamingConfig({project: this.currentSelectedProject, model_id: this.model, build_params: buildParams, merge_params: mergeParams}).then(() => {
- this.loadingSetting = false
- this.handleClose()
- }).catch((e) => {
- handleError(e)
- this.loadingSetting = false
- })
- }
- // 增加配置
- addParamsConfigs (type) {
- this[`${type}ParamsConfigs`].push([])
- }
- // 删减配置
- removeParamsConfigs (type, index) {
- this[`${type}ParamsConfigs`].splice(index, 1)
- }
- handleClickTab () {
- }
- created () {
- this.initData()
- }
-}
-</script>
-<style lang="less">
- @import '../../../../../assets/styles/variables.less';
- .streaming-job {
- margin: 15px;
- padding: 15px;
- box-shadow: none;
- border: 1px solid @line-border-color4;
- background-color: @fff;
- .streaming-header {
- position: relative;
- .actions {
- position: absolute;
- top: 0;
- right: 0;
- .item {
- padding: 0 5px;
- cursor: pointer;
- &:hover {
- color: @color-primary;
- }
- }
- }
- }
- .job-info {
- padding: 15px;
- background-color: @regular-background-color;
- font-size: 12px;
- box-sizing: border-box;
- .job-sub-title {
- color: @color-text-secondary;
- }
- .contain {
- margin-bottom: 10px;
- &.average-metrics {
- display: inline-block;
- width: 50%;
- margin-bottom: 10px;
- &:nth-last-child(2) {
- margin-bottom: 0;
- }
- }
- &.dataIngestion {
- display: inline-block;
- margin-bottom: 10px;
- margin-right: 30px;
- &:nth-last-child(2) {
- margin-bottom: 0;
- }
- }
- .title {
- color: @color-text-primary;
- font-size: 12px;
- font-weight: bold;
- }
- &.job-status {
- .title {
- width: 120px;
- display: inline-block;
- }
- }
- .status {
- color: @color-text-primary;
- font-size: 12px;
- font-weight: bold;
- display: inline-flex;
- align-items: center;
- vertical-align: top;
- }
- &:last-child {
- margin-bottom: 0;
- }
- .flag {
- display: inline-block;
- width: 12px;
- height: 12px;
- border-radius: 100%;
- &.running {
- background: @color-success;
- }
- &.error {
- background: @error-color-1;
- }
- &.stopped {
- background: @color-text-disabled;
- }
- &.starting,
- &.stopping {
- background: @base-color;
- }
- }
- }
- }
- }
- .configurations-dialog {
- .action-btns {
- .el-button {
- // margin-top: 3px;
- }
- }
- .el-dialog__body {
- max-height: 350px;
- overflow: auto;
- }
- }
-</style>
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/locales.js
deleted file mode 100644
index 8365fc6040..0000000000
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelStreamingJob/locales.js
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- 'en': {
- streaming: 'Streaming',
- status: 'Status',
- streamingIngestion: 'Data Ingestion',
- autoMerge: 'Auto-Merge',
- RUNNING: 'Running',
- ERROR: 'Error',
- STOPPED: 'Stopped',
- STARTING: 'Restarting',
- STOPPING: 'Stopping',
- metrics: 'Metrics',
- avg_consume_rate_in_5mins: '5 Minute Rate: ',
- avg_consume_rate_in_15mins: '15 Minutes Rate: ',
- avg_consume_rate_in_30mins: '30 Minutes Rate: ',
- avg_consume_rate_in_All: 'Ave Rate: ',
- dataIngestion: 'Last Event Time: ',
- last_build_time: 'Event Time: ',
- last_update_time: 'Processing Finish Time: ',
- latency: 'Data Latency: ',
- restart: 'Restart',
- stop: 'Stop',
- refresh: 'Refresh',
- setting: 'Setting',
- logDetails: 'Logs',
- configurations: 'Configurations',
- key: 'Key',
- value: 'Value',
- pleaseInputKey: 'Please enter the key',
- pleaseInputValue: 'Please enter the value',
- cofirmStopStreaming: 'Are you sure you want to stop the streaming job?',
- stopStreamingTitle: 'Stop Job'
- }
-}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
index 3e246bfeef..57c4a18ff3 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/index.vue
@@ -1,21 +1,11 @@
<template>
<div class="mode-list" :class="{'full-cell': showFull}" id="modelListPage">
- <div class="ksd-title-page ksd-mt-32">{{$t('kylinLang.model.modelList')}}</div>
- <div class="model-list-contain ksd-mt-16">
- <div class="clearfix">
- <div class="ksd-fright">
- <el-input :placeholder="$t('filterModelOrOwner')" style="width:250px" size="medium" :prefix-icon="searchLoading? 'el-ksd-icon-loading_22':'el-ksd-icon-search_22'" :value="filterArgs.model_alias_or_owner" @input="handleFilterInput" v-global-key-event.enter.debounce="searchModels" @clear="searchModels()" class="show-search-btn" >
- </el-input>
- <el-button
- text
- class="filter-button"
- type="primary"
- @click="handleToggleFilters">
- <span>{{$t('filterButton')}}</span>
- <i :class="['el-ksd-icon-arrow_up_22', isShowFilters && 'reverse']" />
- </el-button>
- </div>
- <div class="ky-no-br-space model-list-header clearfix">
+ <div class="clearfix ksd-mt-32">
+ <div class="ksd-fleft">
+ <div class="ksd-title-page">{{$t('kylinLang.model.modelList')}}</div>
+ </div>
+ <div class="ksd-fright">
+ <div class="ky-no-br-space model-list-header">
<el-dropdown
split-button
class="ksd-fleft"
@@ -25,7 +15,7 @@
placement="bottom-start"
btn-icon="el-ksd-icon-add_22"
v-if="datasourceActions.includes('modelActions')"
- @click="showAddModelDialog">{{$t('kylinLang.common.model')}}
+ @click="showAddModelDialog">{{$t('kylinLang.common.new')}}
<el-dropdown-menu slot="dropdown" class="model-actions-dropdown">
<el-dropdown-item
v-if="metadataActions.includes('executeModelMetadata')"
@@ -41,49 +31,58 @@
</common-tip>
</div>
</div>
- <div class="table-filters clearfix ksd-mt-24" v-show="isShowFilters">
- <DropdownFilter
- type="checkbox"
- trigger="click"
- :value="filterArgs.status"
- hideArrow
- @input="v => filterContent(v, 'status')"
- :options="[
- { renderLabel: renderStatusLabel, value: 'ONLINE' },
- { renderLabel: renderStatusLabel, value: 'OFFLINE' },
- { renderLabel: renderStatusLabel, value: 'BROKEN' },
- { renderLabel: renderStatusLabel, value: 'WARNING' },
- ]">
- <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('status_c')}}{{selectedStatus}}</el-button>
- </DropdownFilter>
- <DropdownFilter
- class="ksd-ml-8"
- type="datetimerange"
- trigger="click"
- :value="filterArgs.last_modify"
- hideArrow
- :shortcuts="['lastDay', 'lastWeek', 'lastMonth']"
- @input="v => filterContent(v, 'last_modify')">
- <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('lastModifyTime_c')}}{{selectedRange}}</el-button>
- </DropdownFilter>
- <DropdownFilter
- class="ksd-ml-8"
- type="checkbox"
- trigger="click"
- hideArrow
- :value="filterArgs.model_attributes"
- :options="modelAttributesOptions"
- @input="v => filterContent(v, 'model_attributes')">
- <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('modelType_c')}}{{selectedModelAttributes}}</el-button>
- </DropdownFilter>
- <div class="actions">
- <el-button
- text
- type="primary"
- icon="el-ksd-icon-resure_22"
- class="reset-filters-btn"
- :disabled="isResetFilterDisabled"
- @click="handleResetFilters">{{$t('reset')}}</el-button>
+ </div>
+ <div class="model-list-contain ksd-mt-16">
+ <!-- <div class="layout-mask" v-if="loadingModels"></div> -->
+ <div class="clearfix">
+ <div class="table-filters ksd-fleft">
+ <DropdownFilter
+ type="checkbox"
+ trigger="click"
+ :value="filterArgs.status"
+ hideArrow
+ @input="v => filterContent(v, 'status')"
+ :options="[
+ { renderLabel: renderStatusLabel, value: 'ONLINE' },
+ { renderLabel: renderStatusLabel, value: 'OFFLINE' },
+ { renderLabel: renderStatusLabel, value: 'BROKEN' },
+ { renderLabel: renderStatusLabel, value: 'WARNING' },
+ ]">
+ <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('status_c')}}{{selectedStatus.length > 1 ? `${selectedStatus[0]} +${selectedStatus.length - 1}` : selectedStatus.join('')}}</el-button>
+ </DropdownFilter>
+ <DropdownFilter
+ class="ksd-ml-8"
+ type="datetimerange"
+ trigger="click"
+ :value="filterArgs.last_modify"
+ hideArrow
+ :shortcuts="['lastDay', 'lastWeek', 'lastMonth']"
+ @input="v => filterContent(v, 'last_modify')">
+ <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('lastModifyTime_c')}}{{selectedRange}}</el-button>
+ </DropdownFilter>
+ <DropdownFilter
+ class="ksd-ml-8"
+ type="checkbox"
+ trigger="click"
+ hideArrow
+ :value="filterArgs.model_attributes"
+ :options="modelAttributesOptions"
+ @input="v => filterContent(v, 'model_attributes')">
+ <el-button text type="primary" iconr="el-ksd-icon-arrow_down_22">{{$t('modelType_c')}}{{selectedModelAttributes.length > 1 ? `${selectedModelAttributes[0]} +${selectedModelAttributes.length - 1}` : selectedModelAttributes.join('')}}</el-button>
+ </DropdownFilter>
+ <div class="actions">
+ <el-button
+ text
+ type="primary"
+ icon="el-ksd-icon-resure_22"
+ class="reset-filters-btn"
+ :disabled="isResetFilterDisabled"
+ @click="handleResetFilters">{{$t('reset')}}</el-button>
+ </div>
+ </div>
+ <div class="ksd-fright">
+ <el-input :placeholder="$t('filterModelOrOwner')" style="width:250px" size="medium" :prefix-icon="searchLoading? 'el-ksd-icon-loading_22':'el-ksd-icon-search_22'" :value="filterArgs.model_alias_or_owner" @input="handleFilterInput" v-global-key-event.enter.debounce="searchModels" @clear="searchModels()" class="show-search-btn" >
+ </el-input>
</div>
</div>
<el-table class="model_list_table"
@@ -513,9 +512,7 @@ export default class ModelList extends Vue {
}
get selectedStatus () {
const { filterArgs } = this
- return filterArgs.status.length && this.statusList.length !== filterArgs.status.length
- ? filterArgs.status.map(status => this.$t(status)).join(', ')
- : this.$t('ALL')
+ return filterArgs.status
}
get selectedRange () {
const { filterArgs } = this
@@ -525,13 +522,11 @@ export default class ModelList extends Vue {
const endDate = dayjs(endTime).format('YYYY-MM-DD HH:mm:ss')
return `${startDate} - ${endDate}`
}
- return this.$t('allTimeRange')
+ return ''
}
get selectedModelAttributes () {
const { filterArgs } = this
- return filterArgs.model_attributes.length && this.modelTypeList.length !== filterArgs.model_attributes.length
- ? filterArgs.model_attributes.map(attributes => this.$t(attributes)).join(', ')
- : this.$t('ALL')
+ return filterArgs.model_attributes
}
get isResetFilterDisabled () {
return !this.filterArgs.last_modify.length && !this.filterArgs.status.length && !this.filterArgs.model_attributes.length
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/locales.js
index a05c38a8df..c73e7e054c 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/locales.js
@@ -53,11 +53,11 @@ export default {
ONLINE: 'ONLINE',
OFFLINE: 'OFFLINE',
BROKEN: 'BROKEN',
- status_c: 'Status: ',
- modelType_c: 'Model Attributes: ',
+ status_c: 'Status ',
+ modelType_c: 'Model Attributes ',
others: 'Others',
reset: 'Reset',
- lastModifyTime_c: 'Last Updated Time: ',
+ lastModifyTime_c: 'Last Updated Time ',
lastBuildTime: 'Last Build Time: ',
allTimeRange: 'All Time Range',
filterButton: 'Filter',
diff --git a/kystudio/src/components/studio/snapshot/locales.js b/kystudio/src/components/studio/snapshot/locales.js
index 88b73e4344..2345e3056c 100644
--- a/kystudio/src/components/studio/snapshot/locales.js
+++ b/kystudio/src/components/studio/snapshot/locales.js
@@ -1,6 +1,6 @@
export default {
'en': {
- snapshotList: 'Snapshot List',
+ snapshotList: 'Snapshot',
snapshotDesc: 'The snapshot is a read-only static view of a source table. Snapshot could reduce costs for building costs in some cases.',
snapshotDesc1: 'Support independent query of dimension table. The snapshot will be used first to answer such queries.',
snapshotDesc2: 'The dimensions on the dimension table can also serve the query by adding the join key to the aggregate group without generating an index, thereby avoiding the problem of dimension explosion.',
diff --git a/kystudio/src/components/studio/snapshot/snapshot.vue b/kystudio/src/components/studio/snapshot/snapshot.vue
index 8bf289e2fe..3590dc06fa 100644
--- a/kystudio/src/components/studio/snapshot/snapshot.vue
+++ b/kystudio/src/components/studio/snapshot/snapshot.vue
@@ -3,18 +3,18 @@
<div class="ksd-title-page">{{$t('snapshotList')}}
<common-tip placement="bottom-start">
<div slot="content" class="snapshot-desc">
+ <div class="ksd-mb-8 snapshot-desc">{{$t('snapshotDesc')}}</div>
<p>* {{$t('snapshotDesc1')}}</p>
<p>* {{$t('snapshotDesc2')}}</p>
<p>* {{$t('snapshotDesc3')}}</p>
</div>
<i class="el-ksd-icon-more_info_22 snapshot-icon ksd-fs-22"></i>
</common-tip>
+ <el-button type="primary" class="ksd-fright" icon="el-ksd-icon-add_22" @click="addSnapshot">{{$t('kylinLang.common.add')}}</el-button>
</div>
- <div class="ksd-mb-16 snapshot-desc">{{$t('snapshotDesc')}}</div>
- <div class="clearfix">
+ <div class="ksd-mt-8 clearfix">
<div class="ksd-fleft ky-no-br-space" v-if="datasourceActions.includes('snapshotAction')">
- <el-button type="primary" class="ksd-mr-8 ksd-fleft" icon="el-ksd-icon-add_22" @click="addSnapshot">{{$t('snapshot')}}</el-button>
<div class="ke-it-other_actions ksd-fleft">
<el-button type="primary" text icon="el-ksd-icon-refresh_22" :disabled="!multipleSelection.length || hasEventAuthority('refresh')" @click="refreshSnapshot">{{$t('kylinLang.common.refresh')}}</el-button>
<el-button type="primary" text icon="el-ksd-icon-table_delete_22" :disabled="!multipleSelection.length || hasEventAuthority('delete')" @click="deleteSnap">{{$t('kylinLang.common.delete')}}</el-button>
diff --git a/kystudio/src/config/index.js b/kystudio/src/config/index.js
index bd269fe1d2..dd5eac9aa8 100644
--- a/kystudio/src/config/index.js
+++ b/kystudio/src/config/index.js
@@ -67,8 +67,7 @@ export const menusData = [
path: '/monitor',
icon: 'el-ksd-icon-nav_monitor_24',
children: [
- {name: 'job', path: '/monitor/job'},
- {name: 'streamingjob', path: '/monitor/streamingJob'}
+ {name: 'job', path: '/monitor/job'}
]
},
{
@@ -136,7 +135,6 @@ export const pageRefTags = {
projectDetail: 'projectDetail',
sqlListsPager: 'sqlListsPager',
jobPager: 'jobPager',
- streamingJobPager: 'streamingJobPager',
queryHistoryPager: 'queryHistoryPager',
queryResultPager: 'queryResultPager',
modleConfigPager: 'modleConfigPager',
diff --git a/kystudio/src/locale/en.js b/kystudio/src/locale/en.js
index 6dfce7ea6c..8fab4839b2 100644
--- a/kystudio/src/locale/en.js
+++ b/kystudio/src/locale/en.js
@@ -3,7 +3,7 @@ exports.default = {
common: {
// 常规操作
dialogHiveTreeNoData: 'Please click data source to load source tables',
- noProjectTips: 'You can click the button above to add a project',
+ noProjectTips: 'You can click the button above to new a project',
seconds: 'seconds',
minutes: 'minutes',
hours: 'hours',
@@ -26,6 +26,8 @@ exports.default = {
load: 'Load',
loadMetadata: 'Load metadata',
ok: 'OK',
+ create: 'Create',
+ new: 'New',
confirmClose: 'Turn Off',
exit: 'Exit',
retry: 'Retry',
@@ -236,7 +238,7 @@ exports.default = {
modelName: 'Model Name',
computedColumn: 'Computed Column',
modelNameGrid: 'Model Name',
- modelList: 'Model List',
+ modelList: 'Model',
index: 'index',
indexGroup: 'Index Group',
tableIndex: 'table index',
@@ -297,7 +299,7 @@ exports.default = {
sameCCExpression1: 'In this model, there has been a computed column "',
sameCCExpression2: '" defined as expression.Please define another one.',
ccWrongPosition: 'The computed column should be defined in table "',
- addModel: 'Add Model',
+ addModel: 'New Model',
hasNoFact: 'Fact Table is mandatory for model',
cycleLinkTip: 'The join may lead some tables joining in a circle.',
aloneTableTip: '{aloneCount} tables haven\'t been joined with the fact table directly or via other dimension tables. The model may lose them if you continue to save the model anyway.',
@@ -364,7 +366,7 @@ exports.default = {
mustSelectProject: 'Please select a project first',
selectProject: 'Please select a project',
projectList: 'Project List',
- addProject: 'Add Project'
+ addProject: 'New Project'
},
query: {
saveQuery: 'Save Query',
@@ -484,7 +486,6 @@ exports.default = {
acceleration: 'Acceleration',
design: 'Studio',
job: 'Batch Job',
- streamingjob: 'Streaming Job',
cluster: 'Cluster',
admin: 'Admin',
user: 'User',
@@ -511,7 +512,7 @@ exports.default = {
notOtherChars: 'Not support special symbols (/:\\*?"<>|\')'
},
guide: {
- addProjectTip: 'When you add a new project, choose a proper project type is essential. To analysis based on multi-dimensional models, you may choose the AI augmented mode.',
+ addProjectTip: 'When you create a new project, choose a proper project type is essential. To analysis based on multi-dimensional models, you may choose the AI augmented mode.',
// loadTableTipAuto: 'The Kylin platform may need to connect with your source data. Choose your desired dataset and sync its schema. Here we use the SSB dataset to do further tasks.',
queryTipAuto: 'Once source tables synced, you can explore data among the SSB dataset.',
speedTipAuto: 'SQL statements in the Waiting List are filtered by the system. You can adjust these rules to manage accelerating workload.',
diff --git a/kystudio/src/router/index.js b/kystudio/src/router/index.js
index 148c3756f8..fa7b220e9a 100644
--- a/kystudio/src/router/index.js
+++ b/kystudio/src/router/index.js
@@ -9,7 +9,6 @@ import login from 'components/user/login'
import Insight from 'components/query/insight'
import queryHistory from 'components/query/query_history'
import jobs from 'components/monitor/batchJobs/jobs'
-import streamingJobs from 'components/monitor/streamingJobs/streamingJobs'
import dashboard from 'components/dashboard/dashboard'
import { bindRouterGuard } from './routerGuard.js'
@@ -122,11 +121,6 @@ let routerOptions = {
path: 'monitor/job',
component: jobs
},
- {
- name: 'StreamingJob',
- path: 'monitor/streamingJob',
- component: streamingJobs
- },
{
name: 'Insight',
path: 'query/insight',
diff --git a/kystudio/src/service/monitor.js b/kystudio/src/service/monitor.js
index 65959fde3c..af998c1079 100644
--- a/kystudio/src/service/monitor.js
+++ b/kystudio/src/service/monitor.js
@@ -50,15 +50,6 @@ export default {
loadJobBulidChartData: (para) => {
return Vue.resource(apiUrl + 'jobs/statistics/duration_per_byte').get(para)
},
- loadStreamingJobsList: (para) => {
- return Vue.resource(apiUrl + 'streaming_jobs{?job_types}{&model_names}').get(para)
- },
- getStreamingJobRecords: (para) => {
- return Vue.resource(apiUrl + 'streaming_jobs/records').get(para)
- },
- updateStreamingJobs: (para) => {
- return Vue.resource(apiUrl + 'streaming_jobs/status').update(para)
- },
getStreamingChartData: (para) => {
return Vue.resource(apiUrl + `streaming_jobs/stats/${para.job_id}`).get(para)
},
diff --git a/kystudio/src/store/model.js b/kystudio/src/store/model.js
index f4a8219bb4..b8f2f3a54b 100644
--- a/kystudio/src/store/model.js
+++ b/kystudio/src/store/model.js
@@ -390,15 +390,6 @@ export default {
[types.FETCH_SUBMITTER_LIST] (_, params) {
return api.model.fetchSubmitterList(params)
},
- [types.GET_STREAMING_JOB] (_, params) {
- return api.model.getStreamingJobs(params)
- },
- [types.CHANGE_STREAMING_JOB_STATUS] (_, params) {
- return api.model.changeStreamingJobStatus(params)
- },
- [types.UPDATE_STREAMING_CONFIGURATIONS] (_, params) {
- return api.model.updateStreamingConfigurations(params)
- },
[types.DELETE_SYNC_SEGMENTS] (_, params) {
return api.model.deleteSyncSegments(params)
},
diff --git a/kystudio/src/store/monitor.js b/kystudio/src/store/monitor.js
index ff5568a785..319792c83c 100644
--- a/kystudio/src/store/monitor.js
+++ b/kystudio/src/store/monitor.js
@@ -44,15 +44,6 @@ export default {
[types.LOAD_JOB_BULID_CHART_DATA]: function ({ commit }, para) {
return api.monitor.loadJobBulidChartData(para)
},
- [types.LOAD_STREAMING_JOBS_LIST]: function ({ commit }, para) {
- return api.monitor.loadStreamingJobsList(para)
- },
- [types.GET_STREAMING_JOB_RECORDS]: function ({ commit }, para) {
- return api.monitor.getStreamingJobRecords(para)
- },
- [types.UPDATE_STREAMING_JOBS]: function ({ commit }, para) {
- return api.monitor.updateStreamingJobs(para)
- },
[types.GET_STREAMING_CHART_DATA]: function ({ commit }, para) {
return api.monitor.getStreamingChartData(para)
},
[kylin] 08/13: KYLIN-5661 fix del cc from fact 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 0ab480c82ebb6417decf43225902794a4aa75c7b
Author: Qian Xia <la...@gmail.com>
AuthorDate: Thu Jul 20 17:08:06 2023 +0800
KYLIN-5661 fix del cc from fact table issue
---
.../studio/StudioModel/ModelEdit/model.js | 22 +++++++++++++++-------
.../ModelList/ConfirmSegment/ConfirmSegment.vue | 11 +++++------
.../StudioModel/ModelList/ConfirmSegment/store.js | 6 ++----
3 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
index 42837e30a4..7d111e1f34 100644
--- a/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
+++ b/kystudio/src/components/studio/StudioModel/ModelEdit/model.js
@@ -943,11 +943,13 @@ class NModel extends Schama {
_updateCCToNewFactTable () {
let factTable = this.getFactTable()
if (factTable) {
- this._mount.computed_columns.forEach((x) => {
- x.table_guid = factTable.guid
- x.tableIdentity = factTable.name
- x.tableAlias = factTable.tableAlias
+ this._mount.computed_columns.forEach((cc) => {
+ cc.table_guid = factTable.guid
+ cc.tableIdentity = factTable.name
+ cc.tableAlias = factTable.tableAlias
+ factTable.all_columns.push({...cc, name: cc.columnName, column: cc.columnName, is_computed_column: true})
})
+ factTable.filterColumns()
}
}
// 移除和某个表相关的partition信息
@@ -960,9 +962,11 @@ class NModel extends Schama {
}
_delCCInTableAllColumns (t, column) {
const index = t.all_columns.findIndex(it => it.column === column)
- t.all_columns.splice(index, 1)
- t.columnCurrentPage = 1
- t.filterColumns()
+ if (index !== -1) {
+ t.all_columns.splice(index, 1)
+ t.columnCurrentPage = 1
+ t.filterColumns()
+ }
// this.$set(this._mount.tables, t.guid, t)
}
changeTableType (t) {
@@ -978,6 +982,10 @@ class NModel extends Schama {
// this._arrangeLinks()
} else if (t.name === this.fact_table) {
this.fact_table = '' // fact 改为 lookup 需要将它设置为空
+ // 删除 all_columns 里相关 cc
+ this._mount.computed_columns.forEach((c) => {
+ this._delCCInTableAllColumns(t, c.columnName)
+ })
}
// 删除对应的partition
this._delTableRelatedPartitionInfo(t)
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
index 7578ae92f5..730945925a 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/ConfirmSegment.vue
@@ -114,7 +114,6 @@ vuex.registerModule(['modals', 'ConfirmSegment'], store)
indexes: state => state.indexes,
isRemoveIndex: state => state.isRemoveIndex,
submitText: state => state.submitText,
- isHybridBatch: state => state.isHybridBatch,
model: state => state.model,
callback: state => state.callback
})
@@ -166,7 +165,7 @@ export default class ConfirmSegmentModal extends Vue {
try {
const { sortBy, reverse } = this.filter
const projectName = this.currentSelectedProject
- const modelName = this.isHybridBatch ? this.model.batch_id : this.model.uuid
+ const modelName = this.model.uuid
// const startTime = startDate && transToUTCMs(startDate)
// const endTime = endDate && transToUTCMs(endDate)
const data = { projectName, modelName, sortBy, reverse, ...this.pagination }
@@ -273,7 +272,7 @@ export default class ConfirmSegmentModal extends Vue {
// 有值说明是刷新segment list
if (this.refrashWarningSegment) {
const segmentIds = this.selectedSegmentIds
- const modelId = this.isHybridBatch ? this.model.batch_id : this.model.uuid
+ const modelId = this.model.uuid
const projectName = this.currentSelectedProject
const isSubmit = await this.refreshSegments({ projectName, modelId, segmentIds })
if (isSubmit) {
@@ -283,7 +282,7 @@ export default class ConfirmSegmentModal extends Vue {
} else {
if (this.indexes.length > 0 && !this.isRemoveIndex) {
const res = await this.complementBatchIndex({
- modelId: this.isHybridBatch ? this.model.batch_id : this.model.uuid,
+ modelId: this.model.uuid,
data: {
project: this.currentSelectedProject,
segment_ids: this.selectedSegmentIds,
@@ -299,7 +298,7 @@ export default class ConfirmSegmentModal extends Vue {
}
} else if (this.indexes.length > 0 && this.isRemoveIndex) {
await this.deleteBatchIndex({
- modelId: this.isHybridBatch ? this.model.batch_id : this.model.uuid,
+ modelId: this.model.uuid,
data: {
project: this.currentSelectedProject,
segment_ids: this.selectedSegmentIds,
@@ -309,7 +308,7 @@ export default class ConfirmSegmentModal extends Vue {
this.$message({ type: 'success', message: this.$t('kylinLang.common.delSuccess') })
} else {
const res = await this.complementAllIndex({
- modelId: this.isHybridBatch ? this.model.batch_id : this.model.uuid,
+ modelId: this.model.uuid,
data: {
project: this.currentSelectedProject,
segment_ids: this.selectedSegmentIds,
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/store.js b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/store.js
index 3e547e24b5..93a8ca02a2 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/store.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ConfirmSegment/store.js
@@ -15,7 +15,6 @@ const initialState = JSON.stringify({
isRemoveIndex: false,
submitText: '',
model: null,
- isHybridBatch: false, // 标识是否是融合数据模型下的批数据模型
callback: null
})
export default {
@@ -38,7 +37,6 @@ export default {
state.indexes = payload.indexes
state.isRemoveIndex = payload.isRemoveIndex
state.submitText = payload.submitText
- state.isHybridBatch = payload.isHybridBatch || false
state.model = payload.model
},
[types.RESET_MODAL_FORM]: state => {
@@ -46,9 +44,9 @@ export default {
}
},
actions: {
- [types.CALL_MODAL] ({ commit }, { title, subTitle, refrashWarningSegment, indexes, isRemoveIndex, submitText, isHybridBatch = false, model }) {
+ [types.CALL_MODAL] ({ commit }, { title, subTitle, refrashWarningSegment, indexes, isRemoveIndex, submitText, model }) {
return new Promise(resolve => {
- commit(types.SET_MODAL_FORM, { callback: resolve, title: title, subTitle: subTitle, refrashWarningSegment: refrashWarningSegment, indexes: indexes, isRemoveIndex: isRemoveIndex, submitText: submitText, isHybridBatch: isHybridBatch, model: model })
+ commit(types.SET_MODAL_FORM, { callback: resolve, title: title, subTitle: subTitle, refrashWarningSegment: refrashWarningSegment, indexes: indexes, isRemoveIndex: isRemoveIndex, submitText: submitText, model: model })
commit(types.SHOW_MODAL)
})
}
[kylin] 10/13: KYLIN-5663 refine 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 f9a3f532679e530862a647ac7273117866f3c350
Author: Qian Xia <la...@gmail.com>
AuthorDate: Fri Jul 21 10:46:09 2023 +0800
KYLIN-5663 refine css issue
---
kystudio/src/assets/styles/variables.less | 1 +
.../studio/StudioModel/ModelList/ModelAggregate/index.vue | 14 ++++++++++----
.../studio/StudioModel/ModelList/ModelSaveConfig/index.vue | 14 +++++++++-----
.../StudioModel/ModelList/ModelSaveConfig/locales.js | 2 +-
4 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/kystudio/src/assets/styles/variables.less b/kystudio/src/assets/styles/variables.less
index 4d7dacea6f..3c9610b9cf 100644
--- a/kystudio/src/assets/styles/variables.less
+++ b/kystudio/src/assets/styles/variables.less
@@ -10,6 +10,7 @@
@text-placeholder-color: @color-text-placeholder; //#A5B2C5
@text-darkbg-color: @fff;
@text-disabled-color: @color-text-disabled; //#8B99AE
+@text-disabled-color1: rgba(47, 55, 76, 0.3);
@text-description: #415461;
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
index 98f3faa97c..c8389b2a8b 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelAggregate/index.vue
@@ -1208,18 +1208,24 @@ export default class ModelAggregate extends Vue {
}
.el-dropdown-menu__item {
&.action-disabled {
- color: @text-disabled-color;
+ color: @text-disabled-color1;
cursor: not-allowed;
- &:focus {
- color: @text-disabled-color;
+ &:focus,
+ &:not(.is-disabled):active {
+ color: @text-disabled-color1;
cursor: not-allowed;
}
}
&.dropdown-group-title {
font-size: 12px;
- color: @text-disabled-color;
+ color: @text-disabled-color1;
line-height: 30px;
cursor: default;
+ &:focus,
+ &:not(.is-disabled):active {
+ color: @text-disabled-color1;
+ cursor: default;
+ }
&:hover {
background-color: @fff !important;
}
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
index 6578697518..632208af2c 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/index.vue
@@ -30,7 +30,7 @@
<el-tab-pane name="incremental" :disabled="!datasourceActions.includes('changeBuildType')">
<span slot="label">
<el-tooltip :content="$t('incrementalTips')" placement="top">
- <span>{{$t('incremental')}}<el-tag class="ksd-ml-5" size="mini" type="success">{{$t('recommend')}}</el-tag></span>
+ <span>{{$t('incremental')}}<el-tag class="ksd-ml-5" is-light size="mini" type="success">{{$t('recommend')}}</el-tag></span>
</el-tooltip>
</span>
</el-tab-pane>
@@ -885,13 +885,17 @@ export default class ModelPartitionModal extends Vue {
.buildType-switch {
.el-tabs__header {
width: 100%;
+ height: 32px;
.el-tabs__nav {
width: 97.8%;
.el-tabs__item {
width: 50%;
+ height: 26px;
+ line-height: 26px;
.el-tag {
position: relative;
bottom: 1px;
+ padding: 0 7px;
}
}
}
@@ -913,8 +917,8 @@ export default class ModelPartitionModal extends Vue {
line-height: 16px;
}
.pre-format {
- color: @text-normal-color;
- font-size: 14px;
+ color: @text-disabled-color;
+ font-size: 12px;
margin-top: 4px;
background-color: @ke-background-color-secondary;
border: 1px solid @ke-border-divider-color;
@@ -945,8 +949,8 @@ export default class ModelPartitionModal extends Vue {
padding: 8px 16px;
box-sizing: border-box;
font-size: 12px;
- color: @text-normal-color;
- line-height: 16px;
+ color: @text-disabled-color;
+ line-height: 20px;
margin-top: 4px;
p {
display: flex;
diff --git a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
index 9b735733f8..f2d3d62099 100644
--- a/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
+++ b/kystudio/src/components/studio/StudioModel/ModelList/ModelSaveConfig/locales.js
@@ -36,7 +36,7 @@ export default {
recommend: 'Recommend',
isNotBatchModel: 'Can’t load the stream model in full.',
incrementalTips: 'It will load data incrementally based on the selected partition column, which is more resource-efficient.',
- fullLoadTips: 'The system will load all data.',
+ fullLoadTips: 'The system will load all data',
changeBuildTypeTips: '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.',
editCCBuildTip: 'The modified expression of computed column would be effective until all the related indexes have been built. Do you want to save and build index now? ',
saveAndBuild: 'Save and Build',