|
|
@ -658,10 +658,14 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async saveAllowCSVDownload() { |
|
|
|
async saveAllowCSVDownload() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const meta = JSON.parse(this.shareLink.meta); |
|
|
|
const meta = |
|
|
|
|
|
|
|
this.shareLink.meta && typeof this.shareLink.meta === 'string' |
|
|
|
|
|
|
|
? JSON.parse(this.shareLink.meta) |
|
|
|
|
|
|
|
: this.shareLink.meta; |
|
|
|
|
|
|
|
|
|
|
|
meta.allowCSVDownload = this.allowCSVDownload; |
|
|
|
meta.allowCSVDownload = this.allowCSVDownload; |
|
|
|
await this.$api.dbViewShare.update(this.shareLink.id, { |
|
|
|
await this.$api.dbViewShare.update(this.shareLink.id, { |
|
|
|
meta: JSON.stringify(meta), |
|
|
|
meta, |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.$toast.success('Successfully updated').goAway(3000); |
|
|
|
this.$toast.success('Successfully updated').goAway(3000); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
@ -767,10 +771,11 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async genShareLink() { |
|
|
|
async genShareLink() { |
|
|
|
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.passwordProtect = shared.password !== null; |
|
|
|
this.allowCSVDownload = JSON.parse(shared.meta).allowCSVDownload; |
|
|
|
this.allowCSVDownload = shared.meta.allowCSVDownload; |
|
|
|
this.showShareModel = true; |
|
|
|
this.showShareModel = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
copyView(view, i) { |
|
|
|
copyView(view, i) { |
|
|
|