2020-03-29 19:24:44 +00:00
|
|
|
<template>
|
2021-01-19 16:11:20 +00:00
|
|
|
<v-dialog v-model="show" lazy persistent max-width="500" class="p-account-create-dialog" @keydown.esc="cancel">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-card raised elevation="24">
|
|
|
|
<v-card-title primary-title>
|
|
|
|
<div>
|
2020-12-17 12:23:23 +00:00
|
|
|
<h3 class="headline mx-2 my-0">
|
|
|
|
<translate>Add Server</translate>
|
|
|
|
</h3>
|
2020-06-27 08:31:20 +00:00
|
|
|
</div>
|
|
|
|
</v-card-title>
|
2020-06-29 19:14:34 +00:00
|
|
|
<v-card-text class="pt-0">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-layout row wrap>
|
|
|
|
<v-flex xs12 class="pa-2">
|
|
|
|
<v-text-field
|
2021-01-19 16:11:20 +00:00
|
|
|
v-model="model.AccURL"
|
2020-12-17 12:23:23 +00:00
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="$gettext('Service URL')"
|
|
|
|
placeholder="https://www.example.com/"
|
|
|
|
color="secondary-dark"
|
2020-06-27 08:31:20 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 class="pa-2">
|
|
|
|
<v-text-field
|
2021-01-19 16:11:20 +00:00
|
|
|
v-model="model.AccUser"
|
2020-12-17 12:23:23 +00:00
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="$gettext('Username')"
|
|
|
|
placeholder="optional"
|
|
|
|
color="secondary-dark"
|
2020-06-27 08:31:20 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 class="pa-2">
|
|
|
|
<v-text-field
|
2021-01-19 16:11:20 +00:00
|
|
|
v-model="model.AccPass"
|
2020-12-17 12:23:23 +00:00
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="$gettext('Password')"
|
|
|
|
placeholder="optional"
|
|
|
|
color="secondary-dark"
|
|
|
|
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
|
|
|
|
:type="showPassword ? 'text' : 'password'"
|
|
|
|
@click:append="showPassword = !showPassword"
|
2020-06-27 08:31:20 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-06-29 19:14:34 +00:00
|
|
|
<v-flex xs12 text-xs-left class="pa-2 caption">
|
2020-07-10 14:46:59 +00:00
|
|
|
<translate>Note: Only WebDAV servers, like Nextcloud or PhotoPrism, can be configured as remote service for backup and file upload.</translate>
|
|
|
|
<translate>Support for additional services, like Google Drive, will be added over time.</translate>
|
2020-06-29 19:14:34 +00:00
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 text-xs-right class="px-2 pt-2 pb-0">
|
2021-01-19 16:11:20 +00:00
|
|
|
<v-btn depressed color="secondary-light" class="action-cancel mr-2"
|
|
|
|
@click.stop="cancel">
|
2020-06-27 08:31:20 +00:00
|
|
|
<span>{{ label.cancel }}</span>
|
|
|
|
</v-btn>
|
2021-01-19 16:11:20 +00:00
|
|
|
<v-btn depressed dark color="secondary-dark" class="action-confirm ma-0"
|
|
|
|
@click.stop="confirm">
|
2020-06-27 08:31:20 +00:00
|
|
|
<span>{{ label.confirm }}</span>
|
|
|
|
</v-btn>
|
|
|
|
</v-flex>
|
|
|
|
</v-layout>
|
2020-06-29 19:14:34 +00:00
|
|
|
</v-card-text>
|
2020-06-27 08:31:20 +00:00
|
|
|
</v-card>
|
|
|
|
</v-dialog>
|
2020-03-29 19:24:44 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
2020-12-17 12:23:23 +00:00
|
|
|
import Account from "model/account";
|
2020-03-29 19:24:44 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
export default {
|
2021-01-19 16:11:20 +00:00
|
|
|
name: 'PAccountCreateDialog',
|
2020-12-17 12:23:23 +00:00
|
|
|
props: {
|
|
|
|
show: Boolean,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showPassword: false,
|
|
|
|
loading: false,
|
|
|
|
search: null,
|
|
|
|
model: new Account(),
|
|
|
|
label: {
|
|
|
|
cancel: this.$gettext("Cancel"),
|
|
|
|
confirm: this.$gettext("Connect"),
|
|
|
|
}
|
2021-01-19 16:11:20 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
show: function (show) {
|
2020-12-17 12:23:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
cancel() {
|
|
|
|
this.$emit('cancel');
|
|
|
|
},
|
|
|
|
confirm() {
|
|
|
|
this.loading = true;
|
2020-03-29 19:24:44 +00:00
|
|
|
|
2020-12-17 12:23:23 +00:00
|
|
|
this.model.save().then((a) => {
|
|
|
|
this.loading = false;
|
|
|
|
this.$emit('confirm', a.UID);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
2021-01-19 16:11:20 +00:00
|
|
|
};
|
2020-03-29 19:24:44 +00:00
|
|
|
</script>
|