Merge remote-tracking branch 'origin/master' into filepreview

# Conflicts:
#	.env.example
#	package-lock.json
#	package.json
#	public/js/main.js
#	public/mix-manifest.json
#	resources/js/App.vue
#	resources/js/helpers.js
#	resources/js/i18n/lang/en.json
#	resources/js/i18n/lang/sk.json
#	resources/js/store/modules/fileFunctions.js
#	resources/js/views/Shared/SharedPage.vue
This commit is contained in:
Peter Papp
2020-08-28 16:14:28 +02:00
181 changed files with 9905 additions and 149203 deletions
@@ -2,7 +2,7 @@
<PageTab :is-loading="isLoading" class="form-fixed-width">
<!--Personal Information-->
<PageTabGroup>
<PageTabGroup v-if="! isLoading">
<div class="form block-form">
<FormLabel>{{ $t('admin_settings.appearance.section_general') }}</FormLabel>
@@ -135,7 +135,7 @@
// Send request to get verify account
axios
.put('/api/settings/email', this.mail)
.post('/api/settings/email', this.mail)
.then(() => {
events.$emit('toaster', {
@@ -57,7 +57,9 @@
</div>
</div>
<FormLabel class="mt-70">{{ $t('admin_settings.others.section_others') }}</FormLabel>
<FormLabel class="mt-70">
{{ $t('admin_settings.others.section_others') }}
</FormLabel>
<div class="block-wrapper">
<label>{{ $t('admin_settings.others.contact_email') }}:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Contact Email"
@@ -77,6 +79,16 @@
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<FormLabel class="mt-70">
{{ $t('admin_settings.others.section_cache') }}
</FormLabel>
<InfoBox>
{{ $t('admin_settings.others.cache_disclaimer') }}
</InfoBox>
<ButtonBase @click.native="flushCache" :loading="isFlushingCache" :disabled="isFlushingCache" type="submit" button-style="theme" class="submit-button">
{{ $t('admin_settings.others.cache_clear') }}
</ButtonBase>
</div>
</PageTabGroup>
</PageTab>
@@ -95,6 +107,7 @@
import PageTab from '@/components/Others/Layout/PageTab'
import InfoBox from '@/components/Others/Forms/InfoBox'
import {required} from 'vee-validate/dist/rules'
import {events} from '@/bus'
import axios from 'axios'
export default {
@@ -117,6 +130,7 @@
data() {
return {
isLoading: true,
isFlushingCache: false,
app: {
contactMail: '',
googleAnalytics: '',
@@ -126,6 +140,23 @@
},
}
},
methods: {
flushCache() {
this.isFlushingCache = true
axios.get('/api/flush-cache')
.then(() => {
events.$emit('toaster', {
type: 'success',
message: 'Your cache was successfully deleted.',
})
})
.finally(() => {
this.isFlushingCache = false
})
}
},
mounted() {
axios.get('/api/settings', {
params: {
@@ -710,7 +710,7 @@
// Send request to get verify account
axios
.post('/api/setup/stripe-credentials', this.stripeCredentials)
.post('/api/settings/stripe', this.stripeCredentials)
.then(() => {
// End loading
-11
View File
@@ -7,7 +7,6 @@
<div class="logo">
<a href="https://vuefilemanager.com" target="_blank">
<img src="/assets/images/vuefilemanager-horizontal-logo.svg" alt="VueFileManager" class="light-mode">
<img src="/assets/images/vuefilemanager-horizontal-logo-dark.svg" alt="VueFileManager" class="dark-mode">
</a>
</div>
<div class="metadata">
@@ -276,16 +275,6 @@
@media (prefers-color-scheme: dark) {
.logo {
.dark-mode {
display: block;
}
.light-mode {
display: none;
}
}
.metadata {
.meta-title {
+10 -17
View File
@@ -2,13 +2,13 @@
<div id="single-page">
<!--Page Content-->
<div id="page-content" v-if="! isLoading && invoices.length > 0">
<div id="page-content" v-show="! isLoading && config.stripe_public_key">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<DatatableWrapper :paginator="true" :columns="columns" :data="invoices" class="table">
<template scope="{ row }">
<div class="content-page" v-if="config.stripe_public_key">
<DatatableWrapper @data="invoices = $event" @init="isLoading = false" api="/api/invoices" :paginator="false" :columns="columns" class="table">
<template slot-scope="{ row }">
<tr>
<td>
<a :href="$getInvoiceLink(row.data.attributes.customer, row.data.id)" target="_blank" class="cell-item">
@@ -126,27 +126,27 @@
{
label: this.$t('admin_page_invoices.table.number'),
field: 'data.attributes.order',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.total'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.plan'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.payed'),
field: 'data.attributes.created_at',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.user'),
field: 'relationships.user.data.attributes.name',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -156,15 +156,8 @@
}
},
created() {
if (this.config.stripe_public_key) {
axios.get('/api/invoices')
.then(response => {
this.invoices = response.data.data
this.isLoading = false
})
} else {
if (! this.config.stripe_public_key)
this.isLoading = false
}
}
}
</script>
+6 -14
View File
@@ -1,12 +1,12 @@
<template>
<div id="single-page">
<div id="page-content" v-if="! isLoading && pages.length > 0">
<div id="page-content" v-show="! isLoading">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<DatatableWrapper :paginator="false" :columns="columns" :data="pages" class="table table-users">
<template scope="{ row }">
<DatatableWrapper @init="isLoading = false" api="/api/pages" :paginator="false" :columns="columns" class="table table-users">
<template slot-scope="{ row }">
<tr>
<td class="name" style="min-width: 200px">
<router-link :to="{name: 'PageEdit', params: {slug: row.data.attributes.slug}}" class="cell-item" tag="div">
@@ -75,21 +75,20 @@
data() {
return {
isLoading: true,
pages: undefined,
columns: [
{
label: this.$t('admin_pages.table.page'),
field: 'data.attributes.title',
field: 'title',
sortable: true
},
{
label: this.$t('admin_pages.table.slug'),
field: 'data.attributes.slug',
field: 'slug',
sortable: true
},
{
label: this.$t('admin_pages.table.status'),
field: 'data.attributes.visibility',
field: 'visibility',
sortable: true
},
{
@@ -104,13 +103,6 @@
this.$updateText('/pages/' + slug, 'visibility', val)
}
},
created() {
axios.get('/api/pages')
.then(response => {
this.pages = response.data.data
this.isLoading = false
})
}
}
</script>
+27 -25
View File
@@ -1,12 +1,12 @@
<template>
<div id="single-page">
<!--Page Content-->
<div id="page-content" v-if="! isLoading && plans.length > 0">
<!--Stripe plans-->
<div id="page-content" v-show="stripeConfiguredWithPlans">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<div class="content-page" v-if="config.stripe_public_key">
<div class="table-tools">
<div class="buttons">
<router-link :to="{name: 'PlanCreate'}">
@@ -19,8 +19,8 @@
</div>
</div>
<DatatableWrapper :paginator="false" :columns="columns" :data="plans" class="table table-users">
<template scope="{ row }">
<DatatableWrapper @data="plans = $event" @init="isLoading = false" api="/api/plans" :paginator="false" :columns="columns" class="table table-users">
<template slot-scope="{ row }">
<tr>
<td style="max-width: 80px">
<span class="cell-item">
@@ -64,9 +64,9 @@
</div>
</div>
<!--Empty plans-->
<!--Stripe configured but has empty plans-->
<EmptyPageContent
v-if="! isLoading && plans.length === 0 && config.stripe_public_key"
v-if="isEmptyPlans"
icon="file"
:title="$t('admin_page_plans.empty.title')"
:description="$t('admin_page_plans.empty.description')"
@@ -76,9 +76,9 @@
</router-link>
</EmptyPageContent>
<!--Stripe Not Configured-->
<!--Stripe is Not Configured-->
<EmptyPageContent
v-if="! config.stripe_public_key"
v-if="stripeIsNotConfigured"
icon="settings"
:title="$t('activation.stripe.title')"
:description="$t('activation.stripe.description')"
@@ -126,6 +126,18 @@
Edit2Icon,
Spinner,
},
computed: {
...mapGetters(['config']),
isEmptyPlans() {
return ! this.isLoading && this.plans.length === 0 && this.config.stripe_public_key
},
stripeIsNotConfigured() {
return ! this.config.stripe_public_key
},
stripeConfiguredWithPlans() {
return ! this.isLoading && this.config.stripe_public_key
}
},
data() {
return {
isLoading: true,
@@ -134,27 +146,27 @@
{
label: this.$t('admin_page_plans.table.status'),
field: 'data.attributes.status',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_plans.table.name'),
field: 'data.attributes.name',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_plans.table.subscribers'),
field: 'data.attributes.subscribers',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_plans.table.price'),
field: 'data.attributes.price',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_plans.table.storage_capacity'),
field: 'data.attributes.capacity',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -163,24 +175,14 @@
],
}
},
computed: {
...mapGetters(['config']),
},
methods: {
changeStatus(val, id) {
this.$updateText('/plans/' + id + '/update', 'is_active', val)
}
},
created() {
if (this.config.stripe_public_key) {
axios.get('/api/plans')
.then(response => {
this.plans = response.data.data
this.isLoading = false
})
} else {
if (! this.config.stripe_public_key)
this.isLoading = false
}
}
}
</script>
@@ -70,11 +70,12 @@
this.isSendingRequest = true
axios
.delete(this.$store.getters.api + '/plans/' + this.$route.params.id,
.post(this.$store.getters.api + '/plans/' + this.$route.params.id,
{
data: {
name: this.planName
}
},
_method: 'delete'
}
)
.then(() => {
@@ -1,8 +1,10 @@
<template>
<PageTab :is-loading="isLoading">
<PageTabGroup v-if="subscribers && subscribers.length > 0">
<DatatableWrapper :paginator="true" :columns="columns" :data="subscribers" class="table">
<template scope="{ row }">
<PageTabGroup>
<DatatableWrapper @init="isLoading = false" :api="'/api/plans/' + this.$route.params.id + '/subscribers'" :paginator="false" :columns="columns" :data="subscribers" class="table">
<!--Table data content-->
<template slot-scope="{ row }">
<tr>
<td>
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}">
@@ -30,11 +32,15 @@
</td>
</tr>
</template>
<!--Empty page-->
<template v-slot:empty-page>
<InfoBox>
<p>{{ $t('admin_page_plans.subscribers.empty') }}</p>
</InfoBox>
</template>
</DatatableWrapper>
</PageTabGroup>
<InfoBox v-else>
<p>{{ $t('admin_page_plans.subscribers.empty') }}</p>
</InfoBox>
</PageTab>
</template>
@@ -62,17 +68,17 @@
data() {
return {
subscribers: undefined,
isLoading: false,
isLoading: true,
columns: [
{
label: this.$t('admin_page_user.table.name'),
field: 'data.attributes.name',
field: 'name',
sortable: true
},
{
label: this.$t('admin_page_user.table.storage_used'),
field: 'data.relationships.storage.data.attributes.used',
sortable: true
field: 'used',
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -81,13 +87,6 @@
],
}
},
created() {
axios.get('/api/plans/' + this.$route.params.id + '/subscribers')
.then(response => {
this.subscribers = response.data.data
this.isLoading = false
})
}
}
</script>
+14 -20
View File
@@ -1,10 +1,12 @@
<template>
<div id="single-page">
<div id="page-content" v-if="! isLoading">
<div id="page-content">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<!--Table tools-->
<div class="table-tools">
<div class="buttons">
<router-link :to="{name: 'UserCreate'}">
@@ -13,12 +15,11 @@
</MobileActionButton>
</router-link>
</div>
<div class="searching">
</div>
</div>
<DatatableWrapper :paginator="true" :columns="columns" :data="users" class="table table-users">
<template scope="{ row }">
<!--Datatable-->
<DatatableWrapper @init="isLoading = false" api="/api/users" :paginator="true" :columns="columns" class="table table-users">
<template slot-scope="{ row }">
<tr>
<td style="min-width: 320px">
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}">
@@ -113,7 +114,6 @@
data() {
return {
isLoading: true,
users: [],
columns: undefined,
}
},
@@ -133,34 +133,34 @@
this.columns = [
{
label: this.$t('admin_page_user.table.name'),
field: 'data.attributes.name',
field: 'name',
sortable: true
},
{
label: this.$t('admin_page_user.table.role'),
field: 'data.attributes.role',
field: 'role',
sortable: true
},
{
label: this.$t('admin_page_user.table.plan'),
field: 'data.attributes.subscription',
sortable: true,
field: 'subscription',
sortable: false,
hidden: ! this.config.isSaaS,
},
{
label: this.$t('admin_page_user.table.storage_used'),
field: 'relationships.storage.data.attributes.used',
field: 'used',
sortable: true
},
{
label: this.$t('admin_page_user.table.storage_capacity'),
field: 'relationships.storage.data.attributes.capacity',
field: 'settings.storage_capacity',
sortable: true,
hidden: ! this.config.storageLimit,
},
{
label: this.$t('admin_page_user.table.created_at'),
field: 'data.attributes.created_at_formatted',
field: 'created_at',
sortable: true
},
{
@@ -169,12 +169,6 @@
sortable: false
},
]
axios.get('/api/users')
.then(response => {
this.users = response.data.data
this.isLoading = false
})
}
}
</script>
@@ -73,11 +73,12 @@
this.isSendingRequest = true
axios
.delete(this.$store.getters.api + '/users/' + this.$route.params.id + '/delete',
.post(this.$store.getters.api + '/users/' + this.$route.params.id + '/delete',
{
data: {
name: this.userName
}
},
_method: 'delete'
}
)
.then((response) => {
@@ -188,10 +188,11 @@
// Send request to get user reset link
axios
.patch(this.$store.getters.api + '/users/' + this.$route.params.id + '/role', {
.post(this.$store.getters.api + '/users/' + this.$route.params.id + '/role', {
attributes: {
role: this.userRole,
}
},
_method: 'patch'
})
.then(() => {
@@ -1,8 +1,16 @@
<template>
<PageTab :is-loading="isLoading" :class="{'form-fixed-width': ! isLoading && invoices.length === 0}">
<PageTabGroup v-if="invoices && invoices.length > 0">
<DatatableWrapper :paginator="true" :columns="columns" :data="invoices" class="table">
<template scope="{ row }">
<PageTab :is-loading="isLoading">
<PageTabGroup>
<DatatableWrapper
@init="isLoading = false"
:api="'/api/users/' + this.$route.params.id + '/invoices'"
:paginator="false"
:columns="columns"
class="table"
>
<!--Table data content-->
<template slot-scope="{ row }">
<tr>
<td>
<a :href="$getInvoiceLink(row.data.attributes.customer, row.data.id)" target="_blank" class="cell-item">
@@ -33,11 +41,15 @@
</td>
</tr>
</template>
<!--Empty page-->
<template v-slot:empty-page>
<InfoBox class="form-fixed-width">
<p>{{ $t('admin_page_user.invoices.empty') }}</p>
</InfoBox>
</template>
</DatatableWrapper>
</PageTabGroup>
<InfoBox v-else>
<p>{{ $t('admin_page_user.invoices.empty') }}</p>
</InfoBox>
</PageTab>
</template>
@@ -63,27 +75,26 @@
data() {
return {
isLoading: true,
invoices: undefined,
columns: [
{
label: this.$t('admin_page_invoices.table.number'),
field: 'data.attributes.order',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.total'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.plan'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_invoices.table.payed'),
field: 'data.attributes.created_at',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -92,13 +103,6 @@
],
}
},
created() {
axios.get('/api/users/' + this.$route.params.id + '/invoices')
.then(response => {
this.invoices = response.data.data
this.isLoading = false
})
}
}
</script>
@@ -96,10 +96,11 @@
// Send request to get user reset link
axios
.patch(this.$store.getters.api + '/users/' + this.$route.params.id + '/capacity', {
.post(this.$store.getters.api + '/users/' + this.$route.params.id + '/capacity', {
attributes: {
storage_capacity: this.capacity
}
},
_method: 'patch'
})
.then(() => {
@@ -1,6 +1,6 @@
<template>
<PageTab :is-loading="isLoading" class="form-fixed-width">
<PageTabGroup v-if="subscription">
<PageTabGroup v-if="subscription && !isLoading">
<FormLabel>
{{ $t('user_subscription.title') }}
</FormLabel>
@@ -27,7 +27,7 @@
</ListInfo>
</div>
</PageTabGroup>
<PageTabGroup v-if="! subscription">
<PageTabGroup v-if="! subscription && !isLoading">
<InfoBox>
<p>{{ $t('admin_page_user.subscription.empty') }}</p>
</InfoBox>
@@ -3,7 +3,7 @@
<!--Create new password-->
<AuthContent name="create-new-password" :visible="true">
<img v-if="config.app_logo" class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_create_password.title') }}</h1>
@@ -56,7 +56,9 @@
<!--Password reset successfully-->
<AuthContent name="password-reset-successfully" :visible="false">
<img class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_forgotten_password.pass_reseted_title') }}</h1>
<h2>{{ $t('page_forgotten_password.pass_reseted_subtitle') }}</h2>
@@ -3,7 +3,7 @@
<!--Forgotten your password?-->
<AuthContent name="forgotten-password" :visible="true">
<img v-if="config.app_logo" class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_forgotten_password.title') }}</h1>
@@ -30,7 +30,9 @@
<!--Password reset link sended-->
<AuthContent name="password-reset-link-sended" :visible="false">
<img class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_forgotten_password.pass_sennded_title') }}</h1>
<h2>{{ $t('page_forgotten_password.pass_sennded_subtitle') }}</h2>
+1 -1
View File
@@ -3,7 +3,7 @@
<!--Log In by Email-->
<AuthContent name="log-in" :visible="true">
<img v-if="config.app_logo" class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_login.title') }}</h1>
+1 -1
View File
@@ -3,7 +3,7 @@
<!--Registration-->
<AuthContent name="sign-up" :visible="true">
<img v-if="config.app_logo" class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_registration.title') }}</h1>
+1 -4
View File
@@ -92,7 +92,7 @@
</div>
</div>
<div v-if="config.storageLimit && config.isSaaS && config.app_payments_active && !canShowIncompletePayment" class="headline-actions">
<router-link :to="{name: 'UpgradePlan'}" v-if="canShowUpgradeButton">
<router-link :to="{name: 'UpgradePlan'}">
<ButtonBase class="upgrade-button" button-style="secondary" type="button">
{{ $t('global.upgrade_plan') }}
</ButtonBase>
@@ -174,9 +174,6 @@
canShowSubscriptionSettings() {
return this.config.isSaaS
},
canShowUpgradeButton() {
return this.config.isDemo || this.config.storageDefaultSpace === this.user.relationships.storage.data.attributes.capacity || this.config.storageLimit && this.user.relationships.storage.data.attributes.used > 95
},
canShowUpgradeWarning() {
return this.config.storageLimit && this.user.relationships.storage.data.attributes.used > 95
},
@@ -1,291 +0,0 @@
<template>
<AuthContentWrapper ref="auth">
<!--Database Credentials-->
<AuthContent name="database-credentials" :visible="true">
<div class="content-headline">
<settings-icon size="40" class="title-icon"></settings-icon>
<h1>Setup Wizard</h1>
<h2>Set up your storage driver and email client.</h2>
</div>
<ValidationObserver @submit.prevent="EnvironmentSetupSubmit" ref="environmentSetup" v-slot="{ invalid }" tag="form" class="form block-form">
<InfoBox>
<p>If you dont know which storage driver set, keep selected <b>'Local Driver'</b>. For more info, where
you can host your files <a href="https://vuefilemanager.com/docs/guide/storage.html#introduction" target="_blank">visit our guide</a>.</p>
</InfoBox>
<FormLabel>Storage Setup</FormLabel>
<div class="block-wrapper">
<label>Storage Service:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Storage Service" rules="required" v-slot="{ errors }">
<SelectInput v-model="storage.driver" :options="storageServiceList" default="local" placeholder="Select your storage service" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="storage-additionals" v-if="storage.driver !== 'local'">
<div class="block-wrapper">
<label>Key:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Key" rules="required" v-slot="{ errors }">
<input v-model="storage.key" placeholder="Paste your key" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Secret:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Secret" rules="required" v-slot="{ errors }">
<input v-model="storage.secret" placeholder="Paste your secret" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper" v-if="storage.driver !== 's3'">
<label>Endpoint URL:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Endpoint" :rules="{ required: true, regex: /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ }" v-slot="{ errors }">
<input v-model="storage.endpoint" placeholder="Type your endpoint" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
<small class="input-help">
Provide full URIs of your storage endpoint, for example 'https://ams3.digitaloceanspaces.com'.
</small>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Region:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Region" rules="required" v-slot="{ errors }">
<input v-model="storage.region" placeholder="Type your region" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
<small class="input-help">
Provide your region, for example 'ams3', 'fra1', 'nyc1'...
</small>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Bucket:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Bucket" rules="required" v-slot="{ errors }">
<input v-model="storage.bucket" placeholder="Type your bucket name" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
<small class="input-help">
Provide your created unique bucket name
</small>
</ValidationProvider>
</div>
<InfoBox>
<p>Later, you can edit these data in your <b>.env</b> file which is located in app root folder.</p>
</InfoBox>
</div>
<FormLabel class="mt-70">Email Setup</FormLabel>
<div class="block-wrapper">
<label>Mail Driver:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Driver" rules="required" v-slot="{ errors }">
<SelectInput v-model="mail.driver" :options="mailDriverList" default="smtp" placeholder="Select your mail driver" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Host:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Host" rules="required" v-slot="{ errors }">
<input v-model="mail.host" placeholder="Type your mail host" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Port:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Port" rules="required" v-slot="{ errors }">
<input v-model="mail.port" placeholder="Type your mail port" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Username:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Username" rules="required" v-slot="{ errors }">
<input v-model="mail.username" placeholder="Type your mail username" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Password:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Password" rules="required" v-slot="{ errors }">
<input v-model="mail.password" placeholder="Type your mail password" type="text" :class="{'is-error': errors[0]}" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Encryption:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Encryption" rules="required" v-slot="{ errors }">
<SelectInput v-model="mail.encryption" :options="encryptionList" placeholder="Select your mail encryption" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="submit-wrapper">
<AuthButton icon="chevron-right" text="Save and Set General Settings" :loading="isLoading" :disabled="isLoading"/>
</div>
</ValidationObserver>
</AuthContent>
</AuthContentWrapper>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
import SelectInput from '@/components/Others/Forms/SelectInput'
import FormLabel from '@/components/Others/Forms/FormLabel'
import InfoBox from '@/components/Others/Forms/InfoBox'
import AuthContent from '@/components/Auth/AuthContent'
import AuthButton from '@/components/Auth/AuthButton'
import { SettingsIcon } from 'vue-feather-icons'
import {required} from 'vee-validate/dist/rules'
import {mapGetters} from 'vuex'
import axios from 'axios'
export default {
name: 'EnvironmentSetup',
components: {
AuthContentWrapper,
ValidationProvider,
ValidationObserver,
SettingsIcon,
SelectInput,
AuthContent,
AuthButton,
FormLabel,
required,
InfoBox,
},
data() {
return {
isLoading: false,
storageServiceList: [
{
label: 'Local Driver',
value: 'local',
},
{
label: 'Amazon Web Services S3',
value: 's3',
},
{
label: 'Digital Ocean Spaces',
value: 'spaces',
},
{
label: 'Object Cloud Storage by Wasabi',
value: 'wasabi',
},
{
label: 'Backblaze B2 Cloud Storage',
value: 'backblaze',
},
],
encryptionList: [
{
label: 'TLS',
value: 'tls',
},
{
label: 'SSL',
value: 'ssl',
},
],
mailDriverList: [
{
label: 'smtp',
value: 'smtp',
},
{
label: 'sendmail',
value: 'sendmail',
},
{
label: 'mailgun',
value: 'mailgun',
},
{
label: 'ses',
value: 'ses',
},
{
label: 'postmark',
value: 'postmark',
},
{
label: 'log',
value: 'log',
},
{
label: 'array',
value: 'array',
},
],
storage: {
driver: 'local',
key: '',
secret: '',
endpoint: '',
region: '',
bucket: '',
},
mail: {
driver: 'smtp',
host: '',
port: '',
username: '',
password: '',
encryption: '',
}
}
},
methods: {
async EnvironmentSetupSubmit() {
// Validate fields
const isValid = await this.$refs.environmentSetup.validate();
if (!isValid) return;
// Start loading
this.isLoading = true
// Send request to get verify account
axios
.post('/api/setup/environment-setup', {
storage: this.storage,
mail: this.mail,
})
.then(response => {
// End loading
this.isLoading = false
// Redirect to next step
this.$router.push({name: 'AppSetup'})
})
.catch(error => {
// End loading
this.isLoading = false
})
},
},
created() {
this.$scrollTop()
}
}
</script>
<style scoped lang="scss">
//@import '@assets/vue-file-manager/_auth-form';
@import '@assets/vue-file-manager/_forms';
@import '@assets/vue-file-manager/_auth';
@import '@assets/vue-file-manager/_setup_wizard';
</style>
+2 -2
View File
@@ -11,8 +11,8 @@
...mapGetters(['config']),
},
mounted() {
//if (this.config.installation === 'setup-done' || this.config.installation === 'quiet-update')
//this.$router.push({name: 'SignIn'})
if (this.config.installation === 'setup-done' || this.config.installation === 'quiet-update')
this.$router.push({name: 'SignIn'})
}
}
</script>
@@ -0,0 +1,456 @@
<template>
<AuthContentWrapper ref="auth">
<!--Database Credentials-->
<AuthContent name="database-credentials" :visible="true">
<div class="content-headline">
<settings-icon size="40" class="title-icon"></settings-icon>
<h1>Setup Wizard</h1>
<h2>Set up your storage driver and email client.</h2>
</div>
<ValidationObserver @submit.prevent="EnvironmentSetupSubmit" ref="environmentSetup" v-slot="{ invalid }" tag="form" class="form block-form">
<InfoBox>
<p>If you dont know which storage driver set, keep selected <b>'Local Driver'</b>. For more info, where
you can host your files <a href="https://vuefilemanager.com/docs/guide/storage.html#introduction" target="_blank">visit our guide</a>.</p>
</InfoBox>
<FormLabel>Storage Setup</FormLabel>
<div class="block-wrapper">
<label>Storage Service:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Storage Service" rules="required" v-slot="{ errors }">
<SelectInput v-model="storage.driver" :options="storageServiceList" default="local" placeholder="Select your storage service" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="storage-additionals" v-if="storage.driver !== 'local'">
<div class="block-wrapper">
<label>Key:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Key" rules="required" v-slot="{ errors }">
<input v-model="storage.key" placeholder="Paste your key" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Secret:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Secret" rules="required" v-slot="{ errors }">
<input v-model="storage.secret" placeholder="Paste your secret" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Region:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Region" rules="required" v-slot="{ errors }">
<SelectInput v-model="storage.region" :options="regionList" :key="storage.driver" placeholder="Select your region" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
<small class="input-help">
Select your region where is your bucket/space created.
</small>
</ValidationProvider>
</div>
<div class="block-wrapper" v-if="storage.driver !== 's3'">
<label>Endpoint URL:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Endpoint" rules="required" v-slot="{ errors }">
<input v-model="storage.endpoint" placeholder="Type your endpoint" type="text" :class="{'is-error': errors[0]}" readonly/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Bucket:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Bucket" rules="required" v-slot="{ errors }">
<input v-model="storage.bucket" placeholder="Type your bucket name" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
<small class="input-help">
Provide your created unique bucket name
</small>
</ValidationProvider>
</div>
<InfoBox>
<p>Later, you can edit these data in your <b>.env</b> file which is located in app root folder.</p>
</InfoBox>
</div>
<FormLabel class="mt-70">Email Setup</FormLabel>
<div class="block-wrapper">
<label>Mail Driver:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Driver" rules="required" v-slot="{ errors }">
<SelectInput v-model="mail.driver" :options="mailDriverList" default="smtp" placeholder="Select your mail driver" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Host:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Host" rules="required" v-slot="{ errors }">
<input v-model="mail.host" placeholder="Type your mail host" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Port:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Port" rules="required" v-slot="{ errors }">
<input v-model="mail.port" placeholder="Type your mail port" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Username:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Username" rules="required" v-slot="{ errors }">
<input v-model="mail.username" placeholder="Type your mail username" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Password:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Password" rules="required" v-slot="{ errors }">
<input v-model="mail.password" placeholder="Type your mail password" type="text" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="block-wrapper">
<label>Mail Encryption:</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Mail Encryption" rules="required" v-slot="{ errors }">
<SelectInput v-model="mail.encryption" :options="encryptionList" placeholder="Select your mail encryption" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<div class="submit-wrapper">
<AuthButton icon="chevron-right" text="Save and Set General Settings" :loading="isLoading" :disabled="isLoading"/>
</div>
</ValidationObserver>
</AuthContent>
</AuthContentWrapper>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import AuthContentWrapper from '@/components/Auth/AuthContentWrapper'
import SelectInput from '@/components/Others/Forms/SelectInput'
import FormLabel from '@/components/Others/Forms/FormLabel'
import InfoBox from '@/components/Others/Forms/InfoBox'
import AuthContent from '@/components/Auth/AuthContent'
import AuthButton from '@/components/Auth/AuthButton'
import {SettingsIcon} from 'vue-feather-icons'
import {required} from 'vee-validate/dist/rules'
import {mapGetters} from 'vuex'
import axios from 'axios'
export default {
name: 'EnvironmentSetup',
components: {
AuthContentWrapper,
ValidationProvider,
ValidationObserver,
SettingsIcon,
SelectInput,
AuthContent,
AuthButton,
FormLabel,
required,
InfoBox,
},
watch: {
'storage.driver': function () {
this.storage.region = ''
},
'storage.region': function (val) {
if (this.storage.driver === 'spaces')
this.storage.endpoint = 'https://' + val + '.digitaloceanspaces.com'
if (this.storage.driver === 'wasabi')
this.storage.endpoint = 'https://s3.' + val + '.wasabisys.com'
if (this.storage.driver === 'backblaze')
this.storage.endpoint = 'https://s3.' + val + '.backblazeb2.com'
},
},
computed: {
regionList() {
switch (this.storage.driver) {
case 's3':
return this.s3Regions
break
case 'spaces':
return this.digitalOceanRegions
break
case 'wasabi':
return this.wasabiRegions
break
case 'backblaze':
return this.backblazeRegions
break
}
},
},
data() {
return {
isLoading: false,
wasabiRegions: [
{
label: 'US East 1 (N. Virginia)',
value: 'us-east-1',
},
{
label: 'US East 2 (N. Virginia)',
value: 'us-east-2',
},
{
label: 'US West 1 (Oregon)',
value: 'us-west-1',
},
{
label: 'EU Central 1 (Amsterdam)',
value: 'eu-central-1',
},
],
backblazeRegions: [
{
label: 'us-west-001',
value: 'us-west-001',
},
{
label: 'us-west-002',
value: 'us-west-002',
},
{
label: 'eu-central-003',
value: 'eu-central-003',
},
],
digitalOceanRegions: [
{
label: 'New York',
value: 'nyc3',
},
{
label: 'San Francisco',
value: 'sfo2',
},
{
label: 'Amsterdam',
value: 'ams3',
},
{
label: 'Singapore',
value: 'sgp1',
},
{
label: 'Frankfurt',
value: 'fra1',
},
],
s3Regions: [
{
label: 'us-east-1',
value: 'us-east-1',
},
{
label: 'us-east-2',
value: 'us-east-2',
},
{
label: 'us-west-1',
value: 'us-west-1',
},
{
label: 'us-west-2',
value: 'us-west-2',
},
{
label: 'af-south-1',
value: 'af-south-1',
},
{
label: 'ap-east-1',
value: 'ap-east-1',
},
{
label: 'ap-south-1',
value: 'ap-south-1',
},
{
label: 'ap-northeast-2',
value: 'ap-northeast-2',
},
{
label: 'ap-southeast-1',
value: 'ap-southeast-1',
},
{
label: 'ap-southeast-2',
value: 'ap-southeast-2',
},
{
label: 'ap-northeast-1',
value: 'ap-northeast-1',
},
{
label: 'ca-central-1',
value: 'ca-central-1',
},
{
label: 'eu-central-1',
value: 'eu-central-1',
},
{
label: 'eu-west-1',
value: 'eu-west-1',
},
{
label: 'eu-west-2',
value: 'eu-west-2',
},
{
label: 'eu-south-1',
value: 'eu-south-1',
},
{
label: 'eu-west-3',
value: 'eu-west-3',
},
{
label: 'eu-north-1',
value: 'eu-north-1',
},
{
label: 'me-south-1',
value: 'me-south-1',
},
{
label: 'sa-east-1',
value: 'sa-east-1',
},
],
storageServiceList: [
{
label: 'Local Driver',
value: 'local',
},
{
label: 'Amazon Web Services S3',
value: 's3',
},
{
label: 'Digital Ocean Spaces',
value: 'spaces',
},
{
label: 'Object Cloud Storage by Wasabi',
value: 'wasabi',
},
{
label: 'Backblaze B2 Cloud Storage',
value: 'backblaze',
},
],
encryptionList: [
{
label: 'TLS',
value: 'tls',
},
{
label: 'SSL',
value: 'ssl',
},
],
mailDriverList: [
{
label: 'smtp',
value: 'smtp',
},
{
label: 'sendmail',
value: 'sendmail',
},
{
label: 'mailgun',
value: 'mailgun',
},
{
label: 'ses',
value: 'ses',
},
{
label: 'postmark',
value: 'postmark',
},
{
label: 'log',
value: 'log',
},
{
label: 'array',
value: 'array',
},
],
storage: {
driver: 'local',
key: '',
secret: '',
endpoint: '',
region: '',
bucket: '',
},
mail: {
driver: 'smtp',
host: '',
port: '',
username: '',
password: '',
encryption: '',
}
}
},
methods: {
async EnvironmentSetupSubmit() {
// Validate fields
const isValid = await this.$refs.environmentSetup.validate();
if (!isValid) return;
// Start loading
this.isLoading = true
// Send request to get verify account
axios
.post('/api/setup/environment-setup', {
storage: this.storage,
mail: this.mail,
})
.then(response => {
// End loading
this.isLoading = false
// Redirect to next step
this.$router.push({name: 'AppSetup'})
})
.catch(error => {
// End loading
this.isLoading = false
})
},
},
created() {
this.$scrollTop()
}
}
</script>
<style scoped lang="scss">
@import '@assets/vue-file-manager/_forms';
@import '@assets/vue-file-manager/_auth';
@import '@assets/vue-file-manager/_setup_wizard';
</style>
+3 -1
View File
@@ -3,7 +3,9 @@
<!--Password reset link sended-->
<AuthContent name="not-found" :visible="true">
<img class="logo" :src="config.app_logo" :alt="config.app_name">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<h1>{{ $t('page_shared_404.title') }}</h1>
<h2>{{ $t('page_shared_404.subtitle') }}</h2>
+239 -270
View File
@@ -1,309 +1,278 @@
<template>
<div id="shared">
<!-- File Preview -->
<FileFullPreview />
<div id="shared">
<!-- File Preview -->
<FileFullPreview />
<!--Loading Spinenr-->
<Spinner v-if="isPageLoading" />
<!--Loading Spinenr-->
<Spinner v-if="isPageLoading"/>
<!--Move item setup-->
<MoveItem />
<!--Move item setup-->
<MoveItem />
<!--Mobile Menu-->
<MobileMenu />
<!--Mobile Menu-->
<MobileMenu/>
<!--System alerts-->
<Alert />
<!--System alerts-->
<Alert />
<!--Background vignette-->
<Vignette />
<!--Background vignette-->
<Vignette/>
<!--Password verification-->
<div v-if="currentPage === 'page-password'" id="password-view">
<!--Verify share link by password-->
<AuthContent class="center" name="password" :visible="true">
<img class="logo" :src="config.app_logo" :alt="config.app_name" />
<h1>{{ $t("page_shared.title") }}</h1>
<h2>{{ $t("page_shared.subtitle") }}</h2>
<!--Password verification-->
<div v-if="currentPage === 'page-password'" id="password-view">
<ValidationObserver
@submit.prevent="authenticateProtected"
ref="authenticateProtected"
v-slot="{ invalid }"
tag="form"
class="form inline-form"
>
<ValidationProvider
tag="div"
mode="passive"
class="input-wrapper"
name="Password"
rules="required"
v-slot="{ errors }"
>
<input
v-model="password"
:placeholder="$t('page_shared.placeholder_pass')"
type="password"
:class="{ 'is-error': errors[0] }"
/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
<!--Verify share link by password-->
<AuthContent class="center" name="password" :visible="true">
<img v-if="config.app_logo" class="logo" :src="$getImage(config.app_logo)" :alt="config.app_name">
<b v-if="! config.app_logo" class="auth-logo-text">{{ config.app_name }}</b>
<AuthButton
icon="chevron-right"
:text="$t('page_shared.submit')"
:loading="isLoading"
:disabled="isLoading"
/>
</ValidationObserver>
</AuthContent>
</div>
<h1>{{ $t('page_shared.title') }}</h1>
<h2>{{ $t('page_shared.subtitle') }}</h2>
<!--File browser-->
<div v-if="currentPage === 'page-files'" id="files-view">
<div id="single-file" v-if="sharedDetail.type === 'file'">
<div class="single-file-wrapper">
<FileItemGrid
v-if="sharedFile"
:data="sharedFile"
:context-menu="false"
/>
<ValidationObserver @submit.prevent="authenticateProtected" ref="authenticateProtected" v-slot="{ invalid }" tag="form" class="form inline-form">
<ButtonBase
@click.native="download"
class="download-button"
button-style="theme"
>
{{ $t("page_shared.download_file") }}
</ButtonBase>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Password" rules="required" v-slot="{ errors }">
<input v-model="password" :placeholder="$t('page_shared.placeholder_pass')" type="password" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
<AuthButton icon="chevron-right" :text="$t('page_shared.submit')" :loading="isLoading" :disabled="isLoading" />
</ValidationObserver>
</AuthContent>
</div>
</div>
<div
v-if="sharedDetail.type === 'folder'"
@contextmenu.prevent.capture="contextMenu($event, undefined)"
@click="fileViewClick"
>
<!--Context menu-->
<ContextMenu />
<!--Desktop Toolbar-->
<DesktopToolbar />
<!--File browser-->
<FileBrowser />
</div>
<div v-if="currentPage === 'page-files'" id="files-view">
<div id="single-file" v-if="sharedDetail.type === 'file'">
<div class="single-file-wrapper">
<FileItemGrid v-if="sharedFile" :data="sharedFile" :context-menu="false"/>
<ButtonBase @click.native="download" class="download-button" button-style="theme">
{{ $t('page_shared.download_file') }}
</ButtonBase>
</div>
</div>
<div v-if="sharedDetail.type === 'folder'" @contextmenu.prevent.capture="contextMenu($event, undefined)" @click="fileViewClick">
<!--Context menu-->
<ContextMenu/>
<!--Desktop Toolbar-->
<DesktopToolbar/>
<!--File browser-->
<FileBrowser/>
</div>
</div>
</div>
</div>
</template>
<script>
import {
ValidationProvider,
ValidationObserver,
} from "vee-validate/dist/vee-validate.full";
import FileFullPreview from "@/components/FilesView/FileFullpreview";
import DesktopToolbar from "@/components/FilesView/DesktopToolbar";
import FileItemGrid from "@/components/FilesView/FileItemGrid";
import FileBrowser from "@/components/FilesView/FileBrowser";
import ContextMenu from "@/components/FilesView/ContextMenu";
import ButtonBase from "@/components/FilesView/ButtonBase";
import MobileMenu from "@/components/FilesView/MobileMenu";
import AuthContent from "@/components/Auth/AuthContent";
import AuthButton from "@/components/Auth/AuthButton";
import Spinner from "@/components/FilesView/Spinner";
import MoveItem from "@/components/Others/MoveItem";
import Vignette from "@/components/Others/Vignette";
import Alert from "@/components/FilesView/Alert";
import { required } from "vee-validate/dist/rules";
import { mapGetters } from "vuex";
import { events } from "@/bus";
import axios from "axios";
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import FileFullPreview from "@/components/FilesView/FileFullpreview";
import FileItemGrid from '@/components/FilesView/FileItemGrid'
import FileBrowser from '@/components/FilesView/FileBrowser'
import ContextMenu from '@/components/FilesView/ContextMenu'
import ButtonBase from '@/components/FilesView/ButtonBase'
import MobileMenu from '@/components/FilesView/MobileMenu'
import AuthContent from '@/components/Auth/AuthContent'
import AuthButton from '@/components/Auth/AuthButton'
import Spinner from '@/components/FilesView/Spinner'
import MoveItem from '@/components/Others/MoveItem'
import Vignette from '@/components/Others/Vignette'
import Alert from '@/components/FilesView/Alert'
import {required} from 'vee-validate/dist/rules'
import {mapGetters} from 'vuex'
import {events} from '@/bus'
import axios from 'axios'
export default {
name: "SharedPage",
components: {
ValidationProvider,
ValidationObserver,
FileFullPreview,
DesktopToolbar,
FileItemGrid,
AuthContent,
FileBrowser,
ContextMenu,
AuthButton,
MobileMenu,
ButtonBase,
MoveItem,
required,
Vignette,
Spinner,
Alert,
},
computed: {
...mapGetters(["config", "sharedDetail", "sharedFile"]),
},
data() {
return {
checkedAccount: undefined,
password: "",
isLoading: false,
isPageLoading: true,
currentPage: undefined,
};
},
methods: {
async authenticateProtected() {
// Validate fields
const isValid = await this.$refs.authenticateProtected.validate();
export default {
name: 'SharedPage',
components: {
ValidationProvider,
ValidationObserver,
FileFullPreview,
DesktopToolbar,
FileItemGrid,
AuthContent,
FileBrowser,
ContextMenu,
AuthButton,
MobileMenu,
ButtonBase,
MoveItem,
required,
Vignette,
Spinner,
Alert,
},
computed: {
...mapGetters(['config', 'sharedDetail', 'sharedFile']),
},
data() {
return {
checkedAccount: undefined,
password: '',
isLoading: false,
isPageLoading: true,
currentPage: undefined
}
},
methods: {
async authenticateProtected() {
if (!isValid) return;
// Validate fields
const isValid = await this.$refs.authenticateProtected.validate();
// Start loading
this.isLoading = true;
if (!isValid) return;
// Send request to get verify account
axios
.post("/api/shared/authenticate/" + this.$route.params.token, {
password: this.password,
})
.then(() => {
// End loading
this.isLoading = false;
// Start loading
this.isLoading = true
// Redirect to file browser page
this.currentPage = "page-files";
// Send request to get verify account
axios
.post('/api/shared/authenticate/' + this.$route.params.token, {
password: this.password
}).then(() => {
// Get protected files
this.getFiles();
})
.catch((error) => {
if (error.response.status == 401) {
this.$refs.authenticateProtected.setErrors({
Password: [error.response.data.message],
});
}
// End loading
this.isLoading = false
// End loading
this.isLoading = false;
});
},
getFiles() {
// Show folder
if (this.sharedDetail.type === "folder") {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: this.$t("locations.home"),
location: "public",
};
// Redirect to file browser page
this.currentPage = 'page-files'
// Load folder
this.$store.dispatch("browseShared", [
{ folder: homeDirectory, back: false, init: true },
]);
}
// Get protected files
this.getFiles();
// Get file
if (this.sharedDetail.type === "file") {
this.$store.dispatch("getSingleFile");
}
},
download() {
this.$downloadFile(
this.sharedFile.file_url,
this.sharedFile.name + "." + this.sharedFile.mimetype
);
},
fileViewClick() {
events.$emit("contextMenu:hide");
},
contextMenu(event, item) {
events.$emit("contextMenu:show", event, item);
},
},
created() {
axios
.get("/api/shared/" + this.$route.params.token)
.then((response) => {
// Commit shared item options
this.$store.commit("SET_SHARED_DETAIL", response.data.data.attributes);
this.$store.commit(
"SET_PERMISSION",
response.data.data.attributes.permission
);
}).catch(error => {
// Hide page spinner
this.isPageLoading = false;
if (error.response.status == 401) {
// Show password page
if (response.data.data.attributes.protected) {
this.currentPage = "page-password";
} else {
this.currentPage = "page-files";
this.getFiles();
this.$refs.authenticateProtected.setErrors({
'Password': [error.response.data.message]
});
}
// End loading
this.isLoading = false
})
},
getFiles() {
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: this.$t('locations.home'),
location: 'public',
}
// Load folder
this.$store.dispatch('browseShared', [{folder: homeDirectory, back: false, init: true}])
}
// Get file
if (this.sharedDetail.type === 'file') {
this.$store.dispatch('getSingleFile')
}
},
download() {
this.$downloadFile(this.sharedFile.file_url, this.sharedFile.name + '.' + this.sharedFile.mimetype)
},
fileViewClick() {
events.$emit('contextMenu:hide')
},
contextMenu(event, item) {
events.$emit('contextMenu:show', event, item)
},
},
created() {
axios
.get('/api/shared/' + this.$route.params.token, )
.then(response => {
// Commit shared item options
this.$store.commit('SET_SHARED_DETAIL', response.data.data.attributes)
this.$store.commit('SET_PERMISSION', response.data.data.attributes.permission)
// Hide page spinner
this.isPageLoading = false
// Show password page
if (response.data.data.attributes.protected) {
this.currentPage = 'page-password'
} else {
this.currentPage = 'page-files'
this.getFiles()
}
})
.catch(error => {
if (error.response.status == 404) {
this.$router.push({name: 'NotFoundShared'})
}
})
}
})
.catch((error) => {
if (error.response.status == 404) {
this.$router.push({ name: "NotFoundShared" });
}
});
},
};
}
</script>
<style lang="scss" scoped>
@import "@assets/vue-file-manager/_variables";
@import "@assets/vue-file-manager/_mixins";
@import "@assets/vue-file-manager/_auth-form";
@import "@assets/vue-file-manager/_auth";
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
@import '@assets/vue-file-manager/_auth-form';
@import '@assets/vue-file-manager/_auth';
#shared {
height: 100%;
}
#password-view {
display: grid;
height: inherit;
.center {
margin: auto;
}
}
#single-file {
position: absolute;
bottom: 0;
right: 0;
left: 0;
top: 0;
display: grid;
height: 100%;
.single-file-wrapper {
margin: auto;
text-align: center;
.download-button {
margin-top: 15px;
margin-left: auto;
margin-right: auto;
#shared {
height: 100%;
}
}
/deep/ .file-wrapper {
.file-item {
width: 290px;
#password-view {
display: grid;
height: inherit;
&:hover,
&.is-clicked {
background: transparent;
}
.item-shared {
display: none;
}
.center {
margin: auto;
}
}
}
}
#single-file {
position: absolute;
bottom: 0;
right: 0;
left: 0;
top: 0;
display: grid;
height: 100%;
.single-file-wrapper {
margin: auto;
text-align: center;
.download-button {
margin-top: 15px;
margin-left: auto;
margin-right: auto;
}
}
/deep/ .file-wrapper {
.file-item {
width: 290px;
&:hover, &.is-clicked {
background: transparent;
}
.item-shared {
display: none;
}
}
}
}
</style>
+10 -3
View File
@@ -358,6 +358,7 @@
this.errorMessage = error.response.data.message
}
// Show server error
if (error.response.status === 500) {
this.isError = true
this.errorMessage = error.response.data.message
@@ -452,16 +453,22 @@
// Get setup intent for stripe
axios.get('/api/stripe/setup-intent')
.then(response => this.clientSecret = response.data.client_secret)
.then(response => {
this.clientSecret = response.data.client_secret
})
.catch(() => this.$isSomethingWrong())
axios.get('/api/user/payments')
.then(response => {
this.defaultPaymentMethod = response.data.default
this.PaymentMethods = response.data.others
this.isLoading = false
})
.catch(() => this.$isSomethingWrong())
.finally(() => {
this.isLoading = false
}
)
}
}
</script>
+16 -17
View File
@@ -1,9 +1,11 @@
<template>
<PageTab :is-loading="isLoading">
<PageTabGroup v-if="invoices && invoices.length > 0">
<PageTabGroup v-show="! isLoading">
<FormLabel>{{ $t('user_invoices.title') }}</FormLabel>
<DatatableWrapper :paginator="true" :columns="columns" :data="invoices" class="table">
<template scope="{ row }">
<DatatableWrapper @init="isLoading = false" api="/api/user/invoices" :paginator="false" :columns="columns" class="table">
<!--Table data content-->
<template slot-scope="{ row }">
<tr>
<td>
<a :href="'/invoice/' + row.data.attributes.customer + '/' + row.data.id" target="_blank" class="cell-item">
@@ -34,11 +36,15 @@
</td>
</tr>
</template>
<!--Empty page-->
<template v-slot:empty-page>
<InfoBox>
<p>{{ $t('user_invoices.empty') }}</p>
</InfoBox>
</template>
</DatatableWrapper>
</PageTabGroup>
<InfoBox v-else>
<p>{{ $t('user_invoices.empty') }}</p>
</InfoBox>
</PageTab>
</template>
@@ -69,22 +75,22 @@
{
label: this.$t('rows.invoice.number'),
field: 'data.attributes.order',
sortable: true
sortable: false
},
{
label: this.$t('rows.invoice.total'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('rows.invoice.plan'),
field: 'data.attributes.bag.amount',
sortable: true
sortable: false
},
{
label: this.$t('rows.invoice.payed'),
field: 'data.attributes.created_at',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -93,13 +99,6 @@
],
}
},
created() {
axios.get('/api/user/invoices')
.then(response => {
this.invoices = response.data.data
this.isLoading = false
})
}
}
</script>
+1 -1
View File
@@ -48,7 +48,7 @@
import axios from 'axios'
export default {
name: 'Profile',
name: 'Password',
components: {
PageTabGroup,
FormLabel,
+31 -39
View File
@@ -1,16 +1,24 @@
<template>
<PageTab :is-loading="isLoading">
<PageTabGroup v-if="PaymentMethods && PaymentMethods.length > 0">
<PageTabGroup>
<!--Page title-->
<FormLabel>{{ $t('user_payments.title') }}</FormLabel>
<div class="page-actions">
<!--Add payment method button-->
<div class="page-actions" v-if="PaymentMethods && PaymentMethods.length > 0">
<router-link :to="{name: 'CreatePaymentMethod'}">
<MobileActionButton icon="credit-card">
{{ $t('user_payments.add_card') }}
</MobileActionButton>
</router-link>
</div>
<DatatableWrapper :paginator="false" :columns="columns" :data="PaymentMethods" class="table">
<template scope="{ row }">
<!--Payment methods table-->
<DatatableWrapper v-if="PaymentMethods" :table-data="{data: PaymentMethods}" :paginator="false" :columns="columns" class="table">
<!--Table data content-->
<template slot-scope="{ row }">
<tr :class="{'is-deleting': row.data.attributes.card_id === deletingID}">
<td style="width: 300px">
<span class="cell-item">
@@ -24,11 +32,6 @@
</div>
</span>
</td>
<!--<td>
<span class="cell-item">
<ColorLabel :color="getCardStatusColor(row.data.attributes.status)">{{ getCardStatus(row.data.attributes.status) }}</ColorLabel>
</span>
</td>-->
<td>
<span class="cell-item">
{{ row.data.attributes.exp_month }} / {{ row.data.attributes.exp_year }}
@@ -46,11 +49,15 @@
</td>
</tr>
</template>
<!--Empty page-->
<template v-slot:empty-page>
<InfoBox>
<p>{{ $t('user_payments.empty') }} <router-link v-if="user.data.attributes.stripe_customer" :to="{name: 'CreatePaymentMethod'}">Add new payment method.</router-link> </p>
</InfoBox>
</template>
</DatatableWrapper>
</PageTabGroup>
<InfoBox v-else>
<p>{{ $t('user_payments.empty') }} <router-link v-if="user.data.attributes.stripe_customer" :to="{name: 'CreatePaymentMethod'}">Add new payment method.</router-link> </p>
</InfoBox>
</PageTab>
</template>
@@ -92,17 +99,12 @@
{
label: this.$t('rows.card.number'),
field: 'data.attributes.total',
sortable: true
sortable: false
},
/*{
label: this.$t('rows.card.status'),
field: 'data.attributes.status',
sortable: true
},*/
{
label: this.$t('rows.card.expiration'),
field: 'data.attributes.total',
sortable: true
sortable: false
},
{
label: this.$t('admin_page_user.table.action'),
@@ -127,19 +129,6 @@
break
}
},
getCardStatus(status) {
switch (status) {
case 'active':
return 'Active'
break
case 'card_declined':
return 'Rejected'
break
case 'expired':
return 'Expired'
break
}
},
setDefaultCard(card) {
events.$emit('confirm:open', {
title: this.$t('popup_set_card.title'),
@@ -166,19 +155,19 @@
.then(response => {
if (response.status == 204) {
this.PaymentMethods = []
this.PaymentMethods = {}
}
if (response.status == 200) {
this.defaultPaymentCard = response.data.default
this.PaymentMethods = response.data.others.data
this.PaymentMethods.push(response.data.default)
}
}).finally(() => {
this.isLoading = false
})
}
)
}
},
created() {
@@ -193,7 +182,9 @@
this.deletingID = data.id
axios.delete('/api/user/payment-cards/' + data.id)
axios.post('/api/user/payment-cards/' + data.id, {
_method: 'delete'
})
.then(() => {
// Get payments card
@@ -215,8 +206,9 @@
if (data.operation === 'set-as-default-credit-card') {
axios.patch('/api/user/payment-cards/' + data.id, {
default: 1
axios.post('/api/user/payment-cards/' + data.id, {
default: 1,
_method: 'patch'
})
.then(() => {
+2 -2
View File
@@ -1,6 +1,6 @@
<template>
<PageTab :is-loading="isLoading">
<PageTabGroup v-if="subscription">
<PageTabGroup v-if="subscription && !isLoading">
<FormLabel>
{{ $t('user_subscription.title') }}
</FormLabel>
@@ -45,7 +45,7 @@
</div>
</div>
</PageTabGroup>
<InfoBox v-else>
<InfoBox v-if="! subscription && !isLoading">
<p>{{ $t('user_subscription.empty') }}</p>
</InfoBox>
</PageTab>