Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#167 copy hive/delta path #166

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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