mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
extended license restrictions removed
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
{{ data.app.license }}
|
||||
</ColorLabel>
|
||||
</a>
|
||||
<b v-if="data.app.license === 'extended'" class="mr-4 inline-block">
|
||||
<b class="mr-4 inline-block">
|
||||
<span class="text-sm font-bold"> {{ $t('subscription') }}: </span>
|
||||
<ColorLabel color="purple">
|
||||
{{ config.subscriptionType }}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
{{ $t(row.data.attributes.role) }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
<td class="px-3 md:px-1" v-if="config.isSaaS">
|
||||
<td class="px-3 md:px-1" v-if="config.subscriptionType === 'fixed'">
|
||||
<span class="text-sm font-bold">
|
||||
{{ row.data.relationships.subscription ? $t('premium') : $t('free') }}
|
||||
</span>
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
<template>
|
||||
<PageTab :is-loading="isLoading">
|
||||
|
||||
<!-- Subscription -->
|
||||
<div v-if="app" class="card shadow-card">
|
||||
<FormLabel icon="credit-card">
|
||||
{{ $t('subscription') }}
|
||||
</FormLabel>
|
||||
|
||||
<AppInputText :description="$t('subscription_type_note')" :is-last="true" :title="$t('subscription_type')">
|
||||
<SelectInput
|
||||
:default="app.subscriptionType"
|
||||
:options="subscriptionTypes"
|
||||
:placeholder="$t('select_subscription_type')"
|
||||
@change="subscriptionTypeChange"
|
||||
/>
|
||||
</AppInputText>
|
||||
</div>
|
||||
|
||||
<div v-if="app" class="card shadow-card">
|
||||
<FormLabel>
|
||||
{{ $t('upload_settings') }}
|
||||
@@ -216,63 +232,6 @@
|
||||
@input="$updateText('/admin/settings', 'google_analytics', app.googleAnalytics, true)"
|
||||
/>
|
||||
</AppInputText>
|
||||
</div>
|
||||
|
||||
<!--Upgrade License-->
|
||||
<div v-if="app && !config.isSaaS" class="card shadow-card">
|
||||
<FormLabel icon="trending-up">
|
||||
{{ $t('Upgrade your License') }}
|
||||
</FormLabel>
|
||||
|
||||
<ValidationObserver
|
||||
ref="upgradeLicense"
|
||||
v-slot="{ invalid }"
|
||||
class="mt-6"
|
||||
tag="form"
|
||||
@submit.prevent="upgradeLicense"
|
||||
>
|
||||
<ValidationProvider
|
||||
v-slot="{ errors }"
|
||||
mode="passive"
|
||||
name="Purchase Code"
|
||||
rules="required"
|
||||
tag="div"
|
||||
>
|
||||
<AppInputText
|
||||
:error="errors[0]"
|
||||
:is-last="true"
|
||||
>
|
||||
<div class="space-y-4 sm:flex sm:space-x-4 sm:space-y-0">
|
||||
<input
|
||||
v-model="purchaseCode"
|
||||
:class="{ '!border-rose-600': errors[0] }"
|
||||
:placeholder="$t('Paste your Purchase code here...')"
|
||||
class="focus-border-theme input-dark"
|
||||
type="text"
|
||||
/>
|
||||
<ButtonBase :loading="isLoadingUpgradingButton" button-style="theme" class="w-full sm:w-auto" type="submit">
|
||||
{{ $t('Upgrade') }}
|
||||
</ButtonBase>
|
||||
</div>
|
||||
</AppInputText>
|
||||
</ValidationProvider>
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
|
||||
<!-- Subscription -->
|
||||
<div v-if="app && config.isSaaS" class="card shadow-card">
|
||||
<FormLabel icon="credit-card">
|
||||
{{ $t('subscription') }}
|
||||
</FormLabel>
|
||||
|
||||
<AppInputText :description="$t('subscription_type_note')" :is-last="true" :title="$t('subscription_type')">
|
||||
<SelectInput
|
||||
:default="app.subscriptionType"
|
||||
:options="subscriptionTypes"
|
||||
:placeholder="$t('select_subscription_type')"
|
||||
@change="subscriptionTypeChange"
|
||||
/>
|
||||
</AppInputText>
|
||||
</div>
|
||||
</PageTab>
|
||||
</template>
|
||||
@@ -330,45 +289,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async upgradeLicense() {
|
||||
this.isLoadingUpgradingButton = true
|
||||
// Validate fields
|
||||
const isValid = await this.$refs.upgradeLicense.validate()
|
||||
|
||||
if (!isValid) return
|
||||
|
||||
axios.post('/api/admin/upgrade-license', {
|
||||
purchaseCode: this.purchaseCode
|
||||
})
|
||||
.then((response) => {
|
||||
this.$store.dispatch('getLanguageTranslations', this.config.locale)
|
||||
|
||||
this.$store.commit('REPLACE_CONFIG_VALUE', {
|
||||
key: 'isSaaS',
|
||||
value: true,
|
||||
})
|
||||
|
||||
events.$emit('toaster', {
|
||||
type: 'success',
|
||||
message: this.$t('Your license was successfully upgraded'),
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.response.status === 400) {
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('Purchase code is invalid or is not Extended License'),
|
||||
})
|
||||
} else {
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoadingUpgradingButton = false
|
||||
})
|
||||
},
|
||||
subscriptionTypeChange(type) {
|
||||
events.$emit('confirm:open', {
|
||||
title: this.$t('subscription_type_change_warn'),
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<MainFeatures />
|
||||
|
||||
<!--Pricing Tables-->
|
||||
<PricingTables v-if="config.isSaaS && config.subscriptionType === 'fixed'" />
|
||||
<PricingTables v-if="config.subscriptionType === 'fixed'" />
|
||||
|
||||
<!--Get Started Call To Action-->
|
||||
<GetStarted />
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
<div v-if="isExtended" class="card text-left shadow-card">
|
||||
<div class="card text-left shadow-card">
|
||||
<FormLabel>Subscription</FormLabel>
|
||||
|
||||
<ValidationProvider
|
||||
@@ -275,7 +275,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
isExtended: undefined,
|
||||
app: {
|
||||
color: '#00BC7E',
|
||||
subscriptionType: undefined,
|
||||
@@ -357,8 +356,6 @@ export default {
|
||||
created() {
|
||||
this.$scrollTop()
|
||||
|
||||
this.isExtended = localStorage.getItem('license') === 'Extended'
|
||||
|
||||
if (this.$root.$data.config.isSetupWizardDebug) {
|
||||
this.app.subscriptionType = 'metered'
|
||||
this.app.title = 'VueFileManager'
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
chunkSize: {{ $config->upload->chunkSize }},
|
||||
|
||||
isAuthenticated: {{ $config->app->isAuthenticated }},
|
||||
isSaaS: {{ $config->app->isSaaS }},
|
||||
|
||||
isDev: {{ $config->app->isDev }},
|
||||
isDemo: {{ $config->app->isDemo }},
|
||||
|
||||
Reference in New Issue
Block a user