diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index 79c12db9..59cc923b 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -38,12 +38,12 @@ @@ -204,6 +238,7 @@ import TotpService from '../../services/totp' import {mapState} from 'vuex' import AvatarSettings from '../../components/user/avatar-settings' +import copy from 'copy-to-clipboard' export default { name: 'Settings', @@ -223,6 +258,8 @@ export default { totpConfirmPasscode: '', totpDisableForm: false, totpDisablePassword: '', + + caldavUrl: '', } }, components: { @@ -239,6 +276,7 @@ export default { this.totp = new TotpModel() this.totpStatus() + this.buildCaldavUrl() }, mounted() { this.setTitle('Settings') @@ -246,6 +284,8 @@ export default { computed: mapState({ totpEnabled: state => state.config.totpEnabled, migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0, + caldavEnabled: state => state.config.caldavEnabled, + userInfo: state => state.auth.info, }), methods: { updatePassword() { @@ -319,6 +359,13 @@ export default { }) .catch(e => this.error(e, this)) }, + buildCaldavUrl() { + const apiBase = window.API_URL.replace('/api/v1', '') + this.caldavUrl = `${apiBase}/dav/principals/${this.userInfo.username}/` + }, + copy(text) { + copy(text) + }, }, }