2020-07-10 14:46:59 +00:00
|
|
|
<template>
|
2020-12-17 12:23:23 +00:00
|
|
|
<v-dialog
|
|
|
|
v-model="visible"
|
2020-12-30 15:07:03 +00:00
|
|
|
lazy
|
2020-12-17 12:23:23 +00:00
|
|
|
max-width="500"
|
|
|
|
>
|
|
|
|
<v-card class="pa-2">
|
|
|
|
<v-card-title class="headline pa-2">
|
|
|
|
<translate>Connect via WebDAV</translate>
|
|
|
|
</v-card-title>
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
<v-card-text class="pa-2 body-1">
|
|
|
|
<translate>WebDAV clients can connect to PhotoPrism using the following URL:</translate>
|
|
|
|
</v-card-text>
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
<v-card-text class="pa-2 body-1">
|
|
|
|
<v-text-field
|
|
|
|
browser-autocomplete="off"
|
|
|
|
hide-details readonly
|
|
|
|
single-line
|
|
|
|
outline
|
|
|
|
color="secondary-dark"
|
|
|
|
:value="webdavUrl()"
|
2020-12-30 15:07:03 +00:00
|
|
|
class="input-url"
|
|
|
|
@click.stop="selectText($event)">
|
2020-12-17 12:23:23 +00:00
|
|
|
</v-text-field>
|
|
|
|
</v-card-text>
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
<v-card-text class="pa-2 body-1">
|
|
|
|
<translate>This mounts the originals folder as a network drive and allows you to open, edit, and delete files from your computer or smartphone as if they were local.</translate>
|
|
|
|
</v-card-text>
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
<v-card-text class="pa-2 body-1">
|
|
|
|
<v-alert
|
|
|
|
:value="true"
|
|
|
|
color="primary darken-2"
|
|
|
|
icon="info"
|
|
|
|
class="pa-2"
|
|
|
|
type="info"
|
|
|
|
outline
|
|
|
|
>
|
2020-12-21 18:21:16 +00:00
|
|
|
<a style="color: inherit;" href="https://docs.photoprism.org/user-guide/sync/webdav/" target="_blank">
|
2020-12-17 12:23:23 +00:00
|
|
|
<translate>Detailed instructions can be found in our User Guide.</translate>
|
|
|
|
</a>
|
|
|
|
</v-alert>
|
|
|
|
</v-card-text>
|
|
|
|
</v-card>
|
|
|
|
</v-dialog>
|
2020-07-10 14:46:59 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-17 12:23:23 +00:00
|
|
|
export default {
|
2020-12-30 15:07:03 +00:00
|
|
|
name: 'PDialogWebdav',
|
2020-12-17 12:23:23 +00:00
|
|
|
props: {
|
|
|
|
show: Boolean,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
visible: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
show(val) {
|
|
|
|
this.visible = val;
|
|
|
|
},
|
|
|
|
visible(val) {
|
|
|
|
if (!val) {
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
selectText(ev) {
|
|
|
|
if (!ev || !ev.target) {
|
|
|
|
return;
|
|
|
|
}
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
ev.target.select();
|
2020-07-10 14:46:59 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
this.copyUrl();
|
|
|
|
},
|
|
|
|
copyUrl() {
|
|
|
|
window.navigator.clipboard.writeText(this.webdavUrl())
|
2020-12-30 15:07:03 +00:00
|
|
|
.then(() => this.$notify.success(this.$gettext("Copied to clipboard")), () => this.$notify.error(this.$gettext("Failed copying to clipboard")));
|
2020-12-17 12:23:23 +00:00
|
|
|
},
|
|
|
|
webdavUrl() {
|
|
|
|
return `${window.location.protocol}//admin@${window.location.host}/originals/`;
|
|
|
|
},
|
|
|
|
close() {
|
|
|
|
this.$emit('close');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2020-07-10 14:46:59 +00:00
|
|
|
</script>
|