|
|
@ -316,19 +316,26 @@ |
|
|
|
<v-icon small class="pointer" @click="copyShareUrlToClipboard"> mdi-content-copy </v-icon> |
|
|
|
<v-icon small class="pointer" @click="copyShareUrlToClipboard"> mdi-content-copy </v-icon> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<v-switch v-model="passwordProtect" dense @change="onPasswordProtectChange"> |
|
|
|
<v-expansion-panels v-model="advanceOptionsPanel" class="mx-auto" flat> |
|
|
|
<template #label> |
|
|
|
<v-expansion-panel> |
|
|
|
<!-- Restrict access with a password --> |
|
|
|
<v-expansion-panel-header hide-actions> |
|
|
|
<span v-show="!passwordProtect" class="caption"> |
|
|
|
<v-spacer /> |
|
|
|
{{ $t('msg.info.beforeEnablePwd') }} |
|
|
|
<span class="grey--text caption" |
|
|
|
</span> |
|
|
|
>More Options |
|
|
|
<!-- Access is password restricted --> |
|
|
|
<v-icon color="grey" small> |
|
|
|
<span v-show="passwordProtect" class="caption"> |
|
|
|
mdi-chevron-{{ advanceOptionsPanel === 0 ? 'up' : 'down' }} |
|
|
|
{{ $t('msg.info.afterEnablePwd') }} |
|
|
|
</v-icon></span |
|
|
|
</span> |
|
|
|
> |
|
|
|
</template> |
|
|
|
</v-expansion-panel-header> |
|
|
|
</v-switch> |
|
|
|
<v-expansion-panel-content> |
|
|
|
|
|
|
|
<v-checkbox |
|
|
|
|
|
|
|
v-model="passwordProtect" |
|
|
|
|
|
|
|
class="caption" |
|
|
|
|
|
|
|
:label="$t('msg.info.beforeEnablePwd')" |
|
|
|
|
|
|
|
hide-details |
|
|
|
|
|
|
|
dense |
|
|
|
|
|
|
|
@change="onPasswordProtectChange" |
|
|
|
|
|
|
|
/> |
|
|
|
<div v-if="passwordProtect" class="d-flex flex-column align-center justify-center"> |
|
|
|
<div v-if="passwordProtect" class="d-flex flex-column align-center justify-center"> |
|
|
|
<v-text-field |
|
|
|
<v-text-field |
|
|
|
v-model="shareLink.password" |
|
|
|
v-model="shareLink.password" |
|
|
@ -354,6 +361,18 @@ |
|
|
|
{{ $t('placeholder.password.save') }} |
|
|
|
{{ $t('placeholder.password.save') }} |
|
|
|
</v-btn> |
|
|
|
</v-btn> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<v-checkbox |
|
|
|
|
|
|
|
v-if="selectedView && selectedView.type === viewTypes.GRID" |
|
|
|
|
|
|
|
v-model="allowCSVDownload" |
|
|
|
|
|
|
|
class="caption" |
|
|
|
|
|
|
|
label="Allow Download" |
|
|
|
|
|
|
|
hide-details |
|
|
|
|
|
|
|
dense |
|
|
|
|
|
|
|
@change="onAllowCSVDownloadChange" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</v-expansion-panel-content> |
|
|
|
|
|
|
|
</v-expansion-panel> |
|
|
|
|
|
|
|
</v-expansion-panels> |
|
|
|
</v-container> |
|
|
|
</v-container> |
|
|
|
</v-card> |
|
|
|
</v-card> |
|
|
|
</v-dialog> |
|
|
|
</v-dialog> |
|
|
@ -410,6 +429,7 @@ export default { |
|
|
|
queryParams: Object, |
|
|
|
queryParams: Object, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data: () => ({ |
|
|
|
data: () => ({ |
|
|
|
|
|
|
|
advanceOptionsPanel: false, |
|
|
|
webhookSliderModal: false, |
|
|
|
webhookSliderModal: false, |
|
|
|
codeSnippetModal: false, |
|
|
|
codeSnippetModal: false, |
|
|
|
drag: false, |
|
|
|
drag: false, |
|
|
@ -425,6 +445,7 @@ export default { |
|
|
|
searchQueryVal: '', |
|
|
|
searchQueryVal: '', |
|
|
|
showShareLinkPassword: false, |
|
|
|
showShareLinkPassword: false, |
|
|
|
passwordProtect: false, |
|
|
|
passwordProtect: false, |
|
|
|
|
|
|
|
allowCSVDownload: true, |
|
|
|
sharedViewPassword: '', |
|
|
|
sharedViewPassword: '', |
|
|
|
overAdvShieldIcon: false, |
|
|
|
overAdvShieldIcon: false, |
|
|
|
overShieldIcon: false, |
|
|
|
overShieldIcon: false, |
|
|
@ -611,6 +632,9 @@ export default { |
|
|
|
this.saveShareLinkPassword(); |
|
|
|
this.saveShareLinkPassword(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onAllowCSVDownloadChange() { |
|
|
|
|
|
|
|
this.saveAllowCSVDownload(); |
|
|
|
|
|
|
|
}, |
|
|
|
async saveShareLinkPassword() { |
|
|
|
async saveShareLinkPassword() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
await this.$api.dbViewShare.update(this.shareLink.id, { |
|
|
|
await this.$api.dbViewShare.update(this.shareLink.id, { |
|
|
@ -632,6 +656,27 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
this.$e('a:view:share:enable-pwd'); |
|
|
|
this.$e('a:view:share:enable-pwd'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
async saveAllowCSVDownload() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const meta = |
|
|
|
|
|
|
|
this.shareLink.meta && typeof this.shareLink.meta === 'string' |
|
|
|
|
|
|
|
? JSON.parse(this.shareLink.meta) |
|
|
|
|
|
|
|
: this.shareLink.meta; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
meta.allowCSVDownload = this.allowCSVDownload; |
|
|
|
|
|
|
|
await this.$api.dbViewShare.update(this.shareLink.id, { |
|
|
|
|
|
|
|
meta, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$toast.success('Successfully updated').goAway(3000); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
this.$toast.error(await this._extractSdkResponseErrorMsg(e)).goAway(3000); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.allowCSVDownload) { |
|
|
|
|
|
|
|
this.$e('a:view:share:enable-csv-download'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$e('a:view:share:disable-csv-download'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async loadViews() { |
|
|
|
async loadViews() { |
|
|
|
// this.viewsList = await this.sqlOp( |
|
|
|
// this.viewsList = await this.sqlOp( |
|
|
|
// { |
|
|
|
// { |
|
|
@ -725,34 +770,12 @@ export default { |
|
|
|
this.$e('a:view:delete', { view: view.type }); |
|
|
|
this.$e('a:view:delete', { view: view.type }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
async genShareLink() { |
|
|
|
async genShareLink() { |
|
|
|
// const sharedViewUrl = await this.$store.dispatch('sqlMgr/ActSqlOp', [ |
|
|
|
|
|
|
|
// { dbAlias: this.nodes.dbAlias }, |
|
|
|
|
|
|
|
// 'createSharedViewLink', |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// model_name: this.table, |
|
|
|
|
|
|
|
// // meta: this.meta, |
|
|
|
|
|
|
|
// query_params: { |
|
|
|
|
|
|
|
// where: this.concatenatedXWhere, |
|
|
|
|
|
|
|
// sort: this.sort, |
|
|
|
|
|
|
|
// fields: Object.keys(this.showFields) |
|
|
|
|
|
|
|
// .filter(f => this.showFields[f]) |
|
|
|
|
|
|
|
// .join(','), |
|
|
|
|
|
|
|
// showFields: this.showFields, |
|
|
|
|
|
|
|
// fieldsOrder: this.fieldsOrder, |
|
|
|
|
|
|
|
// extraViewParams: this.extraViewParams, |
|
|
|
|
|
|
|
// selectedViewId: this.selectedViewId, |
|
|
|
|
|
|
|
// columnsWidth: this.columnsWidth |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// view_name: this.selectedView.title, |
|
|
|
|
|
|
|
// type: this.selectedView.type, |
|
|
|
|
|
|
|
// show_as: this.selectedView.show_as, |
|
|
|
|
|
|
|
// password: this.sharedViewPassword |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// ]) |
|
|
|
|
|
|
|
const shared = await this.$api.dbViewShare.create(this.selectedViewId); |
|
|
|
const shared = await this.$api.dbViewShare.create(this.selectedViewId); |
|
|
|
|
|
|
|
shared.meta = shared.meta && typeof shared.meta === 'string' ? JSON.parse(shared.meta) : shared.meta; |
|
|
|
// todo: url |
|
|
|
// todo: url |
|
|
|
this.shareLink = shared; |
|
|
|
this.shareLink = shared; |
|
|
|
|
|
|
|
this.passwordProtect = shared.password !== null; |
|
|
|
|
|
|
|
this.allowCSVDownload = shared.meta.allowCSVDownload; |
|
|
|
this.showShareModel = true; |
|
|
|
this.showShareModel = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
copyView(view, i) { |
|
|
|
copyView(view, i) { |
|
|
@ -903,4 +926,7 @@ export default { |
|
|
|
opacity: 0.5; |
|
|
|
opacity: 0.5; |
|
|
|
background: grey; |
|
|
|
background: grey; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.mx-auto .v-expansion-panel { |
|
|
|
|
|
|
|
background: var(--v-backgroundColor-base); |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|