/* eslint-disable */
import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld.vue'

Vue.use(Router)



const router = new Router({
    mode: 'hash',
    base: '/',
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index',
            name: '首页',
            component: r => require.ensure([], () => r(require('../views/index')), 'index'),
            children:[
                { path: '', component:r => require.ensure([], () => r(require('../views/dashbord')), 'dashbord'),},
                {
                    path: 'dashbord', component: r => require.ensure([], () => r(require('../views/dashbord')), 'dashbord'),
                },
                {
                    path: 'fan',  component: r => require.ensure([], () => r(require('../views/fan')), 'fan'),
                },
                {
                    path: 'fru_info',  component: r => require.ensure([], () => r(require('../views/FRUInfo')), 'fan'),
                },
                {
                    path: 'active_directory',
                    meta: {
                        title: 'Active Directory'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/ActiveDirectory')), 'configuration'),
                },
                {
                    path: 'dns',
                    meta: {
                        title: 'DNS'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/DNS')), 'configuration'),
                },
                {
                    path: 'event_log',
                    meta: {
                        title: '事件日志'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/EventLog')), 'configuration'),
                },
                {
                    path: 'images_redirection',
                    meta: {
                        title: 'Images重定向'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/ImagesRedirection')), 'configuration'),
                },
                {
                    path: 'ldap',
                    meta: {
                        title: 'LDAP/E-Directory'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/LDAP')), 'configuration'),
                },
                {
                    path: 'license',
                    meta: {
                        title: '证书'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/License')), 'configuration'),
                },
                {
                    path: 'mouse_mode',
                    meta: {
                        title: '证书'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/MouseMode')), 'configuration'),
                },
                {
                    path: 'ncsi',
                    meta: {
                        title: 'NCSI'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/NCSI')), 'configuration'),
                },
                {
                    path: 'network',
                    meta: {
                        title: '网络'
                    },
                    component: r => require.ensure([], () => r(require('../views/configuration/Network')), 'configuration'),
                },
            ]
        },
        {
            path: '/login',
            name: '登录',
            component: r => require.ensure([], () => r(require('../views/login')), 'login')
        },

    ]
})

// router.beforeEach((to, from, next) => {

//     let title = to.name ? to.name : '领存企业'
//     next()
// })
// // 跳转后返回顶部
// router.afterEach((to, from, next) => {
//     window.scrollTo(0, 0)
// })
export default router
