mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-20 08:52:15 +00:00
frontend update
This commit is contained in:
607
resources/js/router.js
vendored
607
resources/js/router.js
vendored
@@ -17,17 +17,24 @@ import Files from './views/FilePages/Files'
|
||||
import Password from './views/User/Password'
|
||||
import SharedFiles from './views/FilePages/SharedFiles'
|
||||
|
||||
import MobileSettings from './views/Mobile/MobileSettings'
|
||||
import AdminMobileMenu from './views/Mobile/AdminMobileMenu'
|
||||
|
||||
import Admin from './views/Admin'
|
||||
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'
|
||||
import Gateways from './views/Admin/Gateways'
|
||||
import Gateway from './views/Admin/Gateways/Gateway'
|
||||
import GatewaySettings from './views/Admin/Gateways/GatewayTabs/GatewaySettings'
|
||||
import GatewayTransactions from './views/Admin/Gateways/GatewayTabs/GatewayTransactions'
|
||||
|
||||
// Plans
|
||||
import Plans from './views/Admin/Plans'
|
||||
import Plan from './views/Admin/Plans/Plan'
|
||||
import PlanCreate from './views/Admin/Plans/PlanCreate'
|
||||
import PlanDelete from './views/Admin/Plans/PlanTabs/PlanDelete'
|
||||
import PlanSettings from './views/Admin/Plans/PlanTabs/PlanSettings'
|
||||
import PlanTransactions from './views/Admin/Plans/PlanTabs/PlanTransactions'
|
||||
|
||||
// Users
|
||||
import Users from './views/Admin/Users'
|
||||
@@ -41,277 +48,333 @@ import UserInvoices from './views/Admin/Users/UserTabs/UserInvoices'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
const routesAdmin = [
|
||||
{
|
||||
name: 'Admin',
|
||||
path: '/admin',
|
||||
component: Admin,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Admin'
|
||||
},
|
||||
children: [
|
||||
|
||||
// List Pages
|
||||
{
|
||||
name: 'Gateways',
|
||||
path: '/admin/payment-methods',
|
||||
component: Gateways,
|
||||
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',
|
||||
component: Users,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_list')
|
||||
},
|
||||
},
|
||||
|
||||
// Create Pages
|
||||
{
|
||||
name: 'UserCreate',
|
||||
path: '/admin/user/create',
|
||||
component: UserCreate,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.user_create')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PlanCreate',
|
||||
path: '/admin/plan/create',
|
||||
component: PlanCreate,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Create Plan'
|
||||
},
|
||||
},
|
||||
|
||||
// Single pages
|
||||
{
|
||||
name: 'User',
|
||||
path: '/admin/user/:id',
|
||||
component: User,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_user')
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'UserDetail',
|
||||
path: '/admin/user/:id/details',
|
||||
component: UserDetail,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_detail')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'UserStorage',
|
||||
path: '/admin/user/:id/storage',
|
||||
component: UserStorage,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
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',
|
||||
component: UserPassword,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_password')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'UserDelete',
|
||||
path: '/admin/user/:id/delete',
|
||||
component: UserDelete,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_delete')
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Gateway',
|
||||
path: '/admin/payment-method/:name',
|
||||
component: Gateway,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Payment Method'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'GatewayTransactions',
|
||||
path: '/admin/payment-methods/:name/transactions',
|
||||
component: GatewayTransactions,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Transactions'
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'GatewaySettings',
|
||||
path: '/admin/payment-methods/:name/settings',
|
||||
component: GatewaySettings,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Settings',
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Plan',
|
||||
path: '/admin/plan/:id',
|
||||
component: Plan,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Plan'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'PlanTransactions',
|
||||
path: '/admin/plan/:id/transactions',
|
||||
component: PlanTransactions,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Plan Transactions'
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PlanSettings',
|
||||
path: '/admin/plan/:id/settings',
|
||||
component: PlanSettings,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Plan Settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'PlanDelete',
|
||||
path: '/admin/plan/:id/delete',
|
||||
component: PlanDelete,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: 'Plan Delete',
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'AdminMobileMenu',
|
||||
path: '/admin-menu',
|
||||
component: AdminMobileMenu,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_mobile')
|
||||
},
|
||||
},
|
||||
]
|
||||
const routesShared = [
|
||||
{
|
||||
name: 'SharedPage',
|
||||
path: '/shared/:token',
|
||||
component: SharedPage,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NotFoundShared',
|
||||
path: '/shared-not-found',
|
||||
component: NotFoundShared,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'SharedFiles',
|
||||
path: '/shared-files',
|
||||
component: SharedFiles,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
]
|
||||
const routesAuth = [
|
||||
{
|
||||
name: 'SignIn',
|
||||
path: '/',
|
||||
component: Index,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'SignUp',
|
||||
path: '/sign-up',
|
||||
component: SignUp,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ForgottenPassword',
|
||||
path: '/forgotten-password',
|
||||
component: ForgottenPassword,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'CreateNewPassword',
|
||||
path: '/create-new-password',
|
||||
component: CreateNewPassword,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
]
|
||||
const routesUser = [
|
||||
{
|
||||
name: 'Settings',
|
||||
path: '/settings',
|
||||
component: Settings,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'Profile',
|
||||
path: 'profile',
|
||||
component: Profile,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.profile')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Password',
|
||||
path: '/settings/password',
|
||||
component: Password,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_password')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Storage',
|
||||
path: '/settings/storage',
|
||||
component: Storage,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_storage')
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Files',
|
||||
path: '/files',
|
||||
component: Files,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Trash',
|
||||
path: '/trash',
|
||||
component: Trash,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
const router = new Router({
|
||||
mode: 'history',
|
||||
routes: [
|
||||
{
|
||||
name: 'SignIn',
|
||||
path: '/',
|
||||
component: Index,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'SignUp',
|
||||
path: '/sign-up',
|
||||
component: SignUp,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ForgottenPassword',
|
||||
path: '/forgotten-password',
|
||||
component: ForgottenPassword,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'CreateNewPassword',
|
||||
path: '/create-new-password',
|
||||
component: CreateNewPassword,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'SharedPage',
|
||||
path: '/shared/:token',
|
||||
component: SharedPage,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'NotFoundShared',
|
||||
path: '/shared-not-found',
|
||||
component: NotFoundShared,
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Files',
|
||||
path: '/files',
|
||||
component: Files,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'SharedFiles',
|
||||
path: '/shared-files',
|
||||
component: SharedFiles,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Trash',
|
||||
path: '/trash',
|
||||
component: Trash,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Admin',
|
||||
path: '/admin',
|
||||
component: Admin,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
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',
|
||||
component: Users,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_list')
|
||||
},
|
||||
},
|
||||
|
||||
// Create Pages
|
||||
{
|
||||
name: 'UserCreate',
|
||||
path: '/admin/user/create',
|
||||
component: UserCreate,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.user_create')
|
||||
},
|
||||
},
|
||||
|
||||
// Single pages
|
||||
{
|
||||
name: 'User',
|
||||
path: '/admin/user/:id',
|
||||
component: User,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_user')
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'UserDetail',
|
||||
path: '/admin/user/:id/details',
|
||||
component: UserDetail,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_detail')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'UserStorage',
|
||||
path: '/admin/user/:id/storage',
|
||||
component: UserStorage,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
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',
|
||||
component: UserPassword,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_password')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'UserDelete',
|
||||
path: '/admin/user/:id/delete',
|
||||
component: UserDelete,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.users_delete')
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
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'
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Settings',
|
||||
path: '/settings',
|
||||
component: Settings,
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'Profile',
|
||||
path: 'profile',
|
||||
component: Profile,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.profile')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Password',
|
||||
path: '/settings/password',
|
||||
component: Password,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_password')
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Storage',
|
||||
path: '/settings/storage',
|
||||
component: Storage,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_storage')
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'MobileSettings',
|
||||
path: '/settings-mobile',
|
||||
component: MobileSettings,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: i18n.t('routes_title.settings_mobile')
|
||||
},
|
||||
}
|
||||
...routesAdmin, ...routesShared, ...routesAuth, ...routesUser
|
||||
],
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user