Skip to content

Commit

Permalink
byzer-org#95 copy hive/delta path
Browse files Browse the repository at this point in the history
  • Loading branch information
githubnameting committed Mar 30, 2022
1 parent bffaeb0 commit fb6f108
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/page/Workspace/DataCatalog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<span :title="node.label">{{ node.label }}</span>
</div>
<div class="node-actions" :style="{'left': (treeOffsetWidth - (node.data.upload ? 40 : 0)) + 'px'}">
<el-tooltip placement="top" :content="$t('copy')" v-if="data.id && data.id.startsWith('Database_Table_')">
<el-button class="icon-bg" icon="el-ksd-icon-dup_16" type="text" size="small" v-clipboard:success="onCopy" v-clipboard:copy="node.label"></el-button>
<el-tooltip placement="top" :content="$t('catalog.copyPath')" v-if="data.id && data.id.startsWith('Database_Table_')">
<el-button class="icon-bg" icon="el-ksd-icon-dup_16" type="text" size="small" v-clipboard:success="onCopy" v-clipboard:copy="getCopyContent(node)"></el-button>
</el-tooltip>
<el-tooltip effect="dark" v-else-if="node.data.id === 'file'" :content="$t('upload')" placement="top">
<el-button class="icon-bg" icon="el-ksd-icon-add_16" type="text" size="mini" @click.stop="uploadFile"></el-button>
Expand Down Expand Up @@ -131,6 +131,12 @@ export default class DataCataLog extends Vue {
return this.originalWidth + this.nodeScrollWidth - 55
}
getCopyContent (node) {
const datasource_type = node.parent.parent.data.id
const db = node.parent.data.label
return `${datasource_type}.\`${db}.${node.label}\``
}
async refreshTreeNode () {
this.refreshing = true
await setTimeout(() => {
Expand Down

0 comments on commit fb6f108

Please sign in to comment.