SaaS frontend update

This commit is contained in:
carodej
2020-05-29 17:37:23 +02:00
parent 252b6fd0bf
commit 61a8849e2d
21 changed files with 1975 additions and 112 deletions
+1
View File
@@ -124,6 +124,7 @@
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
font-size: 16px;
text-decoration: none;
}
#auth {
@@ -6,6 +6,7 @@
<trash-icon v-if="icon === 'trash'" size="15" class="icon"></trash-icon>
<grid-icon v-if="icon === 'th'" size="15" class="icon"></grid-icon>
<user-plus-icon v-if="icon === 'user-plus'" size="15" class="icon"></user-plus-icon>
<plus-icon v-if="icon === 'plus'" size="15" class="icon"></plus-icon>
<span class="label">
<slot></slot>
</span>
@@ -14,7 +15,7 @@
</template>
<script>
import { FolderPlusIcon, ListIcon, GridIcon, TrashIcon, UserPlusIcon } from 'vue-feather-icons'
import { FolderPlusIcon, ListIcon, GridIcon, TrashIcon, UserPlusIcon, PlusIcon } from 'vue-feather-icons'
export default {
name: 'MobileActionButton',
@@ -25,6 +26,7 @@
FolderPlusIcon,
UserPlusIcon,
TrashIcon,
PlusIcon,
ListIcon,
GridIcon,
}
@@ -0,0 +1,83 @@
<template>
<div class="cell-image-thumbnail">
<div class="image" :class="imageSize" v-if="image">
<img :src="image" :alt="title">
</div>
<div class="info">
<b class="name" v-if="title">{{ title }}</b>
<span class="description" v-if="description">{{ description }}</span>
</div>
</div>
</template>
<script>
export default {
name:'DatatableCellImage',
props: ['image', 'title', 'description', 'image-size'],
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.cell-image-thumbnail {
display: flex;
align-items: center;
cursor: pointer;
.image {
margin-right: 20px;
line-height: 0;
img {
line-height: 0;
width: 48px;
height: 48px;
border-radius: 8px;
}
&.small {
img {
width: 32px;
height: 32px;
}
}
}
.info {
.name, .description {
max-width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
.name {
@include font-size(15);
line-height: 1;
color: $text;
}
.description {
color: $text-muted;
@include font-size(12);
}
}
}
@media (prefers-color-scheme: dark) {
.cell-image-thumbnail {
.info {
.description {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
@@ -198,7 +198,7 @@
padding: 12px;
span {
color: #AFAFAF;
color: $theme;
font-weight: 700;
@include font-size(12);
white-space: nowrap;
@@ -238,6 +238,7 @@
.table-body {
tr {
border-radius: 8px;
border-bottom: 1px solid #f5f5f5;
&:hover {
background: $light_background;
+4 -4
View File
@@ -28,13 +28,13 @@
<router-link :to="{name: 'Profile'}" :class="{'is-active': $isThisRoute($route, ['Password', 'Profile', 'Storage'])}" class="icon-navigation-item settings">
<div class="button-icon">
<settings-icon size="19"></settings-icon>
<user-icon size="19"></user-icon>
</div>
</router-link>
<router-link v-if="app.user.role === 'admin'" :to="{name: 'Users'}" :class="{'is-active': $isThisRoute($route, ['Users', 'User', 'UserDetail', 'UserStorage', 'UserPassword', 'UserDelete'])}" class="icon-navigation-item users">
<div class="button-icon">
<users-icon size="19"></users-icon>
<settings-icon size="19"></settings-icon>
</div>
</router-link>
</div>
@@ -57,7 +57,7 @@
HardDriveIcon,
SettingsIcon,
Trash2Icon,
UsersIcon,
UserIcon,
PowerIcon,
ShareIcon,
} from 'vue-feather-icons'
@@ -71,7 +71,7 @@
Trash2Icon,
PowerIcon,
ShareIcon,
UsersIcon,
UserIcon,
},
computed: {
...mapGetters(['app']),
+82 -1
View File
@@ -20,14 +20,24 @@ import SharedFiles from './views/FilePages/SharedFiles'
import MobileSettings from './views/Mobile/MobileSettings'
import Admin from './views/Admin'
import Users from './views/Admin/Users'
import Plans from './views/Admin/Plans'
import Invoices from './views/Admin/Invoices'
// Payment Methods
import PaymentMethods from './views/Admin/PaymentMethods'
import PaymentMethod from './views/Admin/PaymentMethods/PaymentMethod'
import GatewaySettings from './views/Admin/PaymentMethods/PaymentMethodTabs/GatewaySettings'
import GatewayTransactions from './views/Admin/PaymentMethods/PaymentMethodTabs/GatewayTransactions'
// Users
import Users from './views/Admin/Users'
import User from './views/Admin/Users/User'
import UserCreate from './views/Admin/Users/UserCreate'
import UserDetail from './views/Admin/Users/UserTabs/UserDetail'
import UserDelete from './views/Admin/Users/UserTabs/UserDelete'
import UserStorage from './views/Admin/Users/UserTabs/UserStorage'
import UserPassword from './views/Admin/Users/UserTabs/UserPassword'
import UserInvoices from './views/Admin/Users/UserTabs/UserInvoices'
Vue.use(Router)
@@ -115,6 +125,35 @@ const router = new Router({
title: 'Admin'
},
children: [
// List Pages
{
name: 'PaymentMethods',
path: '/admin/payment-methods',
component: PaymentMethods,
meta: {
requiresAuth: true,
title: 'Payment Methods'
},
},
{
name: 'Invoices',
path: '/admin/invoices',
component: Invoices,
meta: {
requiresAuth: true,
title: 'Invoices'
},
},
{
name: 'Plans',
path: '/admin/plans',
component: Plans,
meta: {
requiresAuth: true,
title: 'Pricing Plans'
},
},
{
name: 'Users',
path: '/admin/users',
@@ -124,6 +163,8 @@ const router = new Router({
title: i18n.t('routes_title.users_list')
},
},
// Create Pages
{
name: 'UserCreate',
path: '/admin/user/create',
@@ -133,6 +174,8 @@ const router = new Router({
title: i18n.t('routes_title.user_create')
},
},
// Single pages
{
name: 'User',
path: '/admin/user/:id',
@@ -160,6 +203,15 @@ const router = new Router({
title: i18n.t('routes_title.users_storage_usage')
},
},
{
name: 'UserInvoices',
path: '/admin/user/:id/invoices',
component: UserInvoices,
meta: {
requiresAuth: true,
title: 'Invoices'
},
},
{
name: 'UserPassword',
path: '/admin/user/:id/password',
@@ -180,6 +232,35 @@ const router = new Router({
},
]
},
{
name: 'PaymentMethod',
path: '/admin/payment-method/:name',
component: PaymentMethod,
meta: {
requiresAuth: true,
title: 'Payment Method'
},
children: [
{
name: 'GatewaySettings',
path: '/admin/payment-methods/:name/settings',
component: GatewaySettings,
meta: {
requiresAuth: true,
title: 'Settings'
},
},
{
name: 'GatewayTransactions',
path: '/admin/payment-methods/:name/transactions',
component: GatewayTransactions,
meta: {
requiresAuth: true,
title: 'Transactions'
},
},
]
},
]
},
{
+44 -3
View File
@@ -1,7 +1,7 @@
<template>
<section id="viewport">
<ContentSidebar v-if="false">
<ContentSidebar>
<!--Locations-->
<ContentGroup :title="$t('admin_menu.admin_label')" class="navigator">
@@ -14,11 +14,48 @@
{{ $t('admin_menu.users') }}
</div>
</router-link>
<router-link :to="{name: 'User'}" class="menu-list-item link">
<div class="icon">
<settings-icon size="17"></settings-icon>
</div>
<div class="label">
Settings
</div>
</router-link>
</div>
</ContentGroup>
<ContentGroup title="SaaS" class="navigator">
<div class="menu-list-wrapper vertical">
<router-link :to="{name: 'Invoices'}" class="menu-list-item link">
<div class="icon">
<file-text-icon size="17"></file-text-icon>
</div>
<div class="label">
Invoices
</div>
</router-link>
<router-link :to="{name: 'Plans'}" class="menu-list-item link">
<div class="icon">
<database-icon size="17"></database-icon>
</div>
<div class="label">
Plans
</div>
</router-link>
<router-link :to="{name: 'PaymentMethods'}" class="menu-list-item link">
<div class="icon">
<credit-card-icon size="17"></credit-card-icon>
</div>
<div class="label">
Payment Methods
</div>
</router-link>
</div>
</ContentGroup>
</ContentSidebar>
<keep-alive :include="['Users']">
<keep-alive>
<router-view/>
</keep-alive>
</section>
@@ -28,7 +65,7 @@
import ContentSidebar from '@/components/Sidebar/ContentSidebar'
import ContentGroup from '@/components/Sidebar/ContentGroup'
import { mapGetters } from 'vuex'
import { UsersIcon } from 'vue-feather-icons'
import { UsersIcon, SettingsIcon, FileTextIcon, CreditCardIcon, DatabaseIcon } from 'vue-feather-icons'
export default {
name: 'Settings',
@@ -36,6 +73,10 @@
...mapGetters(['config']),
},
components: {
DatabaseIcon,
CreditCardIcon,
FileTextIcon,
SettingsIcon,
ContentSidebar,
ContentGroup,
UsersIcon,
+413
View File
@@ -0,0 +1,413 @@
<template>
<div id="single-page">
<div id="page-content" v-if="! isLoading">
<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 }">
<tr>
<td>
<span class="cell-item">
${{ row.attributes.total }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.plan }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.created_at_formatted }}
</span>
</td>
<td>
<router-link :to="{name: 'UserInvoices', params: {id: row.relationships.user.data.id}}">
<DatatableCellImage
image-size="small"
:image="row.relationships.user.data.attributes.avatar"
:title="row.relationships.user.data.attributes.name"
/>
</router-link>
</td>
<td>
<div class="action-icons">
<router-link :to="{name: 'UserDelete', params: {id: row.relationships.user.data.id}}">
<download-cloud-icon size="15" class="icon"></download-cloud-icon>
</router-link>
</div>
</td>
</tr>
</template>
</DatatableWrapper>
</div>
</div>
<div id="loader" v-if="isLoading">
<Spinner></Spinner>
</div>
</div>
</template>
<script>
import DatatableCellImage from '@/components/Others/Tables/DatatableCellImage'
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import MobileActionButton from '@/components/FilesView/MobileActionButton'
import SwitchInput from '@/components/Others/Forms/SwitchInput'
import MobileHeader from '@/components/Mobile/MobileHeader'
import SectionTitle from '@/components/Others/SectionTitle'
import ButtonBase from '@/components/FilesView/ButtonBase'
import {DownloadCloudIcon} from "vue-feather-icons";
import PageHeader from '@/components/Others/PageHeader'
import ColorLabel from '@/components/Others/ColorLabel'
import Spinner from '@/components/FilesView/Spinner'
import axios from 'axios'
export default {
name: 'Plans',
components: {
DownloadCloudIcon,
DatatableCellImage,
MobileActionButton,
DatatableWrapper,
SectionTitle,
MobileHeader,
SwitchInput,
PageHeader,
ButtonBase,
ColorLabel,
Spinner,
},
data() {
return {
isLoading: false,
invoices: [
{
id: '1',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/6osmoXJo-avatar-01.png',
name: 'Jane Doe',
email: 'howdy@hi5ve.digital',
}
}
}
}
},
{
id: '2',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/dSMRCbwF-69299654_2418248648259454_4545563304688353280_o.jpg',
name: 'Peter Papp',
email: 'peterpapp@makingcg.com',
}
}
}
}
},
{
id: '3',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/assets/images/default-avatar.png',
name: 'Pavel Svintsitskiy',
email: 'pashaUSA@gmail.com',
}
}
}
}
},
{
id: '4',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/lTksMdJM-6D3529EF-5D8C-4959-BEC2-4BDE80A051C2.jpeg',
name: 'Torsten',
email: 'torsten.hoegel@go-on-net.de',
}
}
}
}
},
{
id: '5',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/6osmoXJo-avatar-01.png',
name: 'Jane Doe',
email: 'howdy@hi5ve.digital',
}
}
}
}
},
{
id: '6',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/dSMRCbwF-69299654_2418248648259454_4545563304688353280_o.jpg',
name: 'Peter Papp',
email: 'peterpapp@makingcg.com',
}
}
}
}
},
{
id: '7',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/assets/images/default-avatar.png',
name: 'Pavel Svintsitskiy',
email: 'pashaUSA@gmail.com',
}
}
}
}
},
{
id: '8',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
relationships: {
user: {
data: {
id: '1',
type: 'users',
attributes: {
avatar: 'http://localhost:8000/avatars/lTksMdJM-6D3529EF-5D8C-4959-BEC2-4BDE80A051C2.jpeg',
name: 'Torsten',
email: 'torsten.hoegel@go-on-net.de',
}
}
}
}
},
],
columns: [
{
label: 'Total',
field: 'attributes.total',
sortable: true
},
{
label: 'Plan',
field: 'attributes.plan',
sortable: true
},
{
label: 'Payed',
field: 'attributes.created_at',
sortable: true
},
{
label: 'User',
field: 'relationships.user.data.id',
sortable: true
},
{
label: this.$t('admin_page_user.table.action'),
field: 'data.action',
sortable: false
},
],
}
},
created() {
/*axios.get('/api/invoices')
.then(response => {
this.invoices = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.user-thumbnail {
display: flex;
align-items: center;
cursor: pointer;
.avatar {
margin-right: 20px;
line-height: 0;
img {
line-height: 0;
width: 48px;
height: 48px;
border-radius: 8px;
}
}
.info {
.name {
max-width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
.name {
@include font-size(15);
line-height: 1;
}
}
}
.table-tools {
background: white;
display: flex;
justify-content: space-between;
padding: 15px 0 10px;
position: sticky;
top: 40px;
z-index: 9;
}
.table {
.cell-item {
@include font-size(15);
white-space: nowrap;
}
.name {
font-weight: 700;
cursor: pointer;
}
}
@media only screen and (max-width: 690px) {
.table-tools {
padding: 0 0 5px;
}
}
@media (prefers-color-scheme: dark) {
.table-tools {
background: $dark_mode_background;
}
.action-icons {
.icon {
cursor: pointer;
circle, path, line, polyline {
stroke: $dark_mode_text_primary;
}
}
}
.user-thumbnail {
.info {
.email {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
+245
View File
@@ -0,0 +1,245 @@
<template>
<div id="single-page">
<div id="page-content" v-if="! isLoading">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<DatatableWrapper :paginator="false" :columns="columns" :data="plans" class="table table-users">
<template scope="{ row }">
<tr>
<td>
<router-link :to="{name: 'GatewaySettings', params: {name: row.attributes.type}}">
<DatatableCellImage
:image="row.attributes.avatar"
:title="row.attributes.gateway"
/>
</router-link>
</td>
<td>
<span class="cell-item">
<SwitchInput class="switch" :state="row.attributes.status"/>
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.payments_processed }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.active_subscribers }}
</span>
</td>
<td>
<div class="action-icons">
<router-link :to="{name: 'GatewaySettings', params: {name: row.attributes.type}}">
<edit-2-icon size="15" class="icon icon-edit"></edit-2-icon>
</router-link>
</div>
</td>
</tr>
</template>
</DatatableWrapper>
</div>
</div>
<div id="loader" v-if="isLoading">
<Spinner></Spinner>
</div>
</div>
</template>
<script>
import DatatableCellImage from '@/components/Others/Tables/DatatableCellImage'
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import MobileActionButton from '@/components/FilesView/MobileActionButton'
import SwitchInput from '@/components/Others/Forms/SwitchInput'
import MobileHeader from '@/components/Mobile/MobileHeader'
import SectionTitle from '@/components/Others/SectionTitle'
import ButtonBase from '@/components/FilesView/ButtonBase'
import {Trash2Icon, Edit2Icon} from "vue-feather-icons";
import PageHeader from '@/components/Others/PageHeader'
import ColorLabel from '@/components/Others/ColorLabel'
import Spinner from '@/components/FilesView/Spinner'
import axios from 'axios'
export default {
name: 'Plans',
components: {
DatatableCellImage,
MobileActionButton,
DatatableWrapper,
SectionTitle,
MobileHeader,
SwitchInput,
Trash2Icon,
PageHeader,
ButtonBase,
ColorLabel,
Edit2Icon,
Spinner,
},
data() {
return {
isLoading: false,
plans: [
{
id: '2',
type: 'payment_method',
attributes: {
type: 'paypal',
gateway: 'PayPal',
avatar: '/assets/images/paypal-logo-thumbnail.png',
status: 0,
payments_processed: 234,
active_subscribers: 2920,
}
},
{
id: '1',
type: 'payment_method',
attributes: {
type: 'stripe',
gateway: 'Stripe',
avatar: '/assets/images/stripe-logo-thumbnail.png',
status: 1,
payments_processed: 798,
active_subscribers: 3587,
}
},
],
columns: [
{
label: 'Payment Gateway',
field: 'attributes.gateway',
sortable: true
},
{
label: 'Status',
field: 'attributes.status',
sortable: true
},
{
label: 'Payments Processed',
field: 'attributes.payments_processed',
sortable: true
},
{
label: 'Active Subscribers',
field: 'attributes.active_subscribers',
sortable: true
},
{
label: this.$t('admin_page_user.table.action'),
field: 'data.action',
sortable: false
},
],
}
},
created() {
/*axios.get('/api/plans')
.then(response => {
this.plans = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.user-thumbnail {
display: flex;
align-items: center;
cursor: pointer;
.avatar {
margin-right: 20px;
line-height: 0;
img {
line-height: 0;
width: 48px;
height: 48px;
border-radius: 8px;
}
}
.info {
.name {
max-width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
.name {
@include font-size(15);
line-height: 1;
}
}
}
.table-tools {
background: white;
display: flex;
justify-content: space-between;
padding: 15px 0 10px;
position: sticky;
top: 40px;
z-index: 9;
}
.table {
.cell-item {
@include font-size(15);
white-space: nowrap;
}
.name {
font-weight: 700;
cursor: pointer;
}
}
@media only screen and (max-width: 690px) {
.table-tools {
padding: 0 0 5px;
}
}
@media (prefers-color-scheme: dark) {
.table-tools {
background: $dark_mode_background;
}
.action-icons {
.icon {
cursor: pointer;
circle, path, line, polyline {
stroke: $dark_mode_text_primary;
}
}
}
.user-thumbnail {
.info {
.email {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
@@ -0,0 +1,148 @@
<template>
<div id="single-page">
<div id="page-content" class="medium-width" v-if="! isLoading">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :can-back="true" :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<!--User thumbnail-->
<div class="user-thumbnail">
<div class="avatar">
<img :src="gateway.attributes.avatar" :alt="gateway.attributes.gateway">
</div>
<div class="info">
<b class="name">{{ gateway.attributes.gateway }}</b>
<span class="email">Payment Gateway</span>
</div>
</div>
<!--Page Tab links-->
<div class="menu-list-wrapper horizontal">
<router-link replace :to="{name: 'GatewaySettings', params: {name: gateway.attributes.type}}" class="menu-list-item link">
<div class="icon">
<settings-icon size="17"></settings-icon>
</div>
<div class="label">
Settings
</div>
</router-link>
<router-link replace :to="{name: 'GatewayTransactions', params: {name: gateway.attributes.type}}" class="menu-list-item link">
<div class="icon">
<credit-card-icon size="17"></credit-card-icon>
</div>
<div class="label">
Transactions
</div>
</router-link>
</div>
<!--Router Content-->
<router-view :gateway="gateway"/>
</div>
</div>
<div id="loader" v-if="isLoading">
<Spinner></Spinner>
</div>
</div>
</template>
<script>
import {CreditCardIcon, SettingsIcon} from 'vue-feather-icons'
import MobileHeader from '@/components/Mobile/MobileHeader'
import SectionTitle from '@/components/Others/SectionTitle'
import PageHeader from '@/components/Others/PageHeader'
import Spinner from '@/components/FilesView/Spinner'
import {mapGetters} from 'vuex'
import axios from 'axios'
export default {
name: 'Profile',
components: {
SettingsIcon,
CreditCardIcon,
SectionTitle,
MobileHeader,
PageHeader,
Spinner,
},
data() {
return {
isLoading: false,
gateway: {
id: '1',
type: 'payment_method',
attributes: {
type: 'stripe',
gateway: 'Stripe',
avatar: '/assets/images/stripe-logo-thumbnail.png',
status: 1,
payments_processed: 798,
active_subscribers: 3587,
}
},
}
},
created() {
/*axios.get('/api/users/' + this.$route.params.id + '/detail')
.then(response => {
this.user = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.user-thumbnail {
display: flex;
align-items: center;
cursor: pointer;
.avatar {
margin-right: 20px;
img {
line-height: 0;
width: 62px;
height: 62px;
border-radius: 12px;
}
}
.info {
.name {
display: block;
@include font-size(17);
line-height: 1;
}
.email {
color: $text-muted;
@include font-size(14);
}
}
}
@media only screen and (max-width: 960px) {
}
@media (prefers-color-scheme: dark) {
.user-thumbnail {
.info {
.email {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
@@ -0,0 +1,91 @@
<template>
<div class="page-tab">
<!--Personal Information-->
<div class="page-tab-group">
<ValidationObserver ref="personalInformation" v-slot="{ invalid }" tag="form" class="form block-form">
<b class="form-group-label">Stripe Secret</b>
<!---->
<div class="block-wrapper">
<label>Stripe Client ID</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="ClientID" rules="required"
v-slot="{ errors }">
<input placeholder="Paste stripe client id here" type="text" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
<!---->
<div class="block-wrapper">
<label>Stripe Secret</label>
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="StripeSecret" rules="required"
v-slot="{ errors }">
<input placeholder="Paste stripe secret here" type="text" />
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider>
</div>
</ValidationObserver>
</div>
</div>
</template>
<script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import StorageItemDetail from '@/components/Others/StorageItemDetail'
import SelectInput from '@/components/Others/Forms/SelectInput'
import ButtonBase from '@/components/FilesView/ButtonBase'
import SetupBox from '@/components/Others/Forms/SetupBox'
import {required} from 'vee-validate/dist/rules'
import { mapGetters } from 'vuex'
import {events} from "@/bus"
import axios from 'axios'
export default {
name: 'UserDetail',
props: [
'user'
],
components: {
ValidationProvider,
ValidationObserver,
StorageItemDetail,
SelectInput,
ButtonBase,
SetupBox,
required,
},
data() {
return {
isLoading: false,
isSendingRequest: false,
}
},
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
@import '@assets/vue-file-manager/_forms';
.page-tab {
.page-tab-group {
margin-bottom: 45px;
}
}
.block-form {
max-width: 100%;
}
@media only screen and (max-width: 960px) {
}
@media (prefers-color-scheme: dark) {
}
</style>
@@ -0,0 +1,199 @@
<template>
<div class="page-tab">
<!--Change role-->
<div class="page-tab-group">
<DatatableWrapper :paginator="true" :columns="columns" :data="invoices" class="table">
<template scope="{ row }">
<tr>
<td>
<span class="cell-item">
${{ row.attributes.total }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.plan }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.created_at_formatted }}
</span>
</td>
<td>
<div class="action-icons">
<download-cloud-icon size="15" class="icon"></download-cloud-icon>
</div>
</td>
</tr>
</template>
</DatatableWrapper>
</div>
</div>
</template>
<script>
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import {DownloadCloudIcon} from "vue-feather-icons";
import axios from 'axios'
export default {
name: 'UserStorage',
components: {
DatatableWrapper,
DownloadCloudIcon,
},
data() {
return {
isLoading: false,
invoices: [
{
id: '1',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '2',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '3',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '4',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '5',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '6',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '7',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '8',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
],
columns: [
{
label: 'Total',
field: 'attributes.total',
sortable: true
},
{
label: 'Plan',
field: 'attributes.plan',
sortable: true
},
{
label: 'Payed',
field: 'attributes.created_at',
sortable: true
},
{
label: this.$t('admin_page_user.table.action'),
field: 'data.action',
sortable: false
},
],
}
},
created() {
/*axios.get('/api/users/' + this.$route.params.id + '/storage')
.then(response => {
this.storage = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
@import '@assets/vue-file-manager/_forms';
.page-tab {
.page-tab-group {
margin-bottom: 45px;
}
}
.block-form {
max-width: 100%;
}
@media only screen and (max-width: 960px) {
}
@media (prefers-color-scheme: dark) {
}
</style>
+240
View File
@@ -0,0 +1,240 @@
<template>
<div id="single-page">
<div id="page-content" v-if="! isLoading">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
<div class="content-page">
<div class="table-tools">
<div class="buttons">
<router-link :to="{name: 'UserCreate'}">
<MobileActionButton icon="plus">
Create Plan
</MobileActionButton>
</router-link>
</div>
<div class="searching">
</div>
</div>
<DatatableWrapper :paginator="false" :columns="columns" :data="plans" class="table table-users">
<template scope="{ row }">
<tr>
<td class="name">
<router-link :to="{name: 'UserDetail', params: {id: row.id}}" class="cell-item" tag="div">
<span>{{ row.attributes.name }}</span>
</router-link>
</td>
<td>
<span class="cell-item">
<SwitchInput class="switch" :state="row.attributes.status"/>
</span>
</td>
<td>
<span class="cell-item">
${{ row.attributes.price }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.capacity }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.subscribers }}
</span>
</td>
<td>
<div class="action-icons">
<router-link :to="{name: 'UserDetail', params: {id: row.id}}">
<edit-2-icon size="15" class="icon icon-edit"></edit-2-icon>
</router-link>
<router-link :to="{name: 'UserDelete', params: {id: row.id}}">
<trash2-icon size="15" class="icon icon-trash"></trash2-icon>
</router-link>
</div>
</td>
</tr>
</template>
</DatatableWrapper>
</div>
</div>
<div id="loader" v-if="isLoading">
<Spinner></Spinner>
</div>
</div>
</template>
<script>
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import MobileActionButton from '@/components/FilesView/MobileActionButton'
import SwitchInput from '@/components/Others/Forms/SwitchInput'
import MobileHeader from '@/components/Mobile/MobileHeader'
import SectionTitle from '@/components/Others/SectionTitle'
import ButtonBase from '@/components/FilesView/ButtonBase'
import {Trash2Icon, Edit2Icon} from "vue-feather-icons";
import PageHeader from '@/components/Others/PageHeader'
import ColorLabel from '@/components/Others/ColorLabel'
import Spinner from '@/components/FilesView/Spinner'
import axios from 'axios'
export default {
name: 'Plans',
components: {
MobileActionButton,
DatatableWrapper,
SectionTitle,
MobileHeader,
SwitchInput,
Trash2Icon,
PageHeader,
ButtonBase,
ColorLabel,
Edit2Icon,
Spinner,
},
data() {
return {
isLoading: false,
plans: [
{
id: '1',
type: 'plans',
attributes: {
name: 'Starter Plan',
status: 1,
price: 9.99,
capacity: '200GB',
subscribers: 172,
}
},
{
id: '2',
type: 'plans',
attributes: {
name: 'Professional Plan',
status: 0,
price: 19.99,
capacity: '500GB',
subscribers: 1929,
}
},
{
id: '3',
type: 'plans',
attributes: {
name: 'Business Plan',
status: 1,
price: 44.99,
capacity: '1TB',
subscribers: 389,
}
},
],
columns: [
{
label: 'Plan',
field: 'attributes.name',
sortable: true
},
{
label: 'Status',
field: 'attributes.status',
sortable: true
},
{
label: 'Price',
field: 'attributes.price',
sortable: true
},
{
label: 'Storage Capacity',
field: 'attributes.capacity',
sortable: true
},
{
label: 'Subscribers',
field: 'attributes.subscribers',
sortable: true
},
{
label: this.$t('admin_page_user.table.action'),
field: 'data.action',
sortable: false
},
],
}
},
created() {
/*axios.get('/api/plans')
.then(response => {
this.plans = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
.table-tools {
background: white;
display: flex;
justify-content: space-between;
padding: 15px 0 10px;
position: sticky;
top: 40px;
z-index: 9;
}
.table {
.cell-item {
@include font-size(15);
white-space: nowrap;
}
.name {
font-weight: 700;
cursor: pointer;
}
}
@media only screen and (max-width: 690px) {
.table-tools {
padding: 0 0 5px;
}
}
@media (prefers-color-scheme: dark) {
.table-tools {
background: $dark_mode_background;
}
.action-icons {
.icon {
cursor: pointer;
circle, path, line, polyline {
stroke: $dark_mode_text_primary;
}
}
}
.user-thumbnail {
.info {
.email {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
+9 -85
View File
@@ -1,6 +1,6 @@
<template>
<div id="single-page">
<div id="page-content" class="medium-width" v-if="! isLoading">
<div id="page-content" v-if="! isLoading">
<MobileHeader :title="$router.currentRoute.meta.title"/>
<PageHeader :title="$router.currentRoute.meta.title"/>
@@ -21,14 +21,12 @@
<template scope="{ row }">
<tr>
<td style="width: 300px">
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}" tag="div" class="user-thumbnail">
<div class="avatar">
<img :src="row.data.attributes.avatar" :alt="row.data.attributes.name">
</div>
<div class="info">
<b class="name">{{ row.data.attributes.name }}</b>
<span class="email">{{ row.data.attributes.email }}</span>
</div>
<router-link :to="{name: 'UserDetail', params: {id: row.data.id}}">
<DatatableCellImage
:image="row.data.attributes.avatar"
:title="row.data.attributes.name"
:description="row.data.attributes.email"
/>
</router-link>
</td>
<td>
@@ -73,6 +71,7 @@
</template>
<script>
import DatatableCellImage from '@/components/Others/Tables/DatatableCellImage'
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import MobileActionButton from '@/components/FilesView/MobileActionButton'
import MobileHeader from '@/components/Mobile/MobileHeader'
@@ -87,6 +86,7 @@
export default {
name: 'Profile',
components: {
DatatableCellImage,
MobileActionButton,
DatatableWrapper,
SectionTitle,
@@ -172,33 +172,6 @@
z-index: 9;
}
.action-icons {
white-space: nowrap;
a {
display: inline-block;
margin-left: 10px;
&:first-child {
margin-left: 0;
}
}
.icon {
cursor: pointer;
circle, path, line, polyline {
stroke: $text;
}
&.icon-trash {
circle, path, line, polyline {
stroke: $red;
}
}
}
}
.table {
.cell-item {
@@ -207,45 +180,6 @@
}
}
.user-thumbnail {
display: flex;
align-items: center;
cursor: pointer;
.avatar {
margin-right: 20px;
line-height: 0;
img {
line-height: 0;
width: 48px;
height: 48px;
border-radius: 8px;
}
}
.info {
.name, .email {
max-width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
.name {
@include font-size(15);
line-height: 1;
}
.email {
color: $text-muted;
@include font-size(12);
}
}
}
@media only screen and (max-width: 690px) {
.table-tools {
padding: 0 0 5px;
@@ -268,16 +202,6 @@
}
}
}
.user-thumbnail {
.info {
.email {
color: $dark_mode_text_secondary;
}
}
}
}
</style>
+19 -7
View File
@@ -16,7 +16,8 @@
{{ user.attributes.name }}
<ColorLabel color="purple">
{{ user.attributes.role }}
</ColorLabel></b>
</ColorLabel>
</b>
<span class="email">{{ user.attributes.email }}</span>
</div>
</div>
@@ -41,6 +42,15 @@
</div>
</router-link>
<router-link replace :to="{name: 'UserInvoices'}" class="menu-list-item link">
<div class="icon">
<file-text-icon size="17"></file-text-icon>
</div>
<div class="label">
Invoices
</div>
</router-link>
<router-link replace :to="{name: 'UserPassword'}" class="menu-list-item link">
<div class="icon">
<lock-icon size="17"></lock-icon>
@@ -50,7 +60,8 @@
</div>
</router-link>
<router-link replace :to="{name: 'UserDelete'}" v-if="user.attributes.name !== app.user.name" class="menu-list-item link">
<router-link replace :to="{name: 'UserDelete'}" v-if="user.attributes.name !== app.user.name"
class="menu-list-item link">
<div class="icon">
<trash2-icon size="17"></trash2-icon>
</div>
@@ -61,7 +72,7 @@
</div>
<!--Router Content-->
<router-view :user="user" @reload-user="fetchUser" />
<router-view :user="user" @reload-user="fetchUser"/>
</div>
</div>
<div id="loader" v-if="isLoading">
@@ -71,28 +82,29 @@
</template>
<script>
import { UserIcon, HardDriveIcon, LockIcon, Trash2Icon } from 'vue-feather-icons'
import {UserIcon, HardDriveIcon, LockIcon, Trash2Icon, FileTextIcon} from 'vue-feather-icons'
import StorageItemDetail from '@/components/Others/StorageItemDetail'
import MobileHeader from '@/components/Mobile/MobileHeader'
import SectionTitle from '@/components/Others/SectionTitle'
import PageHeader from '@/components/Others/PageHeader'
import ColorLabel from '@/components/Others/ColorLabel'
import Spinner from '@/components/FilesView/Spinner'
import { mapGetters } from 'vuex'
import {mapGetters} from 'vuex'
import axios from 'axios'
export default {
name: 'Profile',
components: {
Trash2Icon,
LockIcon,
HardDriveIcon,
StorageItemDetail,
SectionTitle,
FileTextIcon,
MobileHeader,
PageHeader,
ColorLabel,
Trash2Icon,
UserIcon,
LockIcon,
Spinner,
},
computed: {
@@ -0,0 +1,199 @@
<template>
<div class="page-tab">
<!--Change role-->
<div class="page-tab-group">
<DatatableWrapper :paginator="true" :columns="columns" :data="invoices" class="table">
<template scope="{ row }">
<tr>
<td>
<span class="cell-item">
${{ row.attributes.total }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.plan }}
</span>
</td>
<td>
<span class="cell-item">
{{ row.attributes.created_at_formatted }}
</span>
</td>
<td>
<div class="action-icons">
<download-cloud-icon size="15" class="icon"></download-cloud-icon>
</div>
</td>
</tr>
</template>
</DatatableWrapper>
</div>
</div>
</template>
<script>
import DatatableWrapper from '@/components/Others/Tables/DatatableWrapper'
import {DownloadCloudIcon} from "vue-feather-icons";
import axios from 'axios'
export default {
name: 'UserStorage',
components: {
DatatableWrapper,
DownloadCloudIcon,
},
data() {
return {
isLoading: false,
invoices: [
{
id: '1',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '2',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '3',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '4',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '5',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '6',
type: 'invoices',
attributes: {
total: 9.99,
plan: 'Starter Plan',
created_at: '30. April. 2020',
created_at_formatted: '30. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '7',
type: 'invoices',
attributes: {
total: 49.99,
plan: 'Business Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
{
id: '8',
type: 'invoices',
attributes: {
total: 29.99,
plan: 'Professional Plan',
created_at: '31. April. 2020',
created_at_formatted: '31. April. 2020',
download: 'https://vuefilemanager.com/',
},
},
],
columns: [
{
label: 'Total',
field: 'attributes.total',
sortable: true
},
{
label: 'Plan',
field: 'attributes.plan',
sortable: true
},
{
label: 'Payed',
field: 'attributes.created_at',
sortable: true
},
{
label: this.$t('admin_page_user.table.action'),
field: 'data.action',
sortable: false
},
],
}
},
created() {
/*axios.get('/api/users/' + this.$route.params.id + '/storage')
.then(response => {
this.storage = response.data.data
this.isLoading = false
})*/
}
}
</script>
<style lang="scss" scoped>
@import '@assets/vue-file-manager/_variables';
@import '@assets/vue-file-manager/_mixins';
@import '@assets/vue-file-manager/_forms';
.page-tab {
.page-tab-group {
margin-bottom: 45px;
}
}
.block-form {
max-width: 100%;
}
@media only screen and (max-width: 960px) {
}
@media (prefers-color-scheme: dark) {
}
</style>
+2 -2
View File
@@ -86,8 +86,8 @@
return {
isLoading: false,
checkedAccount: undefined,
loginPassword: '',
loginEmail: '',
loginPassword: 'vuefilemanager',
loginEmail: 'howdy@hi5ve.digital',
}
},
methods: {