import { RouterView } from 'vue-router';
import accountCard from './account/accountCard';
import roleCard from './account/roleCard';
import aliasCard from './account/aliasCard';

export default {
    path: '/account',
    name: 'Account',
    meta: {
        title: 'users',
        icon: 'face',
        moduleName: 'Account',
        keyBinding: 'u',
        menu: [
            'AccountList',
            'AccountRoles',
            'AccountAlias',
            'AccountAccounts',
            'AccountLdap',
            'AccountSamba',
            'AccountAcls',
            'AccountConnections',
        ],
    },
    component: RouterView,
    redirect: { name: 'AccountMain' },
    children: [
        {
            path: '',
            name: 'AccountMain',
            component: () => import('src/components/common/VnSectionMain.vue'),
            redirect: { name: 'AccountIndexMain' },
            children: [
                {
                    path: '',
                    name: 'AccountIndexMain',
                    redirect: { name: 'AccountList' },
                    component: () => import('src/pages/Account/AccountList.vue'),
                    children: [
                        {
                            name: 'AccountList',
                            path: 'list',
                            meta: {
                                title: 'list',
                                icon: 'view_list',
                            },
                        },
                        accountCard,
                    ],
                },
                {
                    path: 'role',
                    name: 'AccountRoles',
                    redirect: { name: 'AccountRoleList' },
                    meta: {
                        title: 'roles',
                        icon: 'group',
                    },
                    component: () => import('src/pages/Account/Role/AccountRoles.vue'),
                    children: [
                        {
                            name: 'AccountRoleList',
                            path: 'list',
                        },
                        roleCard,
                    ],
                },
                {
                    path: 'alias',
                    name: 'AccountAlias',
                    redirect: { name: 'AccountAliasList' },
                    meta: {
                        title: 'alias',
                        icon: 'email',
                    },
                    component: () => import('src/pages/Account/AccountAliasList.vue'),
                    children: [
                        {
                            name: 'AccountAliasList',
                            path: 'list',
                        },
                        aliasCard,
                    ],
                },
                {
                    path: 'acls',
                    name: 'AccountAcls',
                    meta: {
                        title: 'acls',
                        icon: 'check',
                    },
                    component: () => import('src/pages/Account/AccountAcls.vue'),
                },
                {
                    path: 'accounts',
                    name: 'AccountAccounts',
                    meta: {
                        title: 'accounts',
                        icon: 'accessibility',
                        acls: [{ model: 'Account', props: '*', accessType: '*' }],
                    },
                    component: () => import('src/pages/Account/AccountAccounts.vue'),
                },
                {
                    path: 'ldap',
                    name: 'AccountLdap',
                    meta: {
                        title: 'ldap',
                        icon: 'account_tree',
                        acls: [{ model: 'LdapConfig', props: '*', accessType: '*' }],
                    },
                    component: () => import('src/pages/Account/AccountLdap.vue'),
                },
                {
                    path: 'samba',
                    name: 'AccountSamba',
                    meta: {
                        title: 'samba',
                        icon: 'preview',
                        acls: [{ model: 'SambaConfig', props: '*', accessType: '*' }],
                    },
                    component: () => import('src/pages/Account/AccountSamba.vue'),
                },
                {
                    path: 'connections',
                    name: 'AccountConnections',
                    meta: {
                        title: 'connections',
                        icon: 'share',
                    },
                    component: () => import('src/pages/Account/AccountConnections.vue'),
                },
                {
                    path: 'acl-form',
                    name: 'AccountAclForm',
                    component: () => import('src/pages/Account/Acls/AclFormView.vue'),
                },
            ],
        },
    ],
};
