Skip to content

Commit

Permalink
#102 add refresh button for hive in Data Catalog (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcheng15 authored Mar 1, 2022
1 parent 42b02e4 commit 37a428d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/AddSchedule/ScheduleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
>
<span slot="label">
{{ $t(`schedules.previousTask`) }}
<el-tooltip placement="top" :content="$t('schedules.previousInfo')">
<el-tooltip effect="dark" placement="top" :content="$t('schedules.previousInfo')">
<i class="el-ksd-icon-more_info_16 hasEvent"></i>
</el-tooltip>
</span>
Expand Down
1 change: 1 addition & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"delete": "Delete",
"remove": "Remove",
"update": "Update",
"refresh": "Refresh",
"import": "Import",
"export": "Export",
"move": "Move",
Expand Down
1 change: 1 addition & 0 deletions src/locale/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"delete": "删除",
"remove": "移除",
"update": "更新",
"refresh": "刷新",
"import": "导入",
"export": "导出",
"move": "移动",
Expand Down
38 changes: 31 additions & 7 deletions src/page/Workspace/DataCatalog/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<template>
<div class="dataCatalog">
<div class="header">{{$t('catalog.dataCatalog')}}</div>
<div class="header">
<div class="header-text">{{$t('catalog.dataCatalog')}}</div>
<icon-btn
class="refresh-btn"
:icon="'el-ksd-icon-refresh_22'"
:text="$t('refresh')"
:handler="refreshHive"
></icon-btn>
</div>
<div class="catalog-wrapper" ref="catalogWrapper" @scroll="scrollTree">
<el-tree
class="catalog-tree"
Expand Down Expand Up @@ -121,6 +129,14 @@ export default class DataCataLog extends Vue {
return this.originalWidth + this.nodeScrollWidth - 55
}
refreshHive () {
this.$refs['tableTree'].getNode(this.allDataList[0]).parent.childNodes.forEach(i => {
this.$refs['tableTree'].remove(i.id)
i.expanded = false
i.loaded = false
})
}
getTextWidth (str, fontSize) {
let result = 10
let ele = document.createElement('span')
Expand Down Expand Up @@ -225,7 +241,7 @@ export default class DataCataLog extends Vue {
const tableList = list.map(v => {
return {
label: v,
id: 'Database_Table_' + data.label,
id: 'Database_Table_' + data.id + v,
isLeaf: true,
children: []
}
Expand All @@ -250,12 +266,20 @@ export default class DataCataLog extends Vue {
.header {
padding: 0 16px;
padding-right: 0;
line-height: 58px;
height: 58px;
display: flex;
justify-content: space-between;
align-items: center;
overflow: hidden;
font-size: 20px;
font-weight: 600;
color: $--color-black;
.header-text {
font-size: 20px;
font-weight: 600;
line-height: 58px;
height: 58px;
color: $--color-black;
}
.refresh-btn {
color: $--color-text-regular;
}
}
.catalog-wrapper {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/page/Workspace/Workflow/components/SideBar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { Component, Vue } from 'vue-property-decorator'
}),
...mapGetters(['isDemo']),
disabledDrag () {
const { isPreviewMode } = this.activeNotebook
const isPreviewMode = this.activeNotebook ? this.activeNotebook.isPreviewMode : false
return this.isDemo || isPreviewMode
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/module/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
getters: {
isDemo: state => {
const { activeNotebook = {}, demoList } = state
const { id = '', commit_id = '' } = activeNotebook
const { id = '', commit_id = '' } = (activeNotebook || {})
return Boolean(demoList.includes(id) && commit_id)
}
}
Expand Down

0 comments on commit 37a428d

Please sign in to comment.