n8n/packages/editor-ui/src/router.ts

53 lines
988 B
TypeScript
Raw Normal View History

2019-06-23 03:35:23 -07:00
import Vue from 'vue';
import Router from 'vue-router';
import MainHeader from '@/components/MainHeader.vue';
import MainSidebar from '@/components/MainSidebar.vue';
import NodeView from '@/views/NodeView.vue';
Vue.use(Router);
export default new Router({
mode: 'history',
// @ts-ignore
2020-07-14 14:36:05 -07:00
base: window.BASE_PATH === '/%BASE_PATH%/' ? '/' : window.BASE_PATH,
2019-06-23 03:35:23 -07:00
routes: [
{
path: '/execution/:id',
name: 'ExecutionById',
components: {
default: NodeView,
header: MainHeader,
sidebar: MainSidebar,
},
},
{
path: '/oauth2/callback',
name: 'oAuth2Callback',
components: {
},
},
2019-06-23 03:35:23 -07:00
{
path: '/workflow',
name: 'NodeViewNew',
components: {
default: NodeView,
header: MainHeader,
sidebar: MainSidebar,
},
},
{
path: '/workflow/:name',
name: 'NodeViewExisting',
components: {
default: NodeView,
header: MainHeader,
sidebar: MainSidebar,
},
},
{
path: '/',
redirect: '/workflow',
},
],
});