mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 11:00:39 +00:00
- user subscribe deletion
- fixes
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
<ToasterWrapper />
|
||||
<CookieDisclaimer />
|
||||
|
||||
<SelectPlanSubscriptionPopup />
|
||||
|
||||
<!--Show spinner before translations is loaded-->
|
||||
<Spinner v-if="! isLoaded"/>
|
||||
|
||||
@@ -19,7 +17,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectPlanSubscriptionPopup from "./components/Subscription/SelectPlanSubscriptionPopup";
|
||||
import ToasterWrapper from '/resources/js/components/Others/Notifications/ToasterWrapper'
|
||||
import CookieDisclaimer from '/resources/js/components/Others/CookieDisclaimer'
|
||||
import Spinner from '/resources/js/components/FilesView/Spinner'
|
||||
@@ -31,7 +28,6 @@ import {events} from './bus'
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
SelectPlanSubscriptionPopup,
|
||||
CookieDisclaimer,
|
||||
ToasterWrapper,
|
||||
Vignette,
|
||||
@@ -135,7 +131,7 @@ export default {
|
||||
@import '/resources/sass/vuefilemanager/_mixins';
|
||||
|
||||
.card {
|
||||
@apply dark:bg-dark-foreground bg-white lg:p-8 p-6 rounded-lg lg:mb-6 mb-4
|
||||
@apply dark:bg-dark-foreground bg-white lg:p-6 p-4 rounded-xl lg:mb-6 mb-4
|
||||
}
|
||||
|
||||
.input-dark {
|
||||
|
||||
+10
-1
@@ -329,7 +329,7 @@ const FunctionHelpers = {
|
||||
}[driver]
|
||||
}
|
||||
|
||||
Vue.prototype.getSubscriptionStatusColor = function (status) {
|
||||
Vue.prototype.$getSubscriptionStatusColor = function (status) {
|
||||
|
||||
return {
|
||||
'active': 'green',
|
||||
@@ -338,6 +338,15 @@ const FunctionHelpers = {
|
||||
}[status]
|
||||
}
|
||||
|
||||
Vue.prototype.$getTransactionStatusColor = function (status) {
|
||||
|
||||
return {
|
||||
'completed': 'green',
|
||||
'cancelled': 'yellow',
|
||||
'error': 'red',
|
||||
}[status]
|
||||
}
|
||||
|
||||
Vue.prototype.$goToFileView = function (id) {
|
||||
|
||||
let locations = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center">
|
||||
<div v-if="row.data.relationships.user" class="flex items-center">
|
||||
<MemberAvatar
|
||||
:is-border="false"
|
||||
:size="36"
|
||||
@@ -31,9 +31,12 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="! row.data.relationships.user" class="text-xs text-gray-500 font-bold">
|
||||
{{ $t('User was deleted') }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<ColorLabel color="purple">
|
||||
<ColorLabel :color="$getTransactionStatusColor(row.data.attributes.status)">
|
||||
{{ row.data.attributes.status }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
</div>
|
||||
|
||||
<!--Datatable-->
|
||||
<DatatableWrapper @data="plans = $event" @init="isLoading = false" api="/api/subscriptions/plans" :paginator="true" :columns="columns">
|
||||
<DatatableWrapper @data="plans = $event" @init="isLoading = false" api="/api/subscriptions/admin/plans" :paginator="true" :columns="columns">
|
||||
<template slot-scope="{ row }">
|
||||
<tr class="border-b dark:border-opacity-5 border-light border-dashed">
|
||||
<td class="py-4">
|
||||
<SwitchInput @input="changeStatus($event, row.data.id)" class="switch" :state="row.data.attributes.visible"/>
|
||||
<SwitchInput @input="$updateInput(`/subscriptions/admin/plans/${row.data.id}`, 'visible', row.data.attributes.visible)" v-model="row.data.attributes.visible" class="switch" :state="row.data.attributes.visible"/>
|
||||
</td>
|
||||
<td>
|
||||
<router-link class="text-sm font-bold" :to="{name: 'PlanSettings', params: {id: row.data.id}}">
|
||||
@@ -163,11 +163,6 @@
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeStatus(val, id) {
|
||||
this.$updateText('/subscription/plans/' + id, 'visible', val)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (! this.config.stripe_public_key)
|
||||
this.isLoading = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="card shadow-card pb-0 sticky top-0 z-10">
|
||||
<div v-if="plan" class="card shadow-card pb-0 sticky top-0 z-10">
|
||||
|
||||
<div class="mb-2">
|
||||
<h1 class="font-bold text-xl">
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
</InfoBox>
|
||||
<ValidationObserver ref="deletePlan" @submit.prevent="deletePlan" v-slot="{ invalid }" tag="form">
|
||||
<ValidationProvider tag="div" v-slot="{ errors }" mode="passive" name="Plan name" :rules="'required|is:' + plan.attributes.name">
|
||||
<AppInputText :title="$t('admin_page_user.label_delete_user', {user: plan.attributes.name})" :is-last="true">
|
||||
<AppInputText :title="$t('admin_page_user.label_delete_user', {user: plan.attributes.name})" :error="errors[0]" :is-last="true">
|
||||
<div class="flex space-x-4">
|
||||
<input v-model="planName" :placeholder="$t('admin_page_plans.form.name_delete_plac')" type="text" :class="{'is-error': errors[0]}" class="focus-border-theme input-dark" />
|
||||
<input v-model="planName" :placeholder="$t('admin_page_plans.form.name_delete_plac')" type="text" :class="{'border-red-700': errors[0]}" class="focus-border-theme input-dark" />
|
||||
<ButtonBase :loading="isSendingRequest" :disabled="isSendingRequest" type="submit" button-style="danger" class="submit-button">
|
||||
{{ $t('admin_page_plans.delete_plan_button') }}
|
||||
</ButtonBase>
|
||||
@@ -54,7 +54,6 @@
|
||||
},
|
||||
methods: {
|
||||
async deletePlan() {
|
||||
|
||||
// Validate fields
|
||||
const isValid = await this.$refs.deletePlan.validate();
|
||||
|
||||
@@ -63,11 +62,7 @@
|
||||
this.isSendingRequest = true
|
||||
|
||||
axios
|
||||
.post('/api/subscriptions/admin/plans/' + this.$route.params.id,
|
||||
{
|
||||
data: {
|
||||
name: this.planName
|
||||
},
|
||||
.post(`/api/subscriptions/admin/plans/${this.$route.params.id}`, {
|
||||
_method: 'delete'
|
||||
}
|
||||
)
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
<!--Visible-->
|
||||
<AppInputSwitch :title="$t('admin_page_plans.form.status')" :description="$t('admin_page_plans.form.status_help')">
|
||||
<SwitchInput @input="$updateInput('/subscriptions/plans/' + $route.params.id, 'visible', plan.attributes.visible)" v-model="visible" class="switch" :state="plan.attributes.visible"/>
|
||||
<SwitchInput @input="$updateInput('/subscriptions/admin/plans/' + $route.params.id, 'visible', plan.attributes.visible)" v-model="plan.attributes.visible" class="switch" :state="plan.attributes.visible"/>
|
||||
</AppInputSwitch>
|
||||
|
||||
<!--Name-->
|
||||
<AppInputText :title="$t('admin_page_plans.form.name')">
|
||||
<input @input="$updateInput('/subscriptions/plans/' + $route.params.id, 'name', plan.attributes.name)" v-model="plan.attributes.name" :placeholder="$t('admin_page_plans.form.name_plac')" type="text" class="focus-border-theme input-dark"/>
|
||||
<input @input="$updateInput('/subscriptions/admin/plans/' + $route.params.id, 'name', plan.attributes.name)" v-model="plan.attributes.name" :placeholder="$t('admin_page_plans.form.name_plac')" type="text" class="focus-border-theme input-dark"/>
|
||||
</AppInputText>
|
||||
|
||||
<!--Description-->
|
||||
<AppInputText :title="$t('admin_page_plans.form.description')">
|
||||
<textarea @input="$updateInput('/subscriptions/plans/' + $route.params.id, 'description', plan.attributes.description)" v-model="plan.attributes.description" :placeholder="$t('admin_page_plans.form.description_plac')" class="focus-border-theme input-dark"></textarea>
|
||||
<textarea @input="$updateInput('/subscriptions/admin/plans/' + $route.params.id, 'description', plan.attributes.description)" v-model="plan.attributes.description" :placeholder="$t('admin_page_plans.form.description_plac')" class="focus-border-theme input-dark"></textarea>
|
||||
</AppInputText>
|
||||
|
||||
<InfoBox style="margin-bottom: 0">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</router-link>
|
||||
</td>
|
||||
<td>
|
||||
<ColorLabel :color="getSubscriptionStatusColor(row.data.attributes.status)">
|
||||
<ColorLabel :color="$getSubscriptionStatusColor(row.data.attributes.status)">
|
||||
{{ row.data.attributes.status }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</router-link>
|
||||
</td>
|
||||
<td>
|
||||
<ColorLabel :color="getSubscriptionStatusColor(row.data.attributes.status)">
|
||||
<ColorLabel :color="$getSubscriptionStatusColor(row.data.attributes.status)">
|
||||
{{ row.data.attributes.status }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<CardNavigation :pages="pages" class="-mx-6" />
|
||||
<CardNavigation :pages="pages" class="-mx-3" />
|
||||
</div>
|
||||
|
||||
<!--Router Content-->
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<ColorLabel color="purple">
|
||||
<ColorLabel :color="$getTransactionStatusColor(row.data.attributes.status)">
|
||||
{{ row.data.attributes.status }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<Spotlight />
|
||||
|
||||
<ConfirmPopup />
|
||||
<SelectPlanSubscriptionPopup />
|
||||
|
||||
<!--2FA popups-->
|
||||
<TwoFactorRecoveryCodesPopup />
|
||||
@@ -72,6 +73,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectPlanSubscriptionPopup from "../components/Subscription/SelectPlanSubscriptionPopup";
|
||||
import ConfirmPopup from "../components/Others/Popup/ConfirmPopup";
|
||||
import FilePreview from '/resources/js/components/FilePreview/FilePreview'
|
||||
import Spotlight from '/resources/js/components/Spotlight/Spotlight'
|
||||
@@ -88,6 +90,7 @@
|
||||
export default {
|
||||
name: 'Settings',
|
||||
components: {
|
||||
SelectPlanSubscriptionPopup,
|
||||
ConfirmPopup,
|
||||
CardNavigation,
|
||||
FilePreview,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<ColorLabel color="purple">
|
||||
<ColorLabel :color="$getTransactionStatusColor(row.data.attributes.status)">
|
||||
{{ row.data.attributes.status }}
|
||||
</ColorLabel>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user