|
|
@ -27,9 +27,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
<v-chip v-if="base.enabled" :color="colors[2]"> |
|
|
|
<v-chip v-if="base.enabled" :color="colors[2]"> |
|
|
|
<div class="nc-url-wrapper d-flex mx-1 align-center d-100"> |
|
|
|
<div class="nc-url-wrapper d-flex mx-1 align-center d-100"> |
|
|
|
<span class="nc-url">{{ base.url }}</span> |
|
|
|
<span class="nc-url">{{ url }}</span> |
|
|
|
<v-icon>mdi-reload</v-icon> |
|
|
|
<v-icon @click="recreate"> |
|
|
|
<v-icon>mdi-content-copy</v-icon> |
|
|
|
mdi-reload |
|
|
|
|
|
|
|
</v-icon> |
|
|
|
|
|
|
|
<v-icon @click="copyUrl"> |
|
|
|
|
|
|
|
mdi-content-copy |
|
|
|
|
|
|
|
</v-icon> |
|
|
|
<v-icon>mdi-xml</v-icon> |
|
|
|
<v-icon>mdi-xml</v-icon> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</v-chip> |
|
|
|
</v-chip> |
|
|
@ -38,6 +42,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import colors from '~/mixins/colors' |
|
|
|
import colors from '~/mixins/colors' |
|
|
|
|
|
|
|
import { copyTextToClipboard } from '~/helpers/xutils' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'ShareBase', |
|
|
|
name: 'ShareBase', |
|
|
@ -47,6 +52,11 @@ export default { |
|
|
|
enable: false |
|
|
|
enable: false |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
url() { |
|
|
|
|
|
|
|
return this.base && this.base.shared_base_id ? `${this.dashboardUrl}#/nc/base/${this.base.shared_base_id}` : null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.loadSharedBase() |
|
|
|
this.loadSharedBase() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -74,6 +84,19 @@ export default { |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.$toast.error(e.message).goAway(3000) |
|
|
|
this.$toast.error(e.message).goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async recreate() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'disableSharedBaseLink']) |
|
|
|
|
|
|
|
const sharedBase = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'createSharedBaseLink']) |
|
|
|
|
|
|
|
this.base = sharedBase || {} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
this.$toast.error(e.message).goAway(3000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
copyUrl() { |
|
|
|
|
|
|
|
copyTextToClipboard(this.url) |
|
|
|
|
|
|
|
this.$toast.success('Copied shareable base url to clipboard!').goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|