mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 11:00:39 +00:00
v1.6 released
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<section id="viewport">
|
||||
|
||||
<ContentSidebar>
|
||||
<ContentSidebar v-if="false">
|
||||
|
||||
<!--Locations-->
|
||||
<ContentGroup :title="$t('admin_menu.admin_label')" class="navigator">
|
||||
<div class="menu-list-wrapper">
|
||||
<div class="menu-list-wrapper vertical">
|
||||
<router-link :to="{name: 'Users'}" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<users-icon size="17"></users-icon>
|
||||
@@ -18,7 +18,9 @@
|
||||
</ContentGroup>
|
||||
</ContentSidebar>
|
||||
|
||||
<router-view/>
|
||||
<keep-alive :include="['Users']">
|
||||
<router-view/>
|
||||
</keep-alive>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div id="page-content" class="full-width" v-if="! isLoading">
|
||||
<div id="page-content" class="medium-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<div class="content-page">
|
||||
<div class="table-tools">
|
||||
<div class="buttons">
|
||||
<router-link :to="{name: 'UserCreate'}">
|
||||
<MobileActionButton icon="user-plus">
|
||||
{{ $t('admin_page_user.create_user.submit') }}
|
||||
</MobileActionButton>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="searching">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<DatatableWrapper :paginator="true" :columns="columns" :data="users" class="table table-users">
|
||||
<template scope="{ row }">
|
||||
<tr>
|
||||
<td style="width: 320px">
|
||||
<td style="width: 300px">
|
||||
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}" tag="div" class="user-thumbnail">
|
||||
<div class="avatar">
|
||||
<img :src="row.data.attributes.avatar" :alt="row.data.attributes.name">
|
||||
@@ -34,6 +46,11 @@
|
||||
{{ row.data.attributes.storage.capacity_formatted }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="cell-item">
|
||||
{{ row.data.attributes.created_at_formatted }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="action-icons">
|
||||
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}">
|
||||
@@ -57,8 +74,10 @@
|
||||
|
||||
<script>
|
||||
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
|
||||
import MobileActionButton from '@/components/FilesView/MobileActionButton'
|
||||
import MobileHeader from '@/components/Mobile/MobileHeader'
|
||||
import SectionTitle from '@/components/Others/SectionTitle'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import {Trash2Icon, Edit2Icon} from "vue-feather-icons";
|
||||
import PageHeader from '@/components/Others/PageHeader'
|
||||
import ColorLabel from '@/components/Others/ColorLabel'
|
||||
@@ -68,11 +87,13 @@
|
||||
export default {
|
||||
name: 'Profile',
|
||||
components: {
|
||||
MobileActionButton,
|
||||
DatatableWrapper,
|
||||
SectionTitle,
|
||||
MobileHeader,
|
||||
Trash2Icon,
|
||||
PageHeader,
|
||||
ButtonBase,
|
||||
ColorLabel,
|
||||
Edit2Icon,
|
||||
Spinner,
|
||||
@@ -84,27 +105,32 @@
|
||||
columns: [
|
||||
{
|
||||
label: this.$t('admin_page_user.table.name'),
|
||||
field: 'attributes.name',
|
||||
field: 'data.attributes.name',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
label: this.$t('admin_page_user.table.role'),
|
||||
field: 'attributes.role',
|
||||
field: 'data.attributes.role',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
label: this.$t('admin_page_user.table.storage_used'),
|
||||
field: 'attributes.storage.used',
|
||||
field: 'data.attributes.storage.used',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
label: this.$t('admin_page_user.table.storage_capacity'),
|
||||
field: 'attributes.storage.capacity',
|
||||
field: 'data.attributes.storage.capacity',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
label: this.$t('admin_page_user.table.created_at'),
|
||||
field: 'data.attributes.created_at_formatted',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
label: this.$t('admin_page_user.table.action'),
|
||||
field: 'action',
|
||||
field: 'data.action',
|
||||
sortable: false
|
||||
},
|
||||
],
|
||||
@@ -136,7 +162,18 @@
|
||||
@import '@assets/vue-file-manager/_variables';
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
|
||||
.table-tools {
|
||||
background: white;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 15px 0 10px;
|
||||
position: sticky;
|
||||
top: 40px;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.action-icons {
|
||||
white-space: nowrap;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
@@ -166,6 +203,7 @@
|
||||
|
||||
.cell-item {
|
||||
@include font-size(15);
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,8 +226,15 @@
|
||||
|
||||
.info {
|
||||
|
||||
.name {
|
||||
.name, .email {
|
||||
max-width: 150px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.name {
|
||||
@include font-size(15);
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -201,8 +246,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 690px) {
|
||||
.table-tools {
|
||||
padding: 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
.table-tools {
|
||||
background: $dark_mode_background;
|
||||
}
|
||||
|
||||
.action-icons {
|
||||
|
||||
.icon {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div id="single-page" v-if="app">
|
||||
<div id="page-content" v-if="! isLoading">
|
||||
<div id="page-content" class="medium-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :can-back="true" :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<div class="content-page">
|
||||
|
||||
@@ -168,7 +168,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div id="page-content" class="small-width">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :can-back="true" :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<div class="content-page">
|
||||
<ValidationObserver @submit.prevent="createUser" ref="createUser" v-slot="{ invalid }" tag="form" class="form block-form">
|
||||
|
||||
<div class="form-group">
|
||||
<b class="form-group-label">
|
||||
{{ $t('admin_page_user.create_user.group_details') }}
|
||||
</b>
|
||||
|
||||
<!--Avatar-->
|
||||
<div class="block-wrapper">
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="avatar" v-slot="{ errors }">
|
||||
<ImageInput v-model="user.avatar" :error="errors[0]" />
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<!--Email-->
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_email') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="email" rules="required" v-slot="{ errors }">
|
||||
<input v-model="user.email" :placeholder="$t('admin_page_user.create_user.label_email')" type="email" :class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<!--Name-->
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_name') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="user name" rules="required" v-slot="{ errors }">
|
||||
<input v-model="user.name" :placeholder="$t('admin_page_user.create_user.label_name')" type="text" :class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<!--Password-->
|
||||
<div class="wrapper-inline">
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_pass') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="password" rules="required" v-slot="{ errors }">
|
||||
<input v-model="user.password" :placeholder="$t('page_registration.placeholder_pass')" type="password" :class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_confirm_pass') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="password confirm" rules="required" v-slot="{ errors }">
|
||||
<input v-model="user.password_confirmation" :placeholder="$t('admin_page_user.create_user.label_conf_pass')" type="password" :class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<b class="form-group-label">
|
||||
{{ $t('admin_page_user.create_user.group_settings') }}
|
||||
</b>
|
||||
|
||||
|
||||
<!--User Role-->
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('admin_page_user.select_role') }}:</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="permission" rules="required" v-slot="{ errors }">
|
||||
<SelectInput v-model="user.role" :options="roles" :placeholder="$t('admin_page_user.select_role')" :isError="errors[0]"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<!--Storage Capacity-->
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('admin_page_user.label_change_capacity') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="storage capacity" rules="required" v-slot="{ errors }">
|
||||
<input v-model="user.storage_capacity" min="1" max="999999999" :placeholder="$t('admin_page_user.label_change_capacity')" type="number" :class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<ButtonBase :disabled="isLoading" :loading="isLoading" button-style="theme" type="submit">
|
||||
{{ $t('admin_page_user.create_user.submit') }}
|
||||
</ButtonBase>
|
||||
</div>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import SelectInput from '@/components/Others/Forms/SelectInput'
|
||||
import ImageInput from '@/components/Others/Forms/ImageInput'
|
||||
import MobileHeader from '@/components/Mobile/MobileHeader'
|
||||
import SectionTitle from '@/components/Others/SectionTitle'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import PageHeader from '@/components/Others/PageHeader'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import { mapGetters } from 'vuex'
|
||||
import {events} from "@/bus"
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'Profile',
|
||||
components: {
|
||||
ValidationProvider,
|
||||
ValidationObserver,
|
||||
SectionTitle,
|
||||
MobileHeader,
|
||||
SelectInput,
|
||||
ButtonBase,
|
||||
ImageInput,
|
||||
PageHeader,
|
||||
required,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['roles']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
user: {
|
||||
role: '',
|
||||
avatar: undefined,
|
||||
name: '',
|
||||
email: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
storage_capacity: 5,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async createUser() {
|
||||
|
||||
// Validate fields
|
||||
const isValid = await this.$refs.createUser.validate();
|
||||
|
||||
if (!isValid) return;
|
||||
|
||||
// Start loading
|
||||
this.isLoading = true
|
||||
|
||||
// Create form
|
||||
let formData = new FormData()
|
||||
|
||||
// Add image to form
|
||||
formData.append('name', this.user.name)
|
||||
formData.append('role', this.user.role)
|
||||
formData.append('email', this.user.email)
|
||||
formData.append('password', this.user.password)
|
||||
formData.append('storage_capacity', this.user.storage_capacity)
|
||||
formData.append('password_confirmation', this.user.password_confirmation)
|
||||
|
||||
// Append avatar if exist
|
||||
if (this.user.avatar)
|
||||
formData.append('avatar', this.user.avatar)
|
||||
|
||||
// Send request to get user token
|
||||
axios
|
||||
.post('/api/users/create', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
|
||||
// Show toaster
|
||||
events.$emit('toaster', {
|
||||
type: 'success',
|
||||
message: this.$t('toaster.created_user'),
|
||||
})
|
||||
|
||||
// Go to User page
|
||||
this.$router.push({name: 'UserDetail', params: {id: response.data.data.id}})
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
// Validation errors
|
||||
if (error.response.status == 422) {
|
||||
|
||||
// Email validation error
|
||||
if (error.response.data.errors['email']) {
|
||||
|
||||
this.$refs.createUser.setErrors({
|
||||
'email': error.response.data.errors['email']
|
||||
});
|
||||
}
|
||||
|
||||
// Password validation error
|
||||
if (error.response.data.errors['password']) {
|
||||
|
||||
this.$refs.createUser.setErrors({
|
||||
'password': error.response.data.errors['password']
|
||||
});
|
||||
}
|
||||
|
||||
// Password validation error
|
||||
if (error.response.data.errors['storage_capacity']) {
|
||||
|
||||
this.$refs.createUser.setErrors({
|
||||
'storage capacity': 'The storage capacity must be lower than 10 digit number.'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
}
|
||||
|
||||
// End loading
|
||||
this.isLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@assets/vue-file-manager/_variables';
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
@import '@assets/vue-file-manager/_forms';
|
||||
</style>
|
||||
@@ -89,6 +89,15 @@
|
||||
|
||||
this.$router.push({name: 'Users'})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
this.isSendingRequest = false
|
||||
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import SetupBox from '@/components/Others/Forms/SetupBox'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import { mapGetters } from 'vuex'
|
||||
import {events} from "@/bus"
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -81,20 +82,13 @@
|
||||
SetupBox,
|
||||
required,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['roles']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
isSendingRequest: false,
|
||||
roles: [
|
||||
{
|
||||
label: this.$t('roles.admin'),
|
||||
value: 'admin',
|
||||
},
|
||||
{
|
||||
label: this.$t('roles.user'),
|
||||
value: 'user',
|
||||
},
|
||||
],
|
||||
userRole: undefined,
|
||||
}
|
||||
},
|
||||
@@ -129,8 +123,14 @@
|
||||
message: this.$t('toaster.changed_user'),
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
.catch(() => {
|
||||
|
||||
this.isSendingRequest = false
|
||||
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,15 @@
|
||||
message: this.$t('toaster.sended_password'),
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
this.isSendingRequest = false
|
||||
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<input v-model="capacity"
|
||||
:placeholder="$t('admin_page_user.label_change_capacity')"
|
||||
type="number"
|
||||
min="1"
|
||||
max="999999999"
|
||||
:class="{'is-error': errors[0]}"
|
||||
/>
|
||||
<ButtonBase :loading="isSendingRequest" :disabled="isSendingRequest" type="submit" button-style="theme" class="submit-button">
|
||||
@@ -106,6 +108,23 @@
|
||||
.catch(error => {
|
||||
|
||||
this.isSendingRequest = false
|
||||
|
||||
if (error.response.status == 422) {
|
||||
|
||||
// Password validation error
|
||||
if (error.response.data.errors['attributes.storage_capacity']) {
|
||||
|
||||
this.$refs.changeStorageCapacity.setErrors({
|
||||
'Capacity': 'The storage capacity must be lower than 10 digit number.'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getStorageDetails() {
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
return {
|
||||
isLoading: false,
|
||||
checkedAccount: undefined,
|
||||
loginPassword: 'vuefilemanager',
|
||||
loginEmail: 'howdy@hi5ve.digital',
|
||||
loginPassword: '',
|
||||
loginEmail: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<!--Locations-->
|
||||
<ContentGroup :title="$t('sidebar.locations_title')">
|
||||
<div class="menu-list-wrapper">
|
||||
<div class="menu-list-wrapper vertical">
|
||||
<a class="menu-list-item link" :class="{'is-active': $isThisLocation(['base'])}" @click="goHome">
|
||||
<div class="icon">
|
||||
<home-icon size="17"></home-icon>
|
||||
@@ -38,7 +38,7 @@
|
||||
<!--Favourites-->
|
||||
<ContentGroup :title="$t('sidebar.favourites')">
|
||||
|
||||
<div class="menu-list-wrapper favourites"
|
||||
<div class="menu-list-wrapper vertical favourites"
|
||||
:class="{ 'is-dragenter': area }"
|
||||
@dragover.prevent="dragEnter"
|
||||
@dragleave="dragLeave"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<!--Navigator-->
|
||||
<ContentGroup :title="$t('sidebar.locations_title')">
|
||||
<div class="menu-list-wrapper">
|
||||
<div class="menu-list-wrapper vertical">
|
||||
<li class="menu-list-item link" :class="{'is-active': $isThisLocation(['shared'])}" @click="getShared()">
|
||||
<div class="icon">
|
||||
<link-icon size="17"></link-icon>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<!--Tools-->
|
||||
<ContentGroup :title="$t('sidebar.tools_title')" class="navigator">
|
||||
<div class="menu-list-wrapper">
|
||||
<div class="menu-list-wrapper vertical">
|
||||
<div class="menu-list-item link" @click="emptyTrash()">
|
||||
<div class="icon">
|
||||
<trash-icon size="17"></trash-icon>
|
||||
|
||||
+113
-33
@@ -1,15 +1,28 @@
|
||||
<template>
|
||||
<section id="viewport">
|
||||
<div id="single-page" v-if="app">
|
||||
<div id="page-content" class="medium-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<ContentSidebar>
|
||||
<div class="content-page">
|
||||
|
||||
<!--User Headline-->
|
||||
<UserHeadline class="user-headline"/>
|
||||
<!--User thumbnail-->
|
||||
<div class="user-thumbnail">
|
||||
<div class="avatar">
|
||||
<UserImageInput
|
||||
v-model="avatar"
|
||||
:avatar="app.user.avatar"
|
||||
/>
|
||||
</div>
|
||||
<div class="info">
|
||||
<b class="name">{{ app.user.name }}</b>
|
||||
<span class="email">{{ app.user.email }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Locations-->
|
||||
<ContentGroup title="Menu" class="navigator">
|
||||
<div class="menu-list-wrapper">
|
||||
<router-link :to="{name: 'Profile'}" class="menu-list-item link">
|
||||
<!--Page Tab links-->
|
||||
<div class="menu-list-wrapper horizontal">
|
||||
<router-link replace :to="{name: 'Profile'}" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<user-icon size="17"></user-icon>
|
||||
</div>
|
||||
@@ -17,15 +30,8 @@
|
||||
{{ $t('menu.profile') }}
|
||||
</div>
|
||||
</router-link>
|
||||
<router-link :to="{name: 'Password'}" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<lock-icon size="17"></lock-icon>
|
||||
</div>
|
||||
<div class="label">
|
||||
{{ $t('menu.password') }}
|
||||
</div>
|
||||
</router-link>
|
||||
<router-link v-if="config.storageLimit" :to="{name: 'Storage'}" class="menu-list-item link">
|
||||
|
||||
<router-link replace :to="{name: 'Storage'}" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<hard-drive-icon size="17"></hard-drive-icon>
|
||||
</div>
|
||||
@@ -33,18 +39,42 @@
|
||||
{{ $t('menu.storage') }}
|
||||
</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</ContentGroup>
|
||||
</ContentSidebar>
|
||||
|
||||
<router-view/>
|
||||
</section>
|
||||
<router-link replace :to="{name: 'Password'}" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<lock-icon size="17"></lock-icon>
|
||||
</div>
|
||||
<div class="label">
|
||||
{{ $t('menu.password') }}
|
||||
</div>
|
||||
</router-link>
|
||||
|
||||
<!--<router-link replace :to="{name: 'UserDelete'}" v-if="user.attributes.name !== app.user.name" class="menu-list-item link">
|
||||
<div class="icon">
|
||||
<trash2-icon size="17"></trash2-icon>
|
||||
</div>
|
||||
<div class="label">
|
||||
{{ $t('admin_page_user.tabs.delete') }}
|
||||
</div>
|
||||
</router-link>-->
|
||||
</div>
|
||||
|
||||
<!--Router Content-->
|
||||
<router-view :user="app.user" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="loader" v-if="isLoading">
|
||||
<Spinner></Spinner>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ContentSidebar from '@/components/Sidebar/ContentSidebar'
|
||||
import ContentGroup from '@/components/Sidebar/ContentGroup'
|
||||
import UserHeadline from '@/components/Sidebar/UserHeadline'
|
||||
import UserImageInput from '@/components/Others/UserImageInput'
|
||||
import MobileHeader from '@/components/Mobile/MobileHeader'
|
||||
import PageHeader from '@/components/Others/PageHeader'
|
||||
import Spinner from '@/components/FilesView/Spinner'
|
||||
|
||||
import { mapGetters } from 'vuex'
|
||||
import {
|
||||
HardDriveIcon,
|
||||
@@ -54,23 +84,73 @@
|
||||
|
||||
export default {
|
||||
name: 'Settings',
|
||||
computed: {
|
||||
...mapGetters(['config']),
|
||||
},
|
||||
components: {
|
||||
ContentSidebar,
|
||||
UserImageInput,
|
||||
MobileHeader,
|
||||
PageHeader,
|
||||
Spinner,
|
||||
HardDriveIcon,
|
||||
UserHeadline,
|
||||
ContentGroup,
|
||||
UserIcon,
|
||||
LockIcon,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'config', 'app'
|
||||
]),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatar: undefined,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@assets/vue-file-manager/_variables';
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
|
||||
.user-headline {
|
||||
margin-bottom: 38px;
|
||||
.user-thumbnail {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
|
||||
.avatar {
|
||||
margin-right: 20px;
|
||||
|
||||
img {
|
||||
line-height: 0;
|
||||
width: 62px;
|
||||
height: 62px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
|
||||
.name {
|
||||
display: block;
|
||||
@include font-size(17);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.email {
|
||||
color: $text-muted;
|
||||
@include font-size(14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.user-thumbnail {
|
||||
|
||||
.info {
|
||||
|
||||
.email {
|
||||
color: $dark_mode_text_secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="shared" :class="appSize">
|
||||
<div id="shared">
|
||||
|
||||
<!--Loading Spinenr-->
|
||||
<Spinner v-if="isPageLoading"/>
|
||||
@@ -78,7 +78,6 @@
|
||||
import Vignette from '@/components/Others/Vignette'
|
||||
import Alert from '@/components/FilesView/Alert'
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {ResizeSensor} from 'css-element-queries'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {events} from '@/bus'
|
||||
import axios from 'axios'
|
||||
@@ -103,7 +102,7 @@
|
||||
Alert,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['config', 'sharedDetail', 'sharedFile', 'appSize']),
|
||||
...mapGetters(['config', 'sharedDetail', 'sharedFile']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -1,46 +1,37 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div id="page-content" class="full-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
<div class="page-tab">
|
||||
<div class="page-tab-group">
|
||||
<ValidationObserver ref="password" @submit.prevent="resetPassword" v-slot="{ invalid }" tag="form"
|
||||
class="form block-form">
|
||||
|
||||
<div class="content-page">
|
||||
<div class="block-wrapper">
|
||||
<b class="form-group-label">{{ $t('page_create_password.label_new_pass') }}:</b>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="New Password"
|
||||
rules="required" v-slot="{ errors }">
|
||||
<input v-model="newPassword" :placeholder="$t('page_create_password.label_new_pass')"
|
||||
type="password"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<ValidationObserver ref="password" @submit.prevent="resetPassword" v-slot="{ invalid }" tag="form"
|
||||
class="form block-form">
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_create_password.label_confirm_pass') }}:</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Confirm Your Password"
|
||||
rules="required" v-slot="{ errors }">
|
||||
<input v-model="newPasswordConfirmation"
|
||||
:placeholder="$t('page_create_password.label_confirm_pass')" type="password"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_create_password.label_new_pass') }}:</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="New Password"
|
||||
rules="required" v-slot="{ errors }">
|
||||
<input v-model="newPassword" :placeholder="$t('page_create_password.label_new_pass')"
|
||||
type="password"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_create_password.label_confirm_pass') }}:</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Confirm Your Password"
|
||||
rules="required" v-slot="{ errors }">
|
||||
<input v-model="newPasswordConfirmation"
|
||||
:placeholder="$t('page_create_password.label_confirm_pass')" type="password"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<ButtonBase type="submit" button-style="theme" class="confirm-form">
|
||||
{{ $t('profile.store_pass') }}
|
||||
</ButtonBase>
|
||||
</div>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loader" v-if="isLoading">
|
||||
<Spinner></Spinner>
|
||||
<div class="block-wrapper">
|
||||
<ButtonBase type="submit" button-style="theme" class="confirm-form">
|
||||
{{ $t('profile.store_pass') }}
|
||||
</ButtonBase>
|
||||
</div>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,52 +1,31 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div id="page-content" class="full-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<div class="content-page">
|
||||
<div class="avatar-upload">
|
||||
<UserImageInput
|
||||
v-model="avatar"
|
||||
:avatar="app.user.avatar"
|
||||
/>
|
||||
<div class="info">
|
||||
<span class="description">{{ $t('profile.photo_description') }}</span>
|
||||
<span class="supported">{{ $t('profile.photo_supported') }}</span>
|
||||
<div class="page-tab">
|
||||
<div class="page-tab-group">
|
||||
<ValidationObserver ref="account" v-slot="{ invalid }" tag="form" class="form block-form">
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_email') }}</label>
|
||||
<div class="input-wrapper">
|
||||
<input :value="app.user.email" :placeholder="$t('page_registration.placeholder_email')"
|
||||
type="email" disabled/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ValidationObserver ref="account" v-slot="{ invalid }" tag="form" class="form block-form">
|
||||
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_email') }}</label>
|
||||
<div class="input-wrapper">
|
||||
<input :value="app.user.email" :placeholder="$t('page_registration.placeholder_email')" type="email" disabled/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_name') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Full Name" rules="required"
|
||||
v-slot="{ errors }">
|
||||
<input @keyup="$updateText('/user/profile', 'name', name)" v-model="name"
|
||||
:placeholder="$t('page_registration.placeholder_name')" type="text"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loader" v-if="isLoading">
|
||||
<Spinner></Spinner>
|
||||
<div class="block-wrapper">
|
||||
<label>{{ $t('page_registration.label_name') }}</label>
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Full Name" rules="required"
|
||||
v-slot="{ errors }">
|
||||
<input @keyup="$updateText('/user/profile', 'name', name)" v-model="name"
|
||||
:placeholder="$t('page_registration.placeholder_name')" type="text"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
|
||||
import UserImageInput from '@/components/Others/UserImageInput'
|
||||
import MobileHeader from '@/components/Mobile/MobileHeader'
|
||||
import ButtonBase from '@/components/FilesView/ButtonBase'
|
||||
import PageHeader from '@/components/Others/PageHeader'
|
||||
@@ -54,15 +33,12 @@
|
||||
import {required} from 'vee-validate/dist/rules'
|
||||
import {mapGetters} from 'vuex'
|
||||
import {debounce} from 'lodash'
|
||||
import {events} from '@/bus'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'Profile',
|
||||
components: {
|
||||
ValidationProvider,
|
||||
ValidationObserver,
|
||||
UserImageInput,
|
||||
MobileHeader,
|
||||
PageHeader,
|
||||
ButtonBase,
|
||||
@@ -81,7 +57,6 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatar: undefined,
|
||||
name: '',
|
||||
isLoading: false,
|
||||
}
|
||||
@@ -100,29 +75,6 @@
|
||||
@import '@assets/vue-file-manager/_mixins';
|
||||
@import '@assets/vue-file-manager/_forms';
|
||||
|
||||
.avatar-upload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
|
||||
.info {
|
||||
margin-left: 25px;
|
||||
|
||||
.description {
|
||||
@include font-size(15);
|
||||
font-weight: 700;
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.supported {
|
||||
display: block;
|
||||
@include font-size(12);
|
||||
font-weight: 500;
|
||||
color: $light_text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 960px) {
|
||||
|
||||
.form {
|
||||
@@ -136,16 +88,6 @@
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
.avatar-upload .info {
|
||||
|
||||
.description {
|
||||
color: $dark_mode_text_primary;
|
||||
}
|
||||
|
||||
.supported {
|
||||
color: $dark_mode_text_secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div id="page-content" class="full-width" v-if="! isLoading">
|
||||
<MobileHeader :title="$router.currentRoute.meta.title"/>
|
||||
<PageHeader :title="$router.currentRoute.meta.title"/>
|
||||
|
||||
<div class="content-page">
|
||||
<SectionTitle>{{ $t('storage.sec_capacity') }}</SectionTitle>
|
||||
<StorageItemDetail type="disk" :title="$t('storage.total_used', {used: storage.attributes.used})" :percentage="storage.attributes.percentage" :used="$t('storage.total_capacity', {capacity: storage.attributes.capacity})"/>
|
||||
|
||||
<SectionTitle>{{ $t('storage.sec_details') }}</SectionTitle>
|
||||
<StorageItemDetail type="images" :title="$t('storage.images')" :percentage="storage.meta.images.percentage" :used="storage.meta.images.used" />
|
||||
<StorageItemDetail type="videos" :title="$t('storage.videos')" :percentage="storage.meta.videos.percentage" :used="storage.meta.videos.used" />
|
||||
<StorageItemDetail type="audios" :title="$t('storage.audios')" :percentage="storage.meta.audios.percentage" :used="storage.meta.audios.used" />
|
||||
<StorageItemDetail type="documents" :title="$t('storage.documents')" :percentage="storage.meta.documents.percentage" :used="storage.meta.documents.used" />
|
||||
<StorageItemDetail type="others" :title="$t('storage.others')" :percentage="storage.meta.others.percentage" :used="storage.meta.others.used" />
|
||||
</div>
|
||||
<div class="page-tab" v-if="storage">
|
||||
<div class="page-tab-group">
|
||||
<b class="form-group-label">{{ $t('storage.sec_capacity') }}</b>
|
||||
<StorageItemDetail type="disk" :title="$t('storage.total_used', {used: storage.attributes.used})" :percentage="storage.attributes.percentage" :used="$t('storage.total_capacity', {capacity: storage.attributes.capacity})"/>
|
||||
</div>
|
||||
<div id="loader" v-if="isLoading">
|
||||
<Spinner></Spinner>
|
||||
<div class="page-tab-group">
|
||||
<b class="form-group-label">{{ $t('storage.sec_details') }}</b>
|
||||
<StorageItemDetail type="images" :title="$t('storage.images')" :percentage="storage.meta.images.percentage" :used="storage.meta.images.used" />
|
||||
<StorageItemDetail type="videos" :title="$t('storage.videos')" :percentage="storage.meta.videos.percentage" :used="storage.meta.videos.used" />
|
||||
<StorageItemDetail type="audios" :title="$t('storage.audios')" :percentage="storage.meta.audios.percentage" :used="storage.meta.audios.used" />
|
||||
<StorageItemDetail type="documents" :title="$t('storage.documents')" :percentage="storage.meta.documents.percentage" :used="storage.meta.documents.used" />
|
||||
<StorageItemDetail type="others" :title="$t('storage.others')" :percentage="storage.meta.others.percentage" :used="storage.meta.others.used" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user