metered billing app fixes

This commit is contained in:
Čarodej
2022-02-11 17:02:17 +01:00
parent 3fd43936e7
commit eb948f9000
13 changed files with 109 additions and 66 deletions

View File

@@ -171,12 +171,12 @@
</td>
<td class="px-3 md:px-1">
<span class="text-sm font-bold">
{{ row.data.meta.usages.featureEstimates.storage.usage }}
{{ row.data.meta.usages ? row.data.meta.usages.featureEstimates.storage.usage : '-' }}
</span>
</td>
<td class="px-3 md:px-1">
<span class="text-sm font-bold">
{{ row.data.meta.usages.costEstimate }}
{{ row.data.meta.usages ? row.data.meta.usages.costEstimate : '-' }}
</span>
</td>
<td class="px-3 md:px-1">

View File

@@ -30,7 +30,7 @@
</li>
</ul>
<ul v-if="config.isAuthenticated" class="navigation-links">
<li v-if="config.userRegistration">
<li>
<router-link class="cta-button text-theme bg-theme-100" :to="{ name: 'Files' }">
{{ $t('go_to_files') }}
</router-link>

View File

@@ -25,10 +25,10 @@
<image-icon size="34" class="vue-feather text-theme inline-block mb-4" />
<b class="font-bold text-base block leading-3">
{{ $te('input_image.title') || 'Upload Image' }}
{{ $te('input_image.title') ? $t('input_image.title') : 'Upload Image' }}
</b>
<small class="text-xs text-gray-500">
{{ $te('input_image.supported') || 'Supported formats are .png, .jpg, .jpeg.' }}
{{ $te('input_image.supported') ? $t('input_image.supported') : 'Supported formats are .png, .jpg, .jpeg.' }}
</small>
</div>
</div>

View File

@@ -7,7 +7,9 @@
<script>
export default {
name: 'InfoBox',
props: ['type'],
props: [
'type'
],
}
</script>

View File

@@ -94,6 +94,10 @@ const defaultState = {
label: 'Fixed',
value: 'fixed',
},
{
label: 'None',
value: 'none',
},
],
teamPermissions: {
'can-edit': 'Can Edit',

View File

@@ -124,51 +124,57 @@ export default {
],
}[this.config.subscriptionType]
return [
{
groupCollapsable: false,
groupTitle: this.$t('global.admin'),
groupLinks: [
{
title: this.$t('admin_menu.dashboard'),
route: 'Dashboard',
icon: 'box',
},
{
title: this.$t('admin_menu.users'),
route: 'Users',
icon: 'users',
linkActivation: ['users', 'user'],
},
{
title: this.$t('admin_menu.settings'),
route: 'AppSettings',
icon: 'settings',
},
],
},
{
groupCollapsable: false,
groupTitle: this.$t('Content'),
groupLinks: [
{
title: this.$t('admin_menu.pages'),
route: 'Pages',
icon: 'monitor',
},
{
title: this.$t('admin_menu.languages'),
route: 'Language',
icon: 'globe',
},
],
},
{
groupCollapsable: false,
groupTitle: this.$t('Subscription'),
groupLinks: subscriptionLinks,
},
]
let sections = [
{
groupCollapsable: false,
groupTitle: this.$t('global.admin'),
groupLinks: [
{
title: this.$t('admin_menu.dashboard'),
route: 'Dashboard',
icon: 'box',
},
{
title: this.$t('admin_menu.users'),
route: 'Users',
icon: 'users',
linkActivation: ['users', 'user'],
},
{
title: this.$t('admin_menu.settings'),
route: 'AppSettings',
icon: 'settings',
},
],
},
{
groupCollapsable: false,
groupTitle: this.$t('Content'),
groupLinks: [
{
title: this.$t('admin_menu.pages'),
route: 'Pages',
icon: 'monitor',
},
{
title: this.$t('admin_menu.languages'),
route: 'Language',
icon: 'globe',
},
],
},
]
// Push subscription if there is metered or fixed type
if (this.config.subscriptionType !== 'none') {
sections.push({
groupCollapsable: false,
groupTitle: this.$t('Subscription'),
groupLinks: subscriptionLinks,
})
}
return sections
},
},
components: {

View File

@@ -54,7 +54,7 @@
<ImageInput @input="$updateImage('/admin/settings', 'app_og_image', app.og_image)" :image="$getImage(app.og_image)" v-model="app.og_image" />
</AppInputText>
<AppInputText :title="$t('app_touch_icon')" :description="$t('app_touch_icon_description')">
<AppInputText :title="$t('app_touch_icon')" :description="$t('app_touch_icon_description')" :is-last="true">
<ImageInput @input="$updateImage('/admin/settings', 'app_touch_icon', app.touch_icon)" :image="$getImage(app.touch_icon)" v-model="app.touch_icon" />
</AppInputText>
</div>

View File

@@ -1,7 +1,7 @@
<template>
<PageTab :is-loading="isLoading">
<!--Store & Upload-->
<div class="card shadow-card">
<div v-if="app" class="card shadow-card">
<FormLabel>
{{ $t('Storage & Upload') }}
</FormLabel>
@@ -55,7 +55,7 @@
</div>
<!--Other Settings-->
<div class="card shadow-card">
<div v-if="app" class="card shadow-card">
<FormLabel>
{{ $t('Application') }}
</FormLabel>
@@ -88,7 +88,7 @@
</div>
<!-- ReCaptcha -->
<div class="card shadow-card">
<div v-if="app" class="card shadow-card">
<FormLabel icon="shield">
{{ $t('reCaptcha') }}
</FormLabel>

View File

@@ -22,7 +22,13 @@
{{ data.app.license }}
</ColorLabel>
</a>
<a href="https://bit.ly/VueFileManager-survey" target="_blank" class="bg-theme-100 ml-8 inline-block hidden items-center rounded-lg py-1.5 px-3 md:flex">
<b v-if="data.app.license === 'extended'" class="mr-4 inline-block">
<span class="text-sm font-bold"> {{ $t('Subscription') }}: </span>
<ColorLabel color="purple">
{{ config.subscriptionType }}
</ColorLabel>
</b>
<a href="https://bit.ly/VueFileManager-survey" target="_blank" class="bg-theme-100 lg:ml-4 ml-8 inline-block hidden items-center rounded-lg py-1.5 px-3 md:flex">
<thumbs-up-icon size="15" class="vue-feather text-theme mr-2.5" />
<span class="text-theme text-sm font-bold">
{{ $t('Write a Feedback') }}
@@ -31,6 +37,11 @@
</div>
</div>
<div v-if="config.subscriptionType === 'metered' && config.isEmptyPlans" class="p-5 bg-rose-200 rounded-xl shadow-card mb-6 flex items-center">
<alert-octagon-icon size="18" class="vue-feather text-rose-700 mr-4 shrink-0"/>
<p class="text-sm text-rose-700">As you installed app with metered subscription type, you have to <router-link :to="{name: 'CreateMeteredPlan'}" class="font-bold underline text-sm">create your plan</router-link> as soon as possible to prevent new user registration without automatically assigned subscription plan.</p>
</div>
<!--Metric widgets-->
<div class="mb-2 md:mb-6 md:flex md:space-x-6">
<div class="card mb-4 w-full shadow-card md:mb-0">
@@ -144,7 +155,7 @@
<script>
import WidgetLatestRegistrations from '../../components/Admin/WidgetLatestRegistrations'
import ColorLabel from '../../components/Others/ColorLabel'
import { ChevronRightIcon, ThumbsUpIcon } from 'vue-feather-icons'
import { AlertOctagonIcon, ChevronRightIcon, ThumbsUpIcon } from 'vue-feather-icons'
import WidgetWrapper from '../../components/Admin/WidgetWrapper'
import Spinner from '../../components/FilesView/Spinner'
import FormLabel from '../../components/Others/Forms/FormLabel'
@@ -152,13 +163,16 @@ import BarChart from '../../components/UI/BarChart'
import { mapGetters } from 'vuex'
import axios from 'axios'
import WidgetLatestTransactions from '../../components/Admin/WidgetLatestTransactions'
import InfoBox from "../../components/Others/Forms/InfoBox";
export default {
name: 'Dashboard',
components: {
InfoBox,
WidgetLatestTransactions,
WidgetLatestRegistrations,
ChevronRightIcon,
AlertOctagonIcon,
WidgetWrapper,
ThumbsUpIcon,
ColorLabel,

View File

@@ -175,7 +175,7 @@ export default {
InfoBox,
},
computed: {
...mapGetters(['currencyList', 'intervalList']),
...mapGetters(['currencyList', 'intervalList', 'config']),
},
data() {
return {
@@ -273,6 +273,7 @@ export default {
}
})
.catch((error) => {
console.log(error);
events.$emit('toaster', {
type: 'danger',
message: this.$t('popup_error.title'),

View File

@@ -186,12 +186,12 @@
</td>
<td class="px-3 md:px-1">
<span class="text-sm font-bold">
{{ row.data.meta.usages.featureEstimates.storage.usage }}
{{ row.data.meta.usages ? row.data.meta.usages.featureEstimates.storage.usage : '-' }}
</span>
</td>
<td class="px-3 md:px-1">
<span class="text-sm font-bold">
{{ row.data.meta.usages.costEstimate }}
{{ row.data.meta.usages ? row.data.meta.usages.costEstimate : '-' }}
</span>
</td>
<td class="px-3 md:px-1">

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Console\Commands;
use App\Users\Models\User;
@@ -28,10 +29,11 @@ class SetupProdEnvironment extends Command
public function __construct(
private CreateDiskDirectoriesAction $createDiskDirectories,
private SeedDefaultSettingsAction $seedDefaultSettings,
private SeedDefaultLanguageAction $seedDefaultLanguage,
private SeedDefaultPagesAction $seedDefaultPages,
) {
private SeedDefaultSettingsAction $seedDefaultSettings,
private SeedDefaultLanguageAction $seedDefaultLanguage,
private SeedDefaultPagesAction $seedDefaultPages,
)
{
parent::__construct();
$this->setUpFaker();
}
@@ -186,6 +188,20 @@ class SetupProdEnvironment extends Command
'value' => $col['value'],
]);
});
if ($this->argument('license') === 'extended') {
$choice = $this->choice("Choose subscription type", [
'metered' => 'Metered',
'fixed' => 'Fixed',
'none' => 'None',
]);
Setting::updateOrCreate([
'name' => 'subscription_type'
], [
'value' => $choice
]);
}
}
/**

4
webpack.mix.js vendored
View File

@@ -29,10 +29,10 @@ mix
clientLogLevel: 'none'
}
})*/
.options({
/*.options({
hmrOptions: {
host: '192.168.1.112',
port: '8080'
},
})
})*/
.disableNotifications();