import AppLayout from '@/layout/AppLayout.vue';

import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            component: AppLayout,
            meta: {
                auth: true
            },
            children: [
            {
                path: 'scenario',
                children: [
                {
                        path: '/projects',
                        name: 'projects-list',
                        component: () => import('@/views/pages/ProjectList.vue')
                },
                {
                    path: '/',
                    name: 'scenario-list',
                    component: () => import('@/views/pages/ScenarioList.vue')
                },
                {
                    path: 'exec/:id',
                    name: 'scenario-exec',
                    component: () => import('@/views/pages/ScenarioExec.vue')
                },
                {
                    path: 'exec-history',
                    name: 'scenario-exec-history',
                    component: () => import('@/views/pages/OldScenarioExec.vue')
                },
                {
                    path: '/executions',
                    name: 'executions',
                    component: () => import('@/views/pages/ScenarioExecList.vue')
                },
                {
                    path: '/canvas',
                    name: 'canvas',
                    component: () => import('@/views/pages/canvas/Canvas.vue')
                },
                {
                    path: '/app-browser',
                    name: 'app-browser',
                    component: () => import('@/views/pages/ApplicationBrowser.vue')
                },
                {
                    path: '/mdcanvas',
                    name: 'mdcanvas',
                    component: () => import('@/views/pages/canvas/MdCanvas.vue')
                }
                ]
            }
            ]
        },
        {
            path: '/auth/login',
            name: 'login',
            component: () => import('@/views/pages/auth/Login.vue') 
        }    
    ]
});

export default router;
