2020-03-29 19:24:44 +00:00
|
|
|
<template>
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-dialog lazy v-model="show" persistent max-width="500" class="p-account-create-dialog" @keydown.esc="cancel">
|
|
|
|
<v-card raised elevation="24">
|
|
|
|
<v-card-title primary-title>
|
|
|
|
<div>
|
2020-07-03 17:02:30 +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
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="label.url"
|
|
|
|
placeholder="https://www.example.com/"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.AccURL"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="label.user"
|
|
|
|
placeholder="optional"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.AccUser"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="label.pass"
|
|
|
|
placeholder="optional"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.AccPass"
|
|
|
|
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
|
|
|
|
:type="showPassword ? 'text' : 'password'"
|
|
|
|
@click:append="showPassword = !showPassword"
|
|
|
|
></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-03 17:02:30 +00:00
|
|
|
<translate>Note: Only WebDAV servers like Nextcloud can be configured at the moment. 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">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-btn @click.stop="cancel" depressed color="secondary-light"
|
2020-06-29 19:14:34 +00:00
|
|
|
class="action-cancel mr-2">
|
2020-06-27 08:31:20 +00:00
|
|
|
<span>{{ label.cancel }}</span>
|
|
|
|
</v-btn>
|
|
|
|
<v-btn depressed dark color="secondary-dark" @click.stop="confirm"
|
2020-06-29 19:14:34 +00:00
|
|
|
class="action-confirm ma-0">
|
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-03-31 15:26:25 +00:00
|
|
|
import Account from "model/account";
|
2020-03-29 19:24:44 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'p-account-create-dialog',
|
|
|
|
props: {
|
|
|
|
show: Boolean,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showPassword: false,
|
|
|
|
loading: false,
|
|
|
|
search: null,
|
|
|
|
model: new Account(),
|
|
|
|
label: {
|
2020-07-03 17:02:30 +00:00
|
|
|
url: this.$gettext("Service URL"),
|
2020-03-29 19:24:44 +00:00
|
|
|
user: this.$gettext("Username"),
|
|
|
|
pass: this.$gettext("Password"),
|
|
|
|
cancel: this.$gettext("Cancel"),
|
|
|
|
confirm: this.$gettext("Connect"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
cancel() {
|
|
|
|
this.$emit('cancel');
|
|
|
|
},
|
|
|
|
confirm() {
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
this.model.save().then((a) => {
|
|
|
|
this.loading = false;
|
2020-05-23 18:58:58 +00:00
|
|
|
this.$emit('confirm', a.UID);
|
2020-03-29 19:24:44 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
show: function (show) {
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|