- Moved chunk size option to .env

- Added ability into App Settings to flush application cache
- Renew password page logo fix
- removed put|patch|delete methods from axios and replaced by faking these methods to support incompatible shared hostings where you can't install php extension to support these methods.
- Getting unique_ids fix
This commit is contained in:
Peter Papp
2020-08-18 10:21:24 +02:00
parent 5c2326e492
commit 93a7542502
36 changed files with 132 additions and 68 deletions
+5 -2
View File
@@ -142,7 +142,9 @@
// Send delete request
axios
.delete('/api/share/' + this.pickedItem.shared.token)
.post('/api/share/' + this.pickedItem.shared.token, {
_method: 'delete'
})
.then(() => {
// Remove item from file browser
if ( this.isSharedLocation ) {
@@ -182,10 +184,11 @@
// Send request to get share link
axios
.patch('/api/share/' + this.shareOptions.token, {
.post('/api/share/' + this.shareOptions.token, {
permission: this.shareOptions.permission,
protected: this.shareOptions.isProtected,
password: this.shareOptions.password ? this.shareOptions.password : undefined,
_method: 'patch'
})
.then(response => {
+1 -1
View File
@@ -11,7 +11,7 @@ const Helpers = {
if (value === '') return
axios.patch(this.$store.getters.api + route, {name, value})
axios.post(this.$store.getters.api + route, {name, value, _method: 'patch'})
.catch(error => {
events.$emit('alert:open', {
title: this.$t('popup_error.title'),
+14 -8
View File
@@ -13,9 +13,10 @@ const actions = {
: '/api/move/' + item_from.unique_id
axios
.patch(route, {
.post(route, {
from_type: item_from.type,
to_unique_id: to_item.unique_id
to_unique_id: to_item.unique_id,
_method: 'patch'
})
.then(() => {
commit('REMOVE_ITEM', item_from.unique_id)
@@ -62,9 +63,10 @@ const actions = {
: '/api/rename-item/' + data.unique_id
axios
.patch(route, {
.post(route, {
name: data.name,
type: data.type,
_method: 'patch'
})
.then(response => {
commit('CHANGE_ITEM_NAME', response.data)
@@ -155,9 +157,10 @@ const actions = {
commit('CLEAR_FILEINFO_DETAIL')
axios
.patch(getters.api + '/restore-item/' + item.unique_id, {
.post(getters.api + '/restore-item/' + item.unique_id, {
type: item.type,
to_home: restoreToHome,
_method: 'patch'
})
.catch(() => isSomethingWrong())
},
@@ -182,11 +185,12 @@ const actions = {
: '/api/remove-item/' + data.unique_id
axios
.delete(route, {
.post(route, {
_method: 'delete',
data: {
type: data.type,
force_delete: data.deleted_at ? true : false
}
force_delete: data.deleted_at ? true : false,
},
})
.then(() => {
@@ -214,7 +218,9 @@ const actions = {
commit('LOADING_STATE', {loading: true, data: []})
axios
.delete(getters.api + '/empty-trash')
.post(getters.api + '/empty-trash', {
_method: 'delete'
})
.then(() => {
commit('LOADING_STATE', {loading: false, data: []})
events.$emit('scrollTop')
+3 -1
View File
@@ -66,7 +66,9 @@ const actions = {
context.commit('REMOVE_ITEM_FROM_FAVOURITES', folder)
axios
.delete(context.getters.api + '/folders/favourites/' + folder.unique_id)
.post(context.getters.api + '/folders/favourites/' + folder.unique_id, {
_method: 'delete'
})
.catch(() => {
// Show error message
events.$emit('alert:open', {
@@ -135,7 +135,9 @@
// Send request to get verify account
axios
.put('/api/settings/email', this.mail)
.post('/api/settings/email', this.mail, {
_method: 'put'
})
.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">
Application Cache
</FormLabel>
<InfoBox>
Did you change anything in your .env file or change your stripe credentials? Then clear your cache.
</InfoBox>
<ButtonBase @click.native="flushCache" type="submit" button-style="theme" class="submit-button">
Clear Cache
</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 {
@@ -126,6 +139,17 @@
},
}
},
methods: {
flushCache() {
axios.get('/api/flush-cache')
.then(() => {
events.$emit('toaster', {
type: 'success',
message: 'Your cache was successfully deleted.',
})
})
}
},
mounted() {
axios.get('/api/settings', {
params: {
@@ -710,7 +710,9 @@
// Send request to get verify account
axios
.put('/api/settings/stripe', this.stripeCredentials)
.post('/api/settings/stripe', this.stripeCredentials, {
_method: 'put'
})
.then(() => {
// End loading
@@ -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(() => {
@@ -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(() => {
@@ -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(() => {
@@ -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="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>
@@ -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="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
@@ -48,7 +48,7 @@
import axios from 'axios'
export default {
name: 'Profile',
name: 'Password',
components: {
PageTabGroup,
FormLabel,
+6 -3
View File
@@ -193,7 +193,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 +217,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(() => {